Skip to content

arshiaxbt/WhyTx

Repository files navigation

WhyTx

Your wallet remembers what. WhyTx remembers why.

WhyTx is a private memory and proof layer for crypto transactions. It lets a wallet owner attach encrypted context to a confirmed Monad transaction, preserve version history, selectively reveal fields, and prove that the revealed context matches a timestamped onchain commitment.

Built from scratch for the Spark hackathon, July 13–19, 2026.

Open the live app · Watch the onchain demo

The working loop

  1. Connect a browser or mobile EVM wallet through Reown AppKit and sign a gas-free unlock message once per tab session.
  2. Choose Monad Mainnet or Monad Testnet and import a confirmed transaction involving that wallet.
  3. Add a purpose, category, counterparty label, status, follow-up date, and private details.
  4. Encrypt the readable record locally with AES-GCM.
  5. Secure a salted Merkle root on the selected Monad network; no readable note goes onchain.
  6. Create a verification link containing only selected fields and their Merkle proofs.
  7. Independently verify both the field proofs and the onchain anchor.
  8. Edit the record as a new linked version; earlier anchors remain intact.

What it proves—and what it does not

WhyTx proves that a wallet created a particular cryptographic record at an onchain time, that the record was linked to a transaction, and that revealed values match that record. It does not prove a personal statement is true, agreed by the counterparty, or legally enforceable.

Privacy model

  • A deterministic wallet signature derives a browser-local AES-256-GCM key.
  • The derived key is cached in sessionStorage so a refresh does not require another signature; disconnecting or closing the tab clears the session.
  • Full records and per-field random salts are stored only as ciphertext in localStorage.
  • Each record field becomes a salted Merkle leaf. The contract receives only the root, original transaction hash, and previous-version ID.
  • Reveal data is encoded in the URL fragment (#...), which browsers do not send to the hosting server.
  • A verifier can check disclosed leaves without learning hidden values.

This hackathon implementation is local-first: clearing browser storage removes the encrypted records. A production release should add encrypted backup and a reviewed recovery design.

Stack

  • React 19, TypeScript, Vite
  • Reown AppKit with its Ethers v6 adapter for non-custodial wallet connections
  • viem for Monad RPC and contract interaction
  • Web Crypto API for AES-GCM
  • Solidity WhyTxRegistry contract
  • Vitest for cryptographic proof tests

Run locally

Requirements: Node.js 22+ and a Reown-compatible EVM wallet.

npm install
cp .env.example .env
npm run dev

Run every check:

npm run check

That command runs linting, unit tests, Solidity compilation, TypeScript, and the production build.

Contract

The contract is intentionally small and append-only. Compile it with:

npm run contract:compile

The build artifact is written to artifacts/WhyTxRegistry.json.

Deploy to mainnet with a funded key supplied only through the environment:

DEPLOYER_PRIVATE_KEY=0x... npm run contract:deploy:mainnet
npm run contract:verify-mainnet

Monad Mainnet deployment

Monad Testnet deployment

Networks

  • Monad Mainnet — chain ID 143, RPC https://rpc.monad.xyz, explorer https://monadscan.com
  • Monad Testnet — chain ID 10143, RPC https://testnet-rpc.monad.xyz, explorer https://testnet.monadexplorer.com

Connected users can switch between both networks from the dashboard. Transaction imports, contract writes, explorer links, and verification links remain bound to the selected chain.

Project structure

contracts/             onchain commitment registry
scripts/               reproducible Solidity compiler
src/lib/chain.ts       live Monad reads and wallet client
src/lib/appkit.ts      Reown wallet connection and Monad network setup
src/lib/merkle.ts      field commitments and selective proofs
src/lib/vault.ts       browser encryption
src/lib/reveal.ts      privacy-preserving verification links
src/App.tsx            product UI and complete user flow

License

MIT

About

Private, verifiable context for crypto transactions on Monad.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages