Skip to content

Finish refining all primitive types brought in by Transaction data. #123

@hdevalence

Description

@hdevalence

Following from #105 (comment):

  1. Many of the types in the structures that make up a Transaction need to be refined to assign them semantic meaning. The complete list can be found by running rg 'XXX refine' -A 2 in zebra/zebra-chain/src. Fleshing out many of these types will require further work – for instance, the Zcash-flavored Ed25519 pubkey in the JoinSplit data requires Zcash-flavored Ed25519 #109.

This issue should be closed when there are no more refinements left to do. Once #105 is merged, I will replace this description with a checklist of types to refine.

zebra-chain/src/transaction.rs
81:        // XXX refine this to an Amount type.
82-        value_balance: i64,
zebra-chain/src/transaction/joinsplit.rs
54:    /// XXX refine to an Amount
55-    vpub_old: u64,
--
59:    /// XXX refine to an Amount
60-    vpub_new: u64,
zebra-chain/src/transaction/transparent.rs
51:    // XXX refine to Amount ?
52-    pub value: u64,
53-
zebra-chain/src/transaction/joinsplit.rs
16:    /// XXX refine type
17-    pub nullifier: [u8; 32],
zebra-chain/src/transaction/shielded_data.rs
17:    /// XXX refine to a specific type.
18-    pub nullifier: [u8; 32],

One of these is a nullifier for Sprout, while the other is for Sapling – should these be the same type or different types?

  • a MAC type
zebra-chain/src/transaction/joinsplit.rs
20:    /// XXX refine type
21-    pub vmac: [u8; 32],
zebra-chain/src/transaction/joinsplit.rs
37:    /// XXX refine type
38-    pub commitment: [u8; 32],
  • types related to note encryption (sprout):
zebra-chain/src/transaction/joinsplit.rs
41:    /// XXX refine type
42-    /// XXX this should be a [u8; 601] but we need trait impls.
43-    pub enc_ciphertext: Vec<u8>,
zebra-chain/src/transaction/joinsplit.rs
65:    /// XXX refine type
66-    anchor: [u8; 32],
zebra-chain/src/transaction/joinsplit.rs
69:    /// XXX refine to an x25519-dalek type?
70-    ephemeral_key: [u8; 32],
zebra-chain/src/transaction/joinsplit.rs
88:    // XXX refine to a Zcash-flavored Ed25519 pubkey.
89-    pub pub_key: [u8; 32],
90-    /// The JoinSplit signature.
91:    // XXX refine to a Zcash-flavored Ed25519 signature.
92-    // for now it's [u64; 8] rather than [u8; 64] to get trait impls
93-    pub sig: [u64; 8],
  • a sapling value commitment type:
zebra-chain/src/transaction/shielded_data.rs
11:    /// XXX refine to a specific type.
12-    pub cv: [u8; 32],
--
21:    /// XXX refine to a specific type.
22-    pub rk: [u8; 32],
23-    /// The ZK spend proof.
--
30:    /// XXX refine to a specific type: redjubjub signature?
31-    /// XXX for now it's [u64; 8] instead of [u8; 64] to get trait impls
32-    pub spend_auth_sig: [u64; 8],
--
77:    // XXX refine this type to a RedJubjub signature.
78-    // for now it's [u64; 8] rather than [u8; 64] to get trait impls
79-    pub binding_sig: [u64; 8],
zebra-chain/src/transaction/shielded_data.rs
50:    /// XXX refine to a specific type.
51-    pub ephemeral_key: [u8; 32],
zebra-chain/src/transaction/shielded_data.rs
46:    /// XXX refine to a specific type.
47-    pub cmu: [u8; 32],
  • note encryption (sapling):
zebra-chain/src/transaction/shielded_data.rs
54:    /// XXX refine to a specific type.
55-    /// XXX this is a Vec<u8> rather than a [u8; 580] to get trait impls
56-    pub enc_ciphertext: Vec<u8>,
--
59:    /// XXX refine to a specific type.
60-    /// XXX this is a [u64; 10] rather than a [u8; 80] to get trait impls
61-    pub out_ciphertext: [u64; 10],
--

Metadata

Metadata

Labels

A-dependenciesArea: Dependency file updatesA-rustArea: Updates to Rust code

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions