Overview
Events are critical for tracking state changes, building merkle trees, and decrypting user notes. This page documents all events emitted by the Tornado Nova contracts.TornadoPool Events
NewCommitment
The commitment hash added to the merkle tree. Calculated as
poseidonHash(amount, pubkey, blinding)Position of the commitment in the merkle tree. Used to calculate merkle path for spending the UTXO.
Encrypted UTXO data (amount and blinding factor) that can be decrypted by the recipient using their private key. Format: 24 bytes nonce + 32 bytes ephemeral public key + ciphertext.
- Frontend monitors this event to detect incoming transfers
- Used to build and maintain the local merkle tree
- Recipients decrypt encryptedOutput to discover their UTXOs
contracts/TornadoPool.sol:67
Emitted by: _transact() at line 290-291
NewNullifier
The nullifier hash that marks a UTXO as spent. Calculated as
poseidonHash(commitment, index, signature) where signature = poseidonHash(privkey, commitment, index)- Tracks which UTXOs have been spent
- Prevents double-spending attempts
- Frontend uses this to mark local UTXOs as spent
contracts/TornadoPool.sol:68
Emitted by: _transact() at line 293 (emitted for each input nullifier)
PublicKey
Ethereum address of the account owner. Indexed for efficient filtering.
Public key bytes (64 bytes total):
- First 32 bytes: poseidon pubkey for signature verification
- Last 32 bytes: x25519 encryption key for encrypting UTXOs
- Frontend caches public keys to enable shielded transfers to other users
- Required before receiving shielded transfers
- Can be registered on either L1 (via L1Unwrapper) or L2 (via TornadoPool)
contracts/TornadoPool.sol:69
Emitted by:
_register()at line 256 (TornadoPool)_register()at line 72 (L1Unwrapper)
L1Unwrapper Events
PublicKey
Ethereum address of the account owner
Public key bytes (64 bytes: 32 bytes pubkey + 32 bytes encryption key)
contracts/bridge/L1Unwrapper.sol:30
Emitted by:
register()when explicitly registeringwrapAndRelayTokens()when depositing and registering simultaneously
Event Listening Examples
Event Filtering Tips
Event Order Guarantees
Within a single transaction:- NewCommitment events are emitted in order (output 0, then output 1)
- NewNullifier events are emitted after commitments, in order of inputs
- PublicKey event (if any) is emitted before transaction processing