bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 35쪽 중 10쪽
net1..𝑛 are in{−264 + 1..2 64−1} .
vOrchardPoolBalance is encoded in thetransactionas a signed two’s complement64-bit integer in the range{−263 ..2 63−1} .
Therefore, v* is in the range{−𝑛·(2 64−1)−2 63 + 1.. 𝑛·(264−1) + 2 63}. 𝑛 is limited by consensus rule to at most
216−1(this rule is technically redundant due to the2MBtransactionsize limit, but it suffices here).
This ensures thatv*∈{−1208916596242592319864832..1208916596242592319864833} , a subrange of{︀− 𝑟P−12 .. 𝑟P−12 }︀.
Thus checking theOrchard binding signatureensures that theAction transfersin thetransactionbalance, without
their individual net values being revealed.
In addition this proves that the signer, knowing the -sum of the Orchardvalue commitmentrandomnesses,
authorized atransactionwith the givenSIGHASH transaction hashby signingSigHash.
Note:The spenderMAYreveal any strict subset of the Orchard-pool value commitmentrandomnesses to other
parties that are cooperating to create thetransaction.
4.15 Spend Authorization Signature (SaplingandOrchard) #spendauthsig
SpendAuthSig is used in Saplingand Orchardto prove knowledge of thespending keyauthorizing spending of an
inputnote. It is instantiated in §5.4.7.1 ‘Spend Authorization Signature (Sapling and Orchard)’ on p.98.
We use SpendAuthSigSapling to refer to thespend authorization signature schemefor Sapling, which is instantiated
on theJubjub curve. We use SpendAuthSigOrchard to refer to thespend authorization signature schemefor Orchard,
which is instantiated on thePallas curve. The following discussion applies to both.
Knowledge of thespending keycould have been proven directly in theSpend statementorAction statement,
similar to the check in §4.18.1 ‘JoinSplit Statement (Sprout)’ on p. 63 that is part of theJoinSplit statement. The
motivation for a separate signature is to allow devices that are limited in memory and computational capacity, such
as hardware wallets, to authorize a Saplingor OrchardSpend. Typically such devices cannot create, and may not be
able to verify,zk-SNARK proofsfor astatementof the size needed using theGroth16orHalo 2proving systems.
Thevalidating keyof the signature must be revealed in theSpend descriptionso that the signature can be checked
by validators. To ensure that thevalidating keycannot be linked to theshielded payment addressorspending key
from which thenotewas spent, we use asignature scheme with re-randomizable keys. TheSpend statementor
Action statementproves that thisvalidating keyis are-randomizationof thespend authorization address key ak
with arandomizerknown to the signer. Thespend authorization signatureis over theSIGHASH transaction hash,
so that it cannot be replayed in othertransactions.
59
Let SigHash be theSIGHASH transaction hashas defined in [ZIP-243] or as defined in[ZIP-244] modified by[ZIP-225],
not associated with an input, using theSIGHASH typeSIGHASH_ALL.
Let ask be thespend authorization private keyas defined in §4.2.2 ‘Sapling Key Components’ on p. 38 or in §4.2.3
‘Orchard Key Components’ on p.40.
LetSpendAuthSigbeSpendAuthSig Sapling orSpendAuthSig Orchard as applicable.
For eachSpend descriptionorAction description, the signer chooses a freshspend authorization randomizer𝛼:
1. Choose𝛼← R SpendAuthSig.GenRandom().
2. Letrsk=SpendAuthSig.RandomizePrivate(𝛼,ask).
3. Letrk=SpendAuthSig.DerivePublic(rsk).
4. Generate a proof 𝜋 of theSpend statement( §4.18.2 ‘Spend Statement (Sapling)’ on p. 64) orAction statement
( §4.18.4 ‘Action Statement (Orchard)’ on p.66), with𝛼in theauxiliary inputandrkin theprimary input.
5. LetspendAuthSig=SpendAuthSig.Sign rsk(SigHash).
The resulting spendAuthSig and 𝜋 are included in theSpend description, or in the vSpendAuthSigsSapling or
vSpendAuthSigsOrchard field of a version 5transaction.
Note:If the spender is computationally or memory-limited, step 4 (and only step 4)MAYbe delegated to a
different party that is capable of performing thezk-SNARK proof. In this case privacy will be lost to that party
since it needs ak and theproof authorizing key nsk; this allows also deriving the nk component of thefull viewing
key. (In Orchard, that party needs the nk directly to make thezk-SNARK proof.) Together ak and nk are sufficient
to recognize spentnotesand to recognize and decrypt incomingnotes. However, the other party will not obtain
spending authorityfor othertransactions, since it is not able to create aspend authorization signatureby itself.
4.16 Computingρvalues and Nullifiers #rhoandnullifiers
In Sproutand Orchard, eachnotehas aρcomponent, defined as part of thenote.
In Sapling, eachpositioned note(as defined in §3.2.2 ‘Note Commitments’ on p. 17) has an associated ρ value, which
is computed from itsnote commitmentcmandnote positionposas follows:
ρ:=MixingPedersenHash(cm,pos).
MixingPedersenHashis defined in §5.4.1.8 ‘Mixing Pedersen Hash Function’ on p.84.
LetPRF nfSprout andPRF nfSapling andPRF nfOrchard be as instantiated in §5.4.2 ‘Pseudo Random Functions’ on p.89.
For a Sprout-pool note, thenullifier(see §3.2.3 ‘Nullifiers’ on p. 18) is derived as PRFnfSproutask (ρ), where ask is the
spending keyassociated with thenote.
For a Sapling-pool note, thenullifieris derived as PRFnfSaplingnk⋆ (ρ⋆), where nk⋆ is a representation of thenullifier
deriving keyassociated with thenoteandρ⋆=repr J(ρ).
The derivation ofnullifiersforOrchard-poolnotesis a little more complicated.
LetPand𝑞 P be as defined in §5.4.9.6 ‘Pallas and Vesta’ on p.108.
LetExtract P be as defined in §5.4.9.7 ‘Coordinate Extractor for Pallas’ on p.109.
LetGroupHash P be as defined in §5.4.9.8 ‘Group Hash into Pallas and Vesta’ on p.110.
Define𝒦 Orchard :=GroupHash P(“z.cash:Orchard”,“ K”).
60
To avoid repetition, we define a functionDeriveNullifier F𝑞P×F 𝑞P×F 𝑞P×P→F 𝑞P as follows:
DeriveNullifiernk(ρ,ψ,cm) =Extract P
(︀[︀
(PRFnfOrchardnk (ρ) +ψ) mod𝑞 P]︀𝒦Orchard +cm )︀.
where nk is thenullifier deriving keyassociated with thenote; ρ and ψ are part of thenote; and cm is thenote
commitment.
Notes:
• The addition of PRFnfOrchardnk (ρ) and ψ is intentionally done modulo 𝑞P, even though the scalar multiplication is
on thePallas curvewhich has scalar fieldF 𝑟P.
•For correctness, theρandψinputs must always be consistent with thenotecommitted to bycm.
Security requirement:For eachshielded protocol, the requirements onnullifierderivation are as follows:
• The derivednullifiermust be determined completely by the fields of thenote, and possibly its position, in a
way that can be checked in the corresponding statement that controls spends (i.e. theJoinSplit statement,
Spend statement, orAction statement).
• Under the assumption thatρ values are unique, it must not be possible to generate twonoteswith distinctnote
commitmentsbut the samenullifier. (See §8.4 ‘Faerie Gold attack and fix’ on p. 149 for further discussion.)
• Given a set ofnullifiersof a priori unknownnotes, they must not be linkable to thosenoteswith probability
greater than expected by chance, even to an adversary with the correspondingincoming viewing keys(but
notfull viewing keys), and even if the adversary may have created thenotes.
4.17 Chain Value Pool Balances #chainvaluepoolbalances
The transparent chain value pool balance for a givenblock chainis the sum of the values of allUTXOsin theUTXO
(unspent transaction output) setfor that chain. It is denoted byChainValuePoolBalance TransparentPool(height).
Consensus rule:If the transparent chain value pool balance would become negative in theblock chaincreated as a
result of accepting ablock, then all nodesMUSTreject the block as invalid.
As defined in [ZIP-209], the Sprout chain value pool balance for a givenblock chainis the sum of all voldpub field values
fortransactionsin theblock chain, minus the sum of all vnewpub field values for transactions in theblock chain. It is
denoted byChainValuePoolBalance SproutPool(height).
Consensus rule:If the Sprout chain value pool balance would become negative in theblock chaincreated as a result
of accepting ablock, then all nodesMUSTreject the block as invalid.
As defined in [ZIP-209], the Sapling chain value pool balance for a givenblock chainis the negation of the sum of all
valueBalanceSapling values fortransactionsin thechain. It is denoted byChainValuePoolBalance SaplingPool(height).
Consensus rule:If the Sapling chain value pool balance would become negative in theblock chaincreated as a
result of accepting ablock, then all nodesMUSTreject the block as invalid.
Similarly to the Sapling chain value pool balance defined in [ZIP-209], the Orchard chain value pool balance for a given
block chainis the negation of the sum of all valueBalanceOrchard field values fortransactionsin thechain. It is
denoted byChainValuePoolBalance OrchardPool(height).
Consensus rule:If the Orchard chain value pool balance would become negative in theblock chaincreated as a
result of accepting ablock, then all nodesMUSTreject the block as invalid.
DefinetotalDeferredOutputandtotalDeferredInputas in §7.8 on p.142.
61
Then, consistent with [ZIP-207], the deferred development fund chain value pool balance for ablock chainup to and
including heightheightis given by:
ChainValuePoolBalanceDeferredPool(height) :=
height∑︁
h=0
totalDeferredOutput(h)−totalDeferredInput(h)
Consensus rule:If the deferred development fund chain value pool balance would become negative in theblock
chaincreated as a result of accepting ablock, then all nodesMUSTreject the block as invalid.
Non-normative notes:
•totalDeferredOutput(h)is necessarily zero for heightshprior to NU6activation.
•totalDeferredInput(h)is necessarily zero for heightshprior to NU6.1activation.
Thetotal issued supplyof ablock chainatblock heightheightis given by the function:
IssuedSupply(height) :=ChainValuePoolBalance TransparentPool(height)
+ChainValuePoolBalance SproutPool(height)
+ChainValuePoolBalance SaplingPool(height)
+ChainValuePoolBalance OrchardPool(height)
+ChainValuePoolBalance DeferredPool(height)
Consensus rule:If thetotal issued supply(computed without possibility of overflow) would become greater than
MAX_MONEY zatoshiin theblock chaincreated as a result of accepting ablock, then all nodesMUSTreject the
block as invalid.
62
4.18 Zk-SNARK Statements #snarkstatements
4.18.1 JoinSplit Statement (Sprout) #joinsplitstatement
Letℓ SproutMerkle,ℓ SproutPRF ,MerkleDepth Sprout,ℓ value,ℓ ask,ℓ Sproutφ ,ℓ hSig,N old,N new be as defined in §5.3 ‘Constants’ on p.77.
LetPRF addr,PRF nfSprout,PRF pk, andPRF ρ be as defined in §4.1.2 ‘Pseudo Random Functions’ on p.26.
Let NoteCommitSprout be as defined in §4.1.8 ‘Commitment’ on p. 32, and let NoteSprout and NoteCommitmentSprout be
as defined in §3.2 ‘Shielded Pools and Notes’ on p.15.
A valid instance of aJoinSplit statement,𝜋 ZKJoinSplit, assures that given aprimary input:(︀
rtSprout B[ℓSproutMerkle],
nfold1..Nold B[ℓSproutPRF ][Nold],
cmnew1..Nnew NoteCommitSprout.Output[Nnew],
voldpub {0..2 ℓvalue−1},
vnewpub {0..2 ℓvalue−1},
hSig B[ℓhSig],
h1..Nold B[ℓSproutPRF ][Nold])︀,
the prover knows anauxiliary input:
(︀
path1..Nold B[ℓSproutMerkle][MerkleDepthSprout][Nold],
pos1..Nold {0..2 MerkleDepthSprout−1}[Nold],
nold1..Nold NoteSprout[Nold],
aoldsk,1..Nold B[ℓask][Nold],
nnew1..Nnew NoteSprout[Nnew],
φ B[ℓSproutφ ],
enforceMerklePath1..Nold B[Nold])︀,
where:
for each𝑖∈{1..N old}:n old𝑖 = (aoldpk,𝑖,v old𝑖 ,ρ old𝑖 ,rcm old𝑖 );
for each𝑖∈{1..N new}:n new𝑖 = (anewpk,𝑖,v new𝑖 ,ρ new𝑖 ,rcm new𝑖 )
such that the following conditions hold:
Merkle path validityfor each 𝑖∈{1..N old}|enforceMerklePath 𝑖 = 1: (path𝑖,pos 𝑖) is a validMerkle path(see §4.9
‘Merkle Path Validity’ on p.52) of depthMerkleDepth Sprout fromNoteCommitment Sprout(nold𝑖 )to theanchorrt Sprout.
Note:Merkle path validity covers conditions 1. (a) and 1. (d) of the NPstatementin [BCGGMTV2014, section 4.2].
Merkle path enforcementfor each𝑖∈{1..N old}, ifv old𝑖 ̸= 0thenenforceMerklePath 𝑖 = 1.
Balancev oldpub + ∑︀Nold𝑖=1vold𝑖 =v newpub + ∑︀Nnew𝑖=1 vnew𝑖 ∈{0..2 ℓvalue−1}.
Nullifier integrityfor each𝑖∈{1..N old}:nf old𝑖 =PRF nfSproutaoldsk,𝑖 (ρold𝑖 ).
Spend authorityfor each𝑖∈{1..N old}:a oldpk,𝑖 =PRF addraoldsk,𝑖(0).
Non-malleabilityfor each𝑖∈{1..N old}:h 𝑖 =PRF pkaoldsk,𝑖(𝑖,h Sig).
Uniqueness ofρ new𝑖 for each𝑖∈{1..N new}:ρ new𝑖 =PRF ρφ(𝑖,h Sig).
Note commitment integrityfor each𝑖∈{1..N new}:cm new𝑖 =NoteCommitment Sprout(nnew𝑖 ).
For details of the form and encoding of proofs, see §5.4.10.1 ‘BCTV14’ on p.113.
63
4.18.2 Spend Statement (Sapling) #spendstatement
Letℓ SaplingMerkle ,ℓ PRFnfSapling,ℓ Saplingscalar , andMerkleDepth Sapling be as defined in §5.3 ‘Constants’ on p.77.
LetValueCommit Sapling andNoteCommit Sapling be as specified in §4.1.8 ‘Commitment’ on p.32.
LetSpendAuthSig Sapling be as defined in §5.4.7.1 ‘Spend Authorization Signature (Sapling and Orchard)’ on p.98.
LetJ,J (𝑟),repr J,𝑞 J,𝑟 J, andℎ J be as defined in §5.4.9.3 ‘Jubjub’ on p.105.
LetExtract J(𝑟) J(𝑟)→B [ℓSaplingMerkle ] be as defined in §5.4.9.4 ‘Coordinate Extractor for Jubjub’ on p.107.
Letℋ Sapling be as defined in §4.2.2 ‘Sapling Key Components’ on p.38.
A valid instance of aSpend statement,𝜋 ZKSpend, assures that given aprimary input:
(︀
rtSaplingPool B[ℓSaplingMerkle ],
cvold ValueCommitSapling.Output,
nfold BY Y[ℓPRFnfSapling/8],
rk SpendAuthSigSapling.Public)︀,
the prover knows anauxiliary input:
(︀
path B[ℓSaplingMerkle ][MerkleDepthSapling],
pos {0..2 MerkleDepthSapling−1},
gd J,
pkd J,
vold {0..2 ℓvalue−1},
rcvold {0..2 ℓSaplingscalar−1},
cmold J,
rcmold {0..2 ℓSaplingscalar−1},
𝛼 {0..2 ℓSaplingscalar−1},
ak SpendAuthSigSapling.Public,
nsk {0..2 ℓSaplingscalar−1})︀
such that the following conditions hold:
Note commitment integritycm old =NoteCommit Saplingrcmold (reprJ(gd),repr J(pkd),v old).
Merkle path validityEither vold = 0; or (path,pos) is a validMerkle pathof depth MerkleDepthSapling, as defined in
§4.9 ‘Merkle Path Validity’ on p.52, fromcm 𝑢 =Extract J(𝑟)(cmold)to theanchorrt SaplingPool.
Value commitment integritycv old =ValueCommit Saplingrcvold (vold).
Small order checksg d andakare not ofsmall order, i.e.[ℎ J]g d̸=𝒪 J and[ℎ J]ak̸=𝒪 J.
Nullifier integritynf old =PRF nfSaplingnk⋆ (ρ⋆)where
nk⋆=repr J
(︀
[nsk]ℋ Sapling)︀
ρ⋆=repr J
(︀
MixingPedersenHash(cmold,pos))︀.
Spend authorityrk=SpendAuthSig Sapling.RandomizePublic(𝛼,ak).
Diversified address integritypk d =[ivk]g d where
ivk=CRH ivk(ak⋆,nk⋆)
ak⋆=repr J(ak).
For details of the form and encoding ofSpend statementproofs, see §5.4.10.2 ‘Groth16’ on p.114.
64
Notes:
• Primaryandauxiliary inputsMUSTbe constrained to have the types specified. In particular, see §A.3.3.2
‘ctEdwards [de]compression and validation’ on p. 212, for required validity checks on compressed repre-
sentations ofJubjub curvepoints.
TheValueCommit Sapling.OutputandSpendAuthSig Sapling.Publictypes also represent points, i.e.J.
• In the Merkle path validity check, eachlayerdoes not check that its inputbit sequenceis a canonical encoding
(in{0.. 𝑞J−1}) of the integer from the previouslayer.
• It is not checked in theSpend statementthat rk is not ofsmall order. However, this is checked outside the
Spend statement, as specified in §4.4 ‘Spend Descriptions’ on p.42.
•It is not checked thatrcv old < 𝑟J or thatrcm old < 𝑟J.
•SpendAuthSig Sapling.RandomizePublic(𝛼,ak) =ak+[𝛼]𝒢 Sapling.
(𝒢Sapling is as defined in §5.4.7.1 ‘Spend Authorization Signature (Sapling and Orchard)’ on p.98.)
4.18.3 Output Statement (Sapling) #outputstatement
Letℓ SaplingMerkle andℓ Saplingscalar be as defined in §5.3 ‘Constants’ on p.77.
LetValueCommit Sapling andNoteCommit Sapling be as specified in §4.1.8 ‘Commitment’ on p.32.
LetJ,repr J, andℎ J be as defined in §5.4.9.3 ‘Jubjub’ on p.105.
LetExtract J(𝑟) J(𝑟)→B [ℓSaplingMerkle ] be as defined in §5.4.9.4 ‘Coordinate Extractor for Jubjub’ on p.107.
A valid instance of anOutput statement,𝜋 ZKOutput, assures that given aprimary input:
(︀
cvnew ValueCommitSapling.Output,
cm𝑢 B[ℓSaplingMerkle ],
epk J
)︀
,
the prover knows anauxiliary input:
(gd J,
pk⋆d B[ℓJ],
vnew {0..2 ℓvalue−1},
rcvnew {0..2 ℓSaplingscalar−1},
rcmnew {0..2 ℓSaplingscalar−1},
esk {0..2 ℓSaplingscalar−1})
such that the following conditions hold:
Note commitment integritycm 𝑢 =Extract J(𝑟)
(︀
NoteCommitSaplingrcmnew (g⋆d,pk⋆ d,v new))︀, whereg⋆ d =repr J(gd).
Value commitment integritycv new =ValueCommit Saplingrcvnew (vnew).
Small order checkg d is not ofsmall order, i.e.[ℎ J]g d̸=𝒪 J.
Ephemeral public key integrityepk=[esk]g d.
For details of the form and encoding ofOutput statementproofs, see §5.4.10.2 ‘Groth16’ on p.114.
65
Notes:
• Primaryandauxiliary inputsMUSTbe constrained to have the types specified. In particular, see §A.3.3.2
‘ctEdwards [de]compression and validation’ on p. 212, for required validity checks on compressed repre-
sentations ofJubjub curvepoints. TheValueCommit Sapling.Outputtype also represents points, i.e.J.
• The validity of pk⋆d is not checked in this circuit (which is the reason why it is typed as abit sequencerather
than as a point).
•It is not checked thatrcv old < 𝑟J or thatrcm old < 𝑟J.
4.18.4 Action Statement (Orchard) #actionstatement
Letℓ OrchardMerkle ,ℓ Orchardscalar , andMerkleDepth Orchard be as defined in §5.3 ‘Constants’ on p.77.
LetValueCommit Orchard,NoteCommit Orchard, andCommit ivk be as specified in §4.1.8 ‘Commitment’ on p.32.
LetSpendAuthSig Orchard be as defined in §5.4.7.1 ‘Spend Authorization Signature (Sapling and Orchard)’ on p.98.
LetP,P *,repr P,𝑞 P, and𝑟 P be as defined in §5.4.9.6 ‘Pallas and Vesta’ on p.108.
Let 𝑥, 𝑦,Extract P, andExtract⊥P be as defined in §5.4.9.7 ‘Coordinate Extractor for Pallas’ on p.109.
LetDeriveNullifierbe as defined in §4.16 ‘Computingρvalues and Nullifiers’ on p.60.
A valid instance of anAction statement,𝜋, assures that given aprimary input:(︀
rtOrchardPool {0.. 𝑞P−1},
cvnet ValueCommitOrchard.Output,
nfold {0.. 𝑞P−1},
rk SpendAuthSigOrchard.Public,
cm𝑥 {0.. 𝑞P−1},
enableSpends B,
enableOutputs B
)︀
,
the prover knows anauxiliary input:
(︀
path {0.. 𝑞P−1} [MerkleDepthOrchard],
pos {0..2 MerkleDepthOrchard−1},
goldd P*,
pkoldd P*,
vold {0..2 ℓvalue−1},
ρold F𝑞P ,
ψold F𝑞P ,
rcmold {0..2 ℓOrchardscalar −1},
cmold P,
𝛼 {0..2 ℓOrchardscalar −1},
akP P*,
nk F𝑞P ,
rivk Commitivk.Trapdoor,
gnewd P*,
pknewd P*,
vnew {0..2 ℓvalue−1},
ψnew F𝑞P ,
rcmnew {0..2 ℓOrchardscalar −1},
rcv {0..2 ℓOrchardscalar −1})︀
such that the following conditions hold:
66
Old note commitment integrityNoteCommit Orchardrcmold (reprP(goldd ),repr P(pkoldd ),v old,ρ old,ψ old)∈{cm old,⊥}.
Merkle path validityEither vold = 0; or (path,pos) is a validMerkle pathof depth MerkleDepthOrchard, as defined in
§4.9 ‘Merkle Path Validity’ on p.52, fromExtract P(cmold)to theanchorrt OrchardPool.
Value commitment integritycv net =ValueCommit Orchardrcv (vold−v new).
Nullifier integritynf old =DeriveNullifier nk(ρold,ψ old,cm old).
Spend authorityrk=SpendAuthSig Orchard.RandomizePublic(𝛼,ak P).
Diversified address integrityivk=⊥orpk oldd =[ivk]g oldd whereivk=Commit ivkrivk(︀ExtractP(akP),nk )︀.
New note commitment integrity Extract⊥P(︀NoteCommitOrchardrcmnew (reprP(gnewd ),repr P(pknewd ),v new,ρ new,ψ new))︀∈{cm 𝑥,⊥} ,
whereρ new =nf old (mod𝑞 P).
Enable spend flagv old = 0orenableSpends= 1.
Enable output flagv new = 0orenableOutputs= 1.
For details of the form and encoding ofAction statementproofs, see §5.4.10.3 ‘Halo 2’ on p.115.
Vulnerability disclosure:The pre- NU6.2 OrchardAction circuit had a soundness bug in its variable-base scalar
multiplication gadget [GHSA-circuit], which could have allowed balance violation. The bug is in the circuit imple-
mentation only; theAction statementspecified above is as intended. The corrected circuit deployed at NU6.2 has
a differentverifying key, so pre- NU6.2 OrchardAction proofs verify only under the insecure pre- NU6.2 key, and
NU6.2-onward proofs only under the corrected one. The two circuits differ only in the additional copy constraints
added to ensure soundness [halo2-commit]. The consensus rule specifying which key is used for verification is in
§4.6 ‘Action Descriptions’ on p.44.
Note프로젝트로 돌아가기