Analysis of the JoinSplit circuit
JoinSplit circuit inputs
operationDigestpubEncodedAssetIdpubEncodedAssetAddrWithSignBitsrefundAddrH1CompressedYrefundAddrH2CompressedYvk(viewing key)spendPubkeyvkNoncec,z(operation signature)encodedAssetIdencodedAssetAddrrefundAddrH1XrefundAddrH1YrefundAddrH2XrefundAddrH2YoldNoteAOwnerH1XoldNoteAOwnerH1YoldNoteAOwnerH2XoldNoteAOwnerH2YoldNoteANonceoldNoteAValuepathAsiblingsAoldNoteBOwnerH1XoldNoteBOwnerH1YoldNoteBOwnerH2XoldNoteBOwnerH2YoldNoteBNonceoldNoteBValuepathBsiblingsBnewNoteAValuereceiverCanonAddrnewNoteBValue
Circuit outputs
newNoteACommitmentnewNoteBCommitmentcommitmentTreeRootpublicSpendnullifierAnullifierBsenderCommitmentjoinSplitInfoCommitment
Constraints
The
spendPubkeyis a valid Baby Jubjub curve point of order l.The
vkis derived correctly fromspendPubkeyandvkNonce.oldNoteA.owner.H1andoldNoteA.owner.H2are valid BabyJubJub curve points, and H1 is an order-l point.The
oldNoteB.owner.H1andoldNoteB.owner.H2are valid BabyJubJub curve points, and H1 is an order-l point.Constrain that H2 = [vk]H1 for
oldNoteAandoldNoteB.Range check note values to account for arithmetic overflows.
Compute and constrain public spend.
Constrain note commitments for both old notes.
Check Merkle inclusion proof for
oldNoteA.Check Merkle inclusion proof for
oldNoteBif and only if it holds nonzero value.Constrain nullifier derivation for
nullifierAandnullifierB.Constrain new note commitments.