Orchard
Curves
Pallas / Vesta curve
Pallas is used as the "application curve", on which the Orchard protocol itself is implemented (c/f Jubjub).
Vesta is used as the "circuit curve"; its scalar field (being the base field of Pallas) is the "word" type over which the circuit is implemented (c/f BLS12-381).
Proving system
Saplingで使っているGroth16とR1CSの代わりに、PLONKish回路を使ったHalo2を利用している
このZIPではrecursive proofの利用は定義していないが、将来的なアップデートで利用する可能性あり
Circuit
spendとoutputの両方を単一の回路で対応している
「アクション」はnoteの消費と作成を含んでいる
Orchardのトランザクションはactionをバンドルしたものを含んでいて、Halo2の単一のproofはactionのバンドルに対応している
Commitments
Saplingと同じcommitment方式を採用しているが、OrchardではPLONKishにおいて効率的なSinsemillaを採用している
Commitment tree
Sinsemillaを利用している以外はSaplingと同一のcommitment treeを採用している
Keys and Addresses
Orchard proving API for hardware wallets
orchard deshielding tx:
3. 1 payment addresses and keys
sk: spending key, orchard::keys::SpendingKey
authorizing key(ask)とfull viewing key(nk, rivk)の生成に利用
constants
ℓPRFexpand, ℓsk, ℓovk, ℓd, ℓdk
Action transfers
入力と出力を表現する
Action description
トランザクション中に含まれる、action transfersを表現するデータ
note
In each case it represents that a value v is spendable by the recipient who holds the spending key corresponding to a given shielded payment address.
note commitment
Sinsemilla commitment
orchard incremental merkle tree
tx生成フロー
orchard::builder によるorchard bundleのbuild
inputとoutputの設定
add spend: Builder#add_spend()
add recipient : Builder#add_recipient()
Builder#build()
code:rust
/// The Orchard Action circuit.
pub struct Circuit {
pub(crate) pos: Value<u32>,
pub(crate) g_d_old: Value<NonIdentityPallasPoint>,
pub(crate) pk_d_old: Value<DiversifiedTransmissionKey>,
pub(crate) v_old: Value<NoteValue>,
pub(crate) rho_old: Value<Nullifier>,
pub(crate) psi_old: Value<pallas::Base>,
pub(crate) rcm_old: Value<NoteCommitTrapdoor>,
pub(crate) cm_old: Value<NoteCommitment>,
pub(crate) alpha: Value<pallas::Scalar>,
pub(crate) ak: Value<SpendValidatingKey>,
pub(crate) nk: Value<NullifierDerivingKey>,
pub(crate) rivk: Value<CommitIvkRandomness>,
pub(crate) g_d_new: Value<NonIdentityPallasPoint>,
pub(crate) pk_d_new: Value<DiversifiedTransmissionKey>,
pub(crate) v_new: Value<NoteValue>,
pub(crate) psi_new: Value<pallas::Base>,
pub(crate) rcm_new: Value<NoteCommitTrapdoor>,
pub(crate) rcv: Value<ValueCommitTrapdoor>,
}
authorization signature
Bundle#apply_signatures()
create proof
Proof::create
structのinstanceをhalo2用のinstanceへ変換
code:rust
/// Public inputs to the Orchard Action circuit.
pub struct Instance {
pub(crate) anchor: Anchor,
pub(crate) cv_net: ValueCommitment,
pub(crate) nf_old: Nullifier,
pub(crate) rk: VerificationKey<SpendAuth>,
pub(crate) cmx: ExtractedNoteCommitment,
pub(crate) enable_spend: bool,
pub(crate) enable_output: bool,
}
tx検証
Proof#verify