6#ifndef OPENCBDC_TX_SRC_TRANSACTION_TRANSACTION_H_
7#define OPENCBDC_TX_SRC_TRANSACTION_TRANSACTION_H_
9#include "crypto/sha256.h"
59 output(
hash_t witness_program_commitment, uint64_t value);
96 std::vector<input> m_inputs{};
99 std::vector<output> m_outputs{};
102 std::vector<witness_t> m_witness{};
130 std::unordered_map<pubkey_t, signature_t, hashing::null>
135 auto operator==(
const compact_tx& tx)
const noexcept -> bool;
165 [[nodiscard]]
auto hash() const ->
hash_t;
169 auto operator()(
compact_tx const& tx)
const noexcept -> size_t;
181 [[nodiscard]]
auto tx_id(
const full_tx& tx)
noexcept ->
hash_t;
189 -> std::optional<input>;
196 -> std::optional<input>;
struct secp256k1_context_struct secp256k1_context
auto uhs_id_from_output(const hash_t &entropy, uint64_t i, const output &output) -> hash_t
std::pair< pubkey_t, signature_t > sentinel_attestation
Sentinel attestation type.
auto input_from_output(const full_tx &tx, size_t i, const hash_t &txid) -> std::optional< input >
Converts the output at the specified index to an input.
std::array< unsigned char, cbdc::hash_size > hash_t
SHA256 hash container.
std::array< unsigned char, pubkey_len > privkey_t
A private key of a public/private keypair.
A condensed, hash-only transaction representation.
std::vector< hash_t > m_inputs
The set of hashes of the transaction's inputs.
std::unordered_map< pubkey_t, signature_t, hashing::null > m_attestations
Signatures from sentinels attesting the compact TX is valid.
std::vector< hash_t > m_uhs_outputs
The set of hashes of the new outputs created in the transaction.
The unique identifier of a specific output from a transaction.
hash_t m_tx_id
The hash of the transaction which created the out_point.
auto operator==(const out_point &rhs) const -> bool
uint64_t m_index
The index of the output in the transaction's output list.
auto operator<(const out_point &rhs) const -> bool
An output of a transaction.
uint64_t m_value
The integral value of the output, in atomic units of currency.
auto operator!=(const output &rhs) const -> bool
auto operator==(const output &rhs) const -> bool
hash_t m_witness_program_commitment
Hash of the witness program.