Expand description
Builders for shielded bundles on the zcash_primitives transaction types.
Zebraโs Transaction wraps
zcash_primitives::transaction::Transaction, whose bundles are owned by the upstream crates
and cannot be mutated in place. Tests therefore cannot reach in and edit shielded data the way
they could when Transaction was an enum of Zebra-owned structs.
This module builds Orchard-shaped bundles (used by both the Orchard and Ironwood pools) directly from their constituent parts, so property tests and vector tests can exercise shielded code paths.
The bundles are structurally valid โ they carry real, canonically-encoded Pallas points and a proof of the canonical length, so they serialize, deserialize, and commit correctly โ but they are not consensus-valid: the proofs are zeroed and the signatures are arbitrary. They are for exercising parsing, indexing, and nullifier bookkeeping, not proof verification.
Constantsยง
- ACTION_
WIRE_ SIZE - The size of one serialized Orchard action: cv, nullifier, rk, cmx and ephemeralKey (32 bytes each), then encCiphertext and outCiphertext.
- NOTE_
VECTOR_ ๐SEED - The seed used for fields the note-encryption vectors do not constrain.
- V5_
FIRST_ ACTION_ RK_ OFFSET - The offset of the first Orchard actionโs
rkfield, within a v5 transaction that has no transparent and no Sapling bundle.
Functionsยง
- base_
from_ ๐seed - Derives a canonically-encoded
pallas::Basefrom aseed. - fake_
action ๐ - Builds a structurally valid Orchard [
Action] from aseed. - fake_
bundle_ for_ branch - Builds a bundle for
poolthat is valid underbranch_id, orNoneif the pool is not defined for that consensus branch (Ironwood before NU6.3). - fake_
orchard_ bundle - Builds a structurally valid Orchard-shaped bundle.
- fake_
orchard_ bundle_ duplicate_ nullifiers - Builds an Orchard-shaped bundle whose actions all share a single nullifier.
- fake_
orchard_ bundle_ with_ note - Builds a single-action Orchard-shaped bundle carrying caller-supplied note-encryption fields.
- fake_
v6_ transaction - Builds a V6 transaction carrying the given Orchard and Ironwood bundles.
- insert_
fake_ orchard_ shielded_ data - Returns a copy of
txcarrying a dummy single-action Orchard bundle. - outputs_
enabled_ flags - Returns the flag set with outputs enabled that is representable under
bundle_version. - scalar_
from_ ๐seed - Derives a canonically-encoded
pallas::Scalarfrom aseed. - v6_
ironwood_ flags_ offset - The offset of the
flagsOrchardbyte of the Ironwood bundle, within a v6 transaction that has no transparent and no Sapling bundle, an empty Orchard bundle, and an Ironwood bundle withn_ironwood_actionsactions. - v6_
orchard_ flags_ offset - The offset of the
flagsOrchardbyte of the Orchard bundle, within a v6 transaction that has no transparent and no Sapling bundle, and whose Orchard bundle hasn_actionsactions. - verification_
key_ ๐from_ seed - Builds a non-identity RedPallas verification key from a
seed. - with_
garbage_ orchard_ authorization - Returns a copy of
txwhose Orchard bundle keeps its effects but has garbage authorizing data: a corrupt proof, binding signature, and spend authorization signatures. - with_
orchard_ flags - Returns a copy of
txwhose Orchard bundle carriesflags. - with_
orchard_ value_ balance - Returns a copy of
txwhose Orchard bundle carriesvalue_balance.