Transaction Tracking
Transaction tracking is the foundation on which every other TaxChain module—classification, taxation, reporting—depends. To guarantee accuracy, completeness, and verifiability, the protocol employs a multi-layer architecture that ingests raw on-chain activity from dozens of networks, enriches it with contextual metadata, and writes the result into an append-only Tax Graph keyed to each user. Below is a deep technical walk-through of that pipeline.
1. Multi-Chain Listener Fabric
Shard Listener
Streams finalized blocks from a single L1/L2 (Ethereum, Solana, Polygon, Base, Optimism, Arbitrum, etc.).
Geth/Erigon, Solana RPC, Firehose, native WebSocket
Mempool Sentinel
Captures pending tx for high-frequency traders who need seconds-leveltax P&L previews.
Blocknative / mempool-parser
Reorg Guardian
Detects chain re-organizations and rewinds Tax Graph state to maintain canonical history.
Optimistic caching + reversible write-ahead log
Every listener shard emits TxEvents (protobuf messages) that include the raw transaction, parent block header, and a monotonic sequence number to prevent duplication across redundant nodes.
2. Wallet & Identity Resolution
Self-custodial handshake – A user links a wallet by signing a nonce; the public address becomes the root node of their Tax Graph.
Entity discovery – Internal heuristics and on-chain proofs (ENS, Solana Name Service, EIP-6963 wallet delegation) map ancillary addresses—multi-sig owners, contract deployer wallets, cross-chain bridge proxies—back to the user’s identity.
Continuous sync – Whenever a new address interacts with a user-tagged wallet within the same private-key space (e.g., a freshly spawned contract wallet on Safe{Wallet}), the resolver auto-attaches it to the account after passing probabilistic ownership tests.
3. High-Fidelity Data Extraction
Execution Trace
Every call, delegatecall, and internal transfer triggered by the tx.
Parity Trace, OpenEthereum debug API, Tenderly
Event Logs
ERC-20/721/1155 transfers, pool syncs, DAO emissions, bridge mints/burns.
ABI-aware log decoders
State Diffs
Account balance deltas, storage slot mutations.
Native node state diff endpoints
Off-Chain Meta
Trade counterparty, L2 batch info, validator set.
REST & gRPC side-feeds
This depth lets TaxChain distinguish, for example, an LP-token deposit (not taxable in FR) from an LP-token withdrawal(potentially taxable as disposal), or a Gnosis Safe module call from a plain ERC-20 transfer.
4. Market-Rate Enrichment
Accurate tax calculation requires the fair-market value of each asset at the moment of the taxable event.
Price Oracles – Chainlink, Pyth, and RedStone feeds deliver block-timestamped USD prices.
Fall-backs – For thin-liquidity tokens, TWAPs from DEX sub-graphs fill gaps; fiat cross-rates (USD→EUR, CHF) come from ECB and SNB APIs.
Immutable snapshot – All fetched quotes are hashed with their source ID and committed on-chain via a merkle root so auditors can cryptographically verify historical pricing.
5. Tax Graph Construction
Each parsed transaction is broken into Atomic Tax Units (ATUs)—the smallest pieces that can independently be taxed (e.g., “0.75 ETH disposed”, “200 USDC acquired”). ATUs are stored in a content-addressed DAG:
WalletRoot
├── 2025/
│ ├── 05/
│ │ ├── tx₁ (hash, blockHeight, merkleRoot)
│ │ │ ├── ATU₁ (outflow ETH 0.75)
│ │ │ ├── ATU₂ (inflow USDC 200)
│ │ │ └── linkage (parent tx for LP add)
│ │ └── ...
│ └── ...
└── Metadata (PGP owner key, consent flags, pNFT IDs)
Features of the Tax Graph:
Append-only & tamper-evident – The DAG’s merkle root is periodically anchored to a TaxChain beacon contract on Ethereum mainnet.
Time-travel queries – Every node stores the applicable jurisdictional rulepack version, enabling “as-law-stood-then” calculations.
Selective disclosure – Users can export sub-trees (e.g., only 2024 data) for limited-scope audits.
6. Performance & Fault Tolerance
Indexing latency
< 5 s post-finality
Kafka + Rust actors, zero-copy buffers
Coverage SLA
99.999 %
Active-passive listener clusters across three regions
Replay speed
1 year of history in < 4 hr
Columnar Parquet storage + SIMD decoding
If an upstream RPC endpoint fails, Automatic Endpoint Rotation (AER) swaps to a standby; missing TxEvents are back-filled from archive nodes to ensure continuity.
7. Security & Privacy Guardrails
AES-256 envelope encryption – Raw event payloads stored in IPFS are encrypted; keys are sharded with Shamir Secret Sharing between the user and an optional recovery guardian.
Bounded observability – Public nodes see only anonymized, Bloom-filtered metrics; personal data never appears on public ledgers.
Differential-privacy telemetry – Usage statistics reported to the DAO are noise-added so individual behavior cannot be inferred.
8. Extensibility Hooks
Developers can subscribe to TxEvent gRPC streams or GraphQL change feeds to build:
Real-time P&L dashboards.
DeFi protocol plug-ins that pipe custom metadata (e.g., Perpetual funding rates) back into the classification engine.
Institutional compliance bots that trigger when a trader’s daily realized gain > 10 k USD.
9. Future-Facing Enhancements
ZK-Provenance – Planned zk-SNARK wrappers will allow users to prove “tax paid” without revealing the underlying transaction graph.
Intent-based tracking – Integration with ERC-7521 intent standard will sync off-chain pre-signatures for even earlier P&L previews.
Quantum-safe hashing – A roadmap item to migrate Tax Graph anchors from Keccak-256 to a SPHINCS-plus variant once standardized.
In essence, the Transaction Tracking subsystem converts the raw, chaotic firehose of global blockchain activity into a cryptographically sound, fully contextualized, and instantly queryable audit layer. This high-resolution ledger is what empowers TaxChain’s downstream engines—classification, rule-mapping, and reporting—to deliver jurisdiction-perfect tax outputs at scale.
Last updated