zakura-client-backend 0.1.0-rc2

APIs for creating shielded Zcash light clients
Documentation
// This file is @generated by prost-build.
/// Information about the state of the chain as of a given block.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::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,
    /// the size of the Ironwood note commitment tree as of the end of this block
    #[prost(uint32, tag = "3")]
    pub ironwood_commitment_tree_size: u32,
}
/// A compact representation of 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 address
///    2. Detect a spend of your Shielded notes
///    3. Update your witnesses to generate new spend proofs.
///    4. Spend UTXOs associated to t-addresses of your wallet.
///
/// Currently, the `header` field should always be unset (empty). In the future,
/// the presence or absence of header data may be made dependent on request
/// parameters, although it is likely that such flexibility will only be provided via
/// newly-added service methods, not via existing APIs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactBlock {
    /// the height of this block
    #[prost(uint64, tag = "2")]
    pub height: u64,
    /// if present, the ID (hash) of this block
    #[prost(bytes = "vec", tag = "3")]
    pub hash: ::prost::alloc::vec::Vec<u8>,
    /// if present, the ID (hash) of this block's predecessor
    #[prost(bytes = "vec", tag = "4")]
    pub prev_hash: ::prost::alloc::vec::Vec<u8>,
    /// if non-zero, Unix epoch time when the block was mined
    #[prost(uint32, tag = "5")]
    pub time: u32,
    /// if present, full header (as returned by the getblock RPC)
    #[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 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. Additionally,
/// it can optionally include the minimum necessary data to detect payments to transparent addresses
/// related to your wallet.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CompactTx {
    /// The index of the transaction within the block.
    #[prost(uint64, tag = "1")]
    pub index: u64,
    /// The id of the transaction as defined in
    /// [§ 7.1.1 ‘Transaction Identifiers’](<https://zips.z.cash/protocol/protocol.pdf#txnidentifiers>)
    /// This byte array MUST be in protocol order and MUST NOT be reversed
    /// or hex-encoded; the byte-reversed and hex-encoded representation is
    /// exclusively a textual representation of a txid.
    #[prost(bytes = "vec", tag = "2")]
    pub txid: ::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 + valueBalanceIronwood
    ///     + 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>,
    #[prost(message, repeated, tag = "9")]
    pub ironwood_actions: ::prost::alloc::vec::Vec<CompactOrchardAction>,
    /// `CompactTxIn` values corresponding to the `vin` entries of the full transaction.
    ///
    /// Note: the single null-outpoint input for coinbase transactions is omitted. Light
    /// clients can test `CompactTx.index == 0` to determine whether a `CompactTx`
    /// represents a coinbase transaction, as the coinbase transaction is always the
    /// first transaction in any block.
    #[prost(message, repeated, tag = "7")]
    pub vin: ::prost::alloc::vec::Vec<CompactTxIn>,
    /// A sequence of transparent outputs being created by the transaction.
    #[prost(message, repeated, tag = "8")]
    pub vout: ::prost::alloc::vec::Vec<TxOut>,
}
/// A compact representation of a transparent transaction input.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CompactTxIn {
    /// The id of the transaction that generated the output being spent. This
    /// byte array must be in protocol order and MUST NOT be reversed or
    /// hex-encoded.
    #[prost(bytes = "vec", tag = "1")]
    pub prevout_txid: ::prost::alloc::vec::Vec<u8>,
    /// The index of the output being spent in the `vout` array of the
    /// transaction referred to by `prevoutTxid`.
    #[prost(uint32, tag = "2")]
    pub prevout_index: u32,
}
/// A transparent output being created by the transaction.
///
/// This contains identical data to the `TxOut` type in the transaction itself, and
/// thus it is not "compact".
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TxOut {
    /// The value of the output, in Zatoshis.
    #[prost(uint64, tag = "1")]
    pub value: u64,
    /// The script pubkey that must be satisfied in order to spend this output.
    #[prost(bytes = "vec", tag = "2")]
    pub script_pub_key: ::prost::alloc::vec::Vec<u8>,
}
/// 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.
#[derive(Clone, PartialEq, Eq, Hash, ::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.
#[derive(Clone, PartialEq, Eq, Hash, ::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>).
#[derive(Clone, PartialEq, Eq, Hash, ::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>,
}