1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122
/// Information about the state of the chain as of a given block.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainMetadata {
/// the size of the Sapling note commitment tree as of the end of this block
#[prost(uint32, tag = "1")]
pub sapling_commitment_tree_size: u32,
/// the size of the Orchard note commitment tree as of the end of this block
#[prost(uint32, tag = "2")]
pub orchard_commitment_tree_size: u32,
}
/// A compact representation of the shielded data in a Zcash block.
///
/// CompactBlock is a packaging of ONLY the data from a block that's needed to:
/// 1. Detect a payment to your shielded Sapling address
/// 2. Detect a spend of your shielded Sapling notes
/// 3. Update your witnesses to generate new Sapling spend proofs.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactBlock {
/// the version of this wire format, for storage
#[prost(uint32, tag = "1")]
pub proto_version: u32,
/// the height of this block
#[prost(uint64, tag = "2")]
pub height: u64,
/// the ID (hash) of this block, same as in block explorers
#[prost(bytes = "vec", tag = "3")]
pub hash: ::prost::alloc::vec::Vec<u8>,
/// the ID (hash) of this block's predecessor
#[prost(bytes = "vec", tag = "4")]
pub prev_hash: ::prost::alloc::vec::Vec<u8>,
/// Unix epoch time when the block was mined
#[prost(uint32, tag = "5")]
pub time: u32,
/// (hash, prevHash, and time) OR (full header)
#[prost(bytes = "vec", tag = "6")]
pub header: ::prost::alloc::vec::Vec<u8>,
/// zero or more compact transactions from this block
#[prost(message, repeated, tag = "7")]
pub vtx: ::prost::alloc::vec::Vec<CompactTx>,
/// information about the state of the chain as of this block
#[prost(message, optional, tag = "8")]
pub chain_metadata: ::core::option::Option<ChainMetadata>,
}
/// A compact representation of the shielded data in a Zcash transaction.
///
/// CompactTx contains the minimum information for a wallet to know if this transaction
/// is relevant to it (either pays to it or spends from it) via shielded elements
/// only. This message will not encode a transparent-to-transparent transaction.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactTx {
/// Index and hash will allow the receiver to call out to chain
/// explorers or other data structures to retrieve more information
/// about this transaction.
///
/// the index within the full block
#[prost(uint64, tag = "1")]
pub index: u64,
/// the ID (hash) of this transaction, same as in block explorers
#[prost(bytes = "vec", tag = "2")]
pub hash: ::prost::alloc::vec::Vec<u8>,
/// The transaction fee: present if server can provide. In the case of a
/// stateless server and a transaction with transparent inputs, this will be
/// unset because the calculation requires reference to prior transactions.
/// If there are no transparent inputs, the fee will be calculable as:
/// valueBalanceSapling + valueBalanceOrchard + sum(vPubNew) - sum(vPubOld) - sum(tOut)
#[prost(uint32, tag = "3")]
pub fee: u32,
#[prost(message, repeated, tag = "4")]
pub spends: ::prost::alloc::vec::Vec<CompactSaplingSpend>,
#[prost(message, repeated, tag = "5")]
pub outputs: ::prost::alloc::vec::Vec<CompactSaplingOutput>,
#[prost(message, repeated, tag = "6")]
pub actions: ::prost::alloc::vec::Vec<CompactOrchardAction>,
}
/// A compact representation of a [Sapling Spend](<https://zips.z.cash/protocol/protocol.pdf#spendencodingandconsensus>).
///
/// CompactSaplingSpend is a Sapling Spend Description as described in 7.3 of the Zcash
/// protocol specification.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactSaplingSpend {
/// Nullifier (see the Zcash protocol specification)
#[prost(bytes = "vec", tag = "1")]
pub nf: ::prost::alloc::vec::Vec<u8>,
}
/// A compact representation of a [Sapling Output](<https://zips.z.cash/protocol/protocol.pdf#outputencodingandconsensus>).
///
/// It encodes the `cmu` field, `ephemeralKey` field, and a 52-byte prefix of the
/// `encCiphertext` field of a Sapling Output Description. Total size is 116 bytes.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactSaplingOutput {
/// Note commitment u-coordinate.
#[prost(bytes = "vec", tag = "1")]
pub cmu: ::prost::alloc::vec::Vec<u8>,
/// Ephemeral public key.
#[prost(bytes = "vec", tag = "2")]
pub ephemeral_key: ::prost::alloc::vec::Vec<u8>,
/// First 52 bytes of ciphertext.
#[prost(bytes = "vec", tag = "3")]
pub ciphertext: ::prost::alloc::vec::Vec<u8>,
}
/// A compact representation of an [Orchard Action](<https://zips.z.cash/protocol/protocol.pdf#actionencodingandconsensus>).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactOrchardAction {
/// \[32\] The nullifier of the input note
#[prost(bytes = "vec", tag = "1")]
pub nullifier: ::prost::alloc::vec::Vec<u8>,
/// \[32\] The x-coordinate of the note commitment for the output note
#[prost(bytes = "vec", tag = "2")]
pub cmx: ::prost::alloc::vec::Vec<u8>,
/// \[32\] An encoding of an ephemeral Pallas public key
#[prost(bytes = "vec", tag = "3")]
pub ephemeral_key: ::prost::alloc::vec::Vec<u8>,
/// \[52\] The first 52 bytes of the encCiphertext field
#[prost(bytes = "vec", tag = "4")]
pub ciphertext: ::prost::alloc::vec::Vec<u8>,
}