Skip to content

Conversation

@Buuh2511
Copy link
Contributor

@Buuh2511 Buuh2511 commented Jan 9, 2026

Track User Wallet Addresses via Log File

Fixes #72

Types of change

  • Feature
  • Bug
  • Enhancement

Comments (optional)

Changes

Database Schema

  • Vote table: Added zkVerifyTxHash field for proof transaction hashes
  • LoginHistory table: New table tracking all login events
    • Fields: commitment, walletAddress, jobId, zkVerifyTxHash, createdAt
    • Creates new record per login (no overwrites)

Backend Services

zkVerify Integration (zkverify.service.ts)

  • submitProofAndWaitFinalized() now returns { jobId, status, txHash }

Authentication (auth.service.ts)

  • Saves each login to login_history with zkVerifyTxHash
  • Try-catch wrapper prevents DB errors from blocking login

Transaction Voting (transaction.service.ts)

  • createTransaction() and approve() store zkVerifyTxHash in Vote records

Analytics Logging (analytics-logger.service.ts)

  • All 6 action methods include zkVerifyTxHash: LOGIN, APPROVE, EXECUTE, DENY, ADD_SIGNER, REMOVE_SIGNER, UPDATE_THRESHOLD
  • Log format: timestamp | action | user_address | multisig_wallet | nonce | zkverify_txhash

Report Generation

  • New script: generate-analytics-report.ts
  • Command: yarn report → generates analytics-report.csv
  • Columns: Timestamp, Action, User Address, Multisig Wallet, Nonce, zkVerify TxHash, Explorer Link
  • Explorer links: https://zkverify-testnet.subscan.io/tx/{txHash}

Frontend

  • Updated hooks to pass userAddress: walletClient.account.address
  • Modified: useTransactionVote, useTransferTransaction, useSignerTransaction, useBatchTransaction

Storage Architecture

Action Type Storage Location
LOGIN login_history table
APPROVE/DENY votes table
EXECUTE, ADD_SIGNER, REMOVE_SIGNER, UPDATE_THRESHOLD Log file only

Privacy Model

  • Wallet addresses in login_history table and logs only
  • NOT linked to ZK commitments in users table
  • Random 0-500ms delay prevents timing correlation
  • Core ZK privacy model intact

Verification

cd packages/backend && yarn report

  • Open reports/analytics-report.csv
  • Click explorer links to verify zkVerify proofs onchain
  • Check login_history/votes tables in Prisma Studio

Excel file

Screenshot 2026-01-26 at 15 01 49

@Buuh2511 Buuh2511 marked this pull request as draft January 9, 2026 11:51
@Buuh2511 Buuh2511 requested a review from Huygon764 January 13, 2026 03:28
@Buuh2511 Buuh2511 marked this pull request as ready for review January 13, 2026 03:28
@Buuh2511 Buuh2511 changed the title Track info Track User Wallet Addresses via Log File Jan 13, 2026
@Buuh2511 Buuh2511 self-assigned this Jan 13, 2026
@Huygon764
Copy link
Contributor

Need to track other actions of users, like user with address A executes tx A,... But it will make our app lose privacy, so take this PR as pending for now

@Buuh2511 Buuh2511 requested a review from Huygon764 January 20, 2026 12:29
@Huygon764
Copy link
Contributor

@gianalarcon can check here sir.

@Buuh2511 Buuh2511 marked this pull request as draft January 22, 2026 11:10
@Buuh2511 Buuh2511 marked this pull request as ready for review January 23, 2026 05:45
@Buuh2511 Buuh2511 requested a review from gianalarcon January 26, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Track User Wallet Addresses via Log File

3 participants