The nullifier design we use for Orchard is
- is a keyed circuit-efficient PRF (such as Rescue or Poseidon).
- is unique to this output. As with in Sprout, includes the nullifiers of any Orchard notes being spent in the same action. Given that an action consists of a single spend and a single output, we set to be the nullifier of the spent note.
- is sender-controlled randomness. It is not required to be unique, and in practice is derived from both and a sender-selected random value :
- is a fixed independent base.
- extracts the -coordinate of a Pallas curve point.
This gives a note structure of
The note plaintext includes in place of and , and omits (which is a public part of the action).
We care about several security properties for our nullifiers:
Balance: can I forge money?
Note Privacy: can I gain information about notes only from the public block chain?
- This describes notes sent in-band.
Note Privacy (OOB): can I gain information about notes sent out-of-band, only from the public block chain?
- In this case, we assume privacy of the channel over which the note is sent, and that the adversary does not have access to any notes sent to the same address which are then spent (so that the nullifier is on the block chain somewhere).
Spend Unlinkability: given the incoming viewing key for an address, and not the full viewing key, can I (possibly the sender) detect spends of any notes sent to that address?
- We're giving to the attacker and allowing it to be the sender in order to make this property as strong as possible: they will have all the notes sent to that address.
Faerie Resistance: can I perform a Faerie Gold attack (i.e. cause notes to be accepted that are unspendable)?
- We're giving the full viewing key to the attacker and allowing it to be the sender in order to make this property as strong as possible: they will have all the notes sent to that address, and be able to derive every nullifier.
We assume (and instantiate elsewhere) the following primitives:
- is a cryptographic hash into the group (such as BLAKE2s with simplified SWU), used to derive all fixed independent bases.
- is an elliptic curve (such as Pallas).
- is the note encryption key derivation function.
For our chosen design, our desired security properties rely on the following assumptions:
is computational Diffie-Hellman using for the key derivation, with one-time ephemeral keys. This assumption is heuristically weaker than but stronger than .
We omit as a security assumption because we only rely on the random oracle applied to fixed inputs defined by the protocol, i.e. to generate the fixed base , not to attacker-specified inputs.
We additionally assume that for any input , gives a scalar in an adequate range for . (Otherwise, could be trivial, e.g. independent of .)
Statistical distance from perfect.
: be skeptical of the claims in this table about what problem(s) each security property depends on. They may not be accurate and are definitely not fully rigorous.
The entries in this table omit the application of , which is an optimization to halve the nullifier length. That optimization requires its own security analysis, but because it is a deterministic mapping, only Faerie Resistance could be affected by it.
In the above alternatives:
is a keyed circuit-efficient hash (such as Rescue).
is an fixed independent base, independent of and any others returned by .
is a pair of fixed independent bases (independent of all others), where the specific choice of base depends on whether the note has zero value.
is a base unique to this output.
- For non-zero-valued notes, . As with in Sprout, includes the nullifiers of any Orchard notes being spent in the same action.
- For zero-valued notes, is constrained by the circuit to a fixed base independent of and any others returned by .
In order to satisfy the Balance security property, we require that the circuit must be able to enforce that only one nullifier is accepted for a given note. As in Sprout and Sapling, we achieve this by ensuring that the nullifier deterministically depends only on values committed to (directly or indirectly) by the note commitment. As in Sapling, this involves arguing that:
- There can be only one for a given . This is true because the circuit checks that , and the mapping is an injection for any . ( is in the base field of , which must be smaller than its scalar field, as is the case for Pallas.)
- There can be only one for a given . This is true because the circuit checks that where is binding (see Commitments).
Faerie Resistance requires that nullifiers be unique. This is primarily achieved by taking a unique value (checked for uniqueness by the public consensus rules) as an input to the nullifier. However, it is also necessary to ensure that the transformations applied to this value preserve its uniqueness. Meanwhile, to achieve Spend Unlinkability, we require that the nullifier does not reveal any information about the unique value it is derived from.
The design alternatives fall into two categories in terms of how they balance these requirements:
Publish a unique value at note creation time, and blind that value within the nullifier computation.
- This is similar to the approach taken in Sprout and Sapling, which both implemented nullifiers as PRF outputs; Sprout uses the compression function from SHA-256, while Sapling uses BLAKE2s.
Derive a unique base from some unique value, publish that unique base at note creation time, and then blind the base (either additively or multiplicatively) during nullifier computation.
For Spend Unlinkability, the only value unknown to the adversary is , and the cryptographic assumptions only involve the first term (other terms like or cannot be extracted directly from the observed nullifiers, but can be subtracted from them). We therefore ensure that the first term does not commit directly to the note (to avoid a DL-breaking adversary from immediately breaking SU).
We were considering using a design involving with the goal of eliminating all usages of a PRF inside the circuit, for two reasons:
- Instantiating with a traditional hash function is expensive in the circuit.
- We didn't want to solely rely on an algebraic hash function satisfying to achieve Spend Unlinkability.
However, those designs rely on both and for Faerie Resistance, while still requiring for Spend Unlinkability. (There are two designs for which this is not the case, but they rely on for Note Privacy (OOB) which was not acceptable).
By contrast, several designs involving (including the chosen design) have weaker assumptions for Faerie Resistance (only relying on ), and Spend Unlinkability does not require to hold: they can fall back on the same assumption as the designs (along with an additional assumption about the output of which is easily satisfied).
Most of the designs include either a multiplicative blinding term , or an additive blinding term , in order to achieve perfect Note Privacy (OOB) (to an adversary who does not know the note). The chosen design is effectively using for this purpose; a DL-breaking adversary only learns . This reduces Note Privacy (OOB) from perfect to statistical, but given that is from a distribution statistically close to uniform on , this is statistically close to better than . The benefit is that it does not require an additional scalar multiplication, making it more efficient inside the circuit.
's derivation has two motivations:
- Deriving from a random value enables multiple derived values to be conveyed to the recipient within an action (such as the ephemeral secret , per ZIP 212), while keeping the note plaintext short.
- Mixing into the derivation ensures that the sender can't repeat across two notes, which could have enabled spend linkability attacks in some designs.
The note that is committed to, and which the circuit takes as input, only includes (i.e. the circuit does not check the derivation from ). However, an adversarial sender is still constrained by this derivation, because the recipient recomputes during note decryption. If an action were created using an arbitrary (for which the adversary did not have a corresponding ), the recipient would derive a note commitment that did not match the action's commitment field, and reject it (as in Sapling).
The nullifier commits to the note value via for two reasons:
- It domain-separates nullifiers for zero-valued notes from other notes. This is necessary because we do not require zero-valued notes to exist in the commitment tree.
- Designs that bind the nullifier to require to achieve Faerie Resistance (and similarly where is applied to a value derived from ). Adding to the nullifier avoids this assumption: all of the bases used to derive are fixed and independent of , and so the nullifier can be viewed as a Pedersen hash where the input includes directly.
The variants were considered to avoid directly depending on (which in its native type is a base field element, not a group element). We decided instead to follow Sapling by defining an intermediate representation of as a group element, that is only used in nullifier computation. The circuit already needs to compute , so this improves performance by removing
We also considered variants that used a choice of fixed bases to provide domain separation for zero-valued notes. The most performant design (similar to the chosen design) does not achieve Faerie Resistance for an adversary that knows the recipient's full viewing key ( could be brute-forced to cancel out , causing a collision), and the other variants require assuming as mentioned above.