Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

zair config

Build the airdrop snapshot configuration from on-chain data.

zair config build

Connects to a lightwalletd node, fetches Sapling and/or Orchard nullifiers up to the snapshot height, builds gap trees for non-membership proofs, and writes the configuration and artifacts to files.

zair config build --network testnet --height 3663119

Parameters

FlagDefaultDescription
--networkmainnetNetwork: mainnet or testnet
--height(required)Height of snapshot
--lightwalletd(hardcoded)Endpoint for lightwalletd
--poolbothPool: sapling, orchard, or both

Airdrop parameters

FlagDefaultDescription
--target-saplingZAIRTESTSapling target ID for hiding nullifier derivation (exactly 8 bytes)
--target-orchardZAIRTEST:OOrchard target ID for hiding nullifier derivation (up to 32 bytes)
--scheme-saplingnativeSapling value commitment scheme: native, sha256, or plain
--scheme-orchardnativeOrchard value commitment scheme: native, sha256, or plain

Info

When choosing a custom --target-sapling for deployment, you must update the constant

HIDING_NF_PERSONALIZATION = "ZAIRTEST"

in

crates/zair-sapling-circuit/src/circuit.rs

as well, and run a trusted setup for Sapling using the new custom circuit.

If sapling.target_id in the config and this constant disagree, proof generation fails with "constraint not satisfied".

Warning

The defaults ZAIRTEST and ZAIRTEST:O are for development and testing. Production airdrops should pick a target ID unique to the airdrop. If two airdrops share the same target ID, their airdrop nullifiers match for the same Zcash note, which makes submissions linkable across the two airdrops. Double-claiming is still prevented: each airdrop has its own nullifier set and claims are bound to the target-chain message.

Output files

FlagDefaultDescription
--config-outconfig.jsonConfiguration output
--snapshot-out-saplingsnapshot-sapling.binSapling snapshot nullifiers
--snapshot-out-orchardsnapshot-orchard.binOrchard snapshot nullifiers
--gap-tree-out-saplinggaptree-sapling.binSapling gap tree
--gap-tree-out-orchardgaptree-orchard.binOrchard gap tree
--no-gap-treefalseDo not output gap-tree artifacts