diff --git a/docs/adrs/003-action-views.md b/docs/adrs/003-action-views.md deleted file mode 100644 index 8d32bc61..00000000 --- a/docs/adrs/003-action-views.md +++ /dev/null @@ -1,104 +0,0 @@ -# ADR 003: opaque and opaque fields in views - -This specification is intended to inform what information should be comprehended by the user during signing a penumbra transaction. The **_visible_** views require a viewing key, the **_opaque_** views are public. Fields tagged as **_opaque_** are optionally also **_visible_** fields, but the opposite is false. For each view, we enumerate the protobuf fields and mark them accordingly. This is tracked by https://github.com/penumbra-zone/web/issues/875. - -## 1. [Spend View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.shielded_pool.v1#penumbra.core.component.shielded_pool.v1.Spend) - -- `Spend` - - `SpendBody` - - `BalanceCommitment`: **_opaque_** field since the homomorphic pedersen commitment to the value of the input note has hiding and binding properties. - - `Nullifier`: **_opaque_** field since the nullifier is a $F_q$ element and reveals nothing about the note commitment it nullifies. - - `SpendVerificationKey`: **_opaque_** field since the randomized verification key **rk** was derived from the spend authorization key $ak \isin \mathbb G$ given a witnessed spend authorization randomizer $\alpha \isin \mathbb F_r$, and $rk = ak+[α]B_{SpendAuth​}$ where the discrete log is hard over a large prime field. - - `SpendAuthSignature`: **_opaque_** field since this is a Schnorr signature where the randomized verification key is derived from the verification key which is a group element $A = [a]B_D$, where scalar $a∈F_r$ is the signing key and $B_d$ is the generator. The randomized signing is $[r]A$, where r is a random 251-bit prime scalar field element for the decaf377 curve. Solving $[r]A$ is a hard discrete log problem over a large prime field. - - `ZKSpendProof`: **_opaque_** field where the Groth16 proof is defined over the BLS12-377 prime field. -- `NoteView`: **_visible_** field since it contains address and value views that meant to remain hidden. - -## 2. [Output View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.shielded_pool.v1#penumbra.core.component.shielded_pool.v1.Output) - -- `Output` - - `OutputBody` - - `NotePayload` - - `StateCommitment`: **_opaque_** field since the output note commitment is a $F_q$ element derived from a secure rate-5 Poseidon hashing scheme and blinded by a $F_q$ element. - - `WphemralPublicKey`: **_opaque_** field since revealing the public key used to decrypt the note reveals nothing about the associated secret key, where $epk = [esk]B_d$. - - `NoteCiphertext`: **_opaque_** field since the note ciphertext is generated using a symmetric encryption ChaCha20Poly1305 algorithm. - - `balanceCommitment`: **_opaque_** field (refer to the same explanation in the [Spend section](#1-spend-view)) - - `WrappedMemoKey`: **_opaque_** field since the encrypted key for decrypting the memo was encrypted using the per-action payload key, which in-turn is a BLAKE2b-512 hash of various public keys, commitments, and shared-secret. The shared secret is derived between sender and recipient by performing a secure Diffie-Hellman key exchange. - - `OvkWrappedKey`: **_opaque_** field since it's encrypted using the sender’s outgoing cipher key, which itself is a BLAKE2b-512 hash of public keys and commitments. - - `ZKOutputProof`: **_opaque_** field where the Groth16 proof is defined over the BLS12-377 prime field. -- `NoteView`: **_visible_** field (refer to the same explanation in the [Spend section](#1-spend-view)) -- `PayloadKey`: **_visible_** field since payload keys provide decryption capabilities of encrypted note ciphertexts. - -## 3. [Swap View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.dex.v1#penumbra.core.component.dex.v1.Swap) - -- `Swap` - - `ZKSwapProof`: **_opaque_** field where the Groth16 proof is defined over the BLS12-377 prime field. - - `SwapBody` - - `TradingPair`: **_opaque_** field where the swap inputs and outputs are shown in the public view since (1) inputs are public because they are in the clear, and (2) outputs are also known because they can be computed by anyone with the BSOD. - - `Amount`: **_opaque_** field since one of the local invariants for a swap is that the swap reveals the input amount of the asset. - - `Amount`: **_opaque_** field since one of the local invariants for a swap is that the swap reveals the output amount of the asset. - - `BalanceCommitment`: **_opaque_** field (refer to the same explanation in the [Spend section](#1-spend-view)) - - `SwapPayload` - - `StateCommitment`: **_opaque_** field since the swap commitment is a $F_q$ element derived from a secure Poseidon hashing scheme and blinded by a $F_q$ element. - - `EncryptedSwap`: **_opaque_** field since the swap ciphertext is encrypted symmetrically using the visible payload key and reveals no more information about the swap that isn't already public. -- `BatchSwapOutputData`: **_opaque_** field since the BSOD in the TxP does not leak any information about the specific output notes that the view service computes for the swap using the BSOD. Computing the output notes already assumes decrypting the swap ciphertext. The BSOD contains the results of the batch swap and is emitted in an event. -- `ValueView`: **_opaque_** field since the swap values are in the clear. -- `Metadata`: **_opaque_** field and the metadata is reported on-chain. -- `SwapPlaintext`: **_visible_** field since the decrypted swap ciphertext enables, alongside the BSOD, to retrieve output notes, which amonst other fields includes the private address controlling the note. -- `TransactionId`: **_visible_** field since it's associated with a commitment that will eventually be nullified, and since nullifiers are public, revealing the transaction ID creates a link between the commitment and the nullifier that commitment nullifies. -- `NoteView`: **_visible_** field since it consists of sensitive fields like the claim address which should not be leaked. - -## 4. [Swap Claim View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5/penumbra.core.component.dex.v1#penumbra.core.component.dex.v1.SwapClaim) - -- `Swap Claim` - - `ZKSwapProof`: **_opaque_** field where the Groth16 proof is defined over the BLS12-377 prime field. - - `SwapClaimBody` - - `Nullifier`: **_opaque_** field (refer to the same explanation in the [Spend section](#1-spend-view)) - - `Fee`: **_opaque_** field since the prepaid fee is a public field. - - `StateCommitment`: **_opaque_** field since the output note commitment for assets 1 is interpretted as $F_q$ elements (constrained to 128-bits) derived from a secure rate-5 Poseidon hashing scheme and blinded by a $F_q$ element. - - `StateCommitment`: **_opaque_** field since the output note commitment for asset 2 is interpretted as $F_q$ elements (constrained to 128-bits) derived from a secure rate-5 Poseidon hashing scheme and blinded by a $F_q$ element. - - `BatchSwapOutputData`: **_opaque_** field (refer to the same explanation in the [Swap section](#3-swap-view)) -- `EpochDuration` - **_opaque_** field since this is included as part of the chain state. - -## 5. [Delegate View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.stake.v1#penumbra.core.component.stake.v1.Delegate) - -- `Delegate` - - - `IdentityKey`: **_opaque_** field since the validator's identity (decaf377-rdsa spendauth verification key) is supposed to be public, while individual delegators are kept private. - - `Epoch`: **_opaque_** field since this is included as part of the chain state. - - `Amount`: **_opaque_** field since the unbounded amount is public until flow encryption is supported to only display batched amounts per block. - - `Amount`: **_opaque_** field since the delegation amount is determined by validator's exchange rate, which is public. - - ## 6. [Undelegate View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.stake.v1#penumbra.core.component.stake.v1.Undelegate) - -- `Undelegate` - - `IdentityKey`: **_opaque_** field (refer to the same explanation in the [Delegate section](#5-delegate-view)). - - `Amount`: **_opaque_** field (refer to the same explanation in the [Delegate section](#5-delegate-view)). - - `Amount`: **_opaque_** field (refer to the same explanation in the [Delegate section](#5-delegate-view)). - - `Epoch`: **_opaque_** field (refer to the same explanation in the [Delegate section](#5-delegate-view)). - -## 7. [UndelegateClaim View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.stake.v1#penumbra.core.component.stake.v1.UndelegateClaim) - -- `UndelegateClaim ` - - `IdentityKey`: **_opaque_** field (refer to the same explanation in the [Delegate section](#5-delegate-view)). - - `Penalty`: **_opaque_** field since this is part of the on-chain data. - - `BalanceCommitment`: **_opaque_** field since the pedersen commitment reveals not data about the note balances. - - `UnbondingStartHeight`: **_opaque_** field since this is recorded publicly on-chain. - -## 8. [ActionDutchAuctionSchedule View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5/penumbra.core.component.auction.v1alpha1#penumbra.core.component.auction.v1alpha1.ActionDutchAuctionSchedule) - -- `ActionDutchAuctionSchedule` - - `DutchAuctionDescription`: **_opaque_** field since the amounts and asset types can be public similiar to swaps. - - `AuctionId`: **_opaque_** field since the unique identifier reveals no information about the auction. - - `Metadata`: **_opaque_** field that augments the view with additional input and output metadata to assist clients in rendering its contents. - -## 9. [ActionDutchAuctionEnd View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.auction.v1alpha1#penumbra.core.component.auction.v1alpha1.ActionDutchAuctionEnd) - -- `ActionDutchAuctionEnd` - - `AuctionId`: **_opaque_** field since the unique identifier reveals no information about the auction. - -## 10. [ActionDutchAuctionWithdraw View](https://buf.build/penumbra-zone/penumbra/docs/78be1d64b1cb484ba4bc666d54dc76c5:penumbra.core.component.auction.v1alpha1#penumbra.core.component.auction.v1alpha1.ActionDutchAuctionWithdraw) - -- `ActionDutchAuctionEnd` - - `AuctionId`: **_opaque_** field (refer to the same explanation in the [ActionDutchAuctionSchedule section](#1-delegate)). - - `SequenceNumber`: **_opaque_** field since it only reveals the state (active or inactive) of the auction. - - `BalanceCommitment`: **_opaque_** field since the pedersen commitment reveals not data about the note balances.