5#ifndef BITCOIN_AVALANCHE_PROOF_H
6#define BITCOIN_AVALANCHE_PROOF_H
70 READWRITE(obj.utxo, obj.amount, obj.height, obj.pubkey);
125 std::vector<SignedStake> stakes_,
const CScript &payoutScriptPubKey_,
150 READWRITE(obj.sequence, obj.expirationTime, obj.master, obj.stakes);
151 READWRITE(obj.payoutScriptPubKey, obj.signature);
152 SER_READ(obj, obj.computeProofId());
156 static bool FromHex(
Proof &proof,
const std::string &hexProof,
158 std::string
ToHex()
const;
191 return hash(proof->getId());
static constexpr Amount COIN
An outpoint - a combination of a transaction hash and an index n into its vout.
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
Provides an interface for creating and interacting with one or two chainstates: an IBD chainstate gen...
size_t hash(const uint256 &h) const
int64_t getExpirationTime() const
static bool FromHex(Proof &proof, const std::string &hexProof, bilingual_str &errorOut)
IMPLEMENT_RCU_REFCOUNT(uint64_t)
bool verify(const Amount &stakeUtxoDustThreshold, ProofValidationState &state) const
Proof(uint64_t sequence_, int64_t expirationTime_, CPubKey master_, std::vector< SignedStake > stakes_, const CScript &payoutScriptPubKey_, SchnorrSig signature_)
Amount getStakedAmount() const
const CPubKey & getMaster() const
CScript payoutScriptPubKey
std::string ToHex() const
const StakeCommitment getStakeCommitment() const
uint64_t getSequence() const
const LimitedProofId & getLimitedId() const
LimitedProofId limitedProofId
std::vector< SignedStake > stakes
const SchnorrSig & getSignature() const
Proof(deserialize_type, Stream &s)
Deserialization constructor.
const CScript & getPayoutScript() const
uint32_t getScore() const
const ProofId & getId() const
const std::vector< SignedStake > & getStakes() const
SERIALIZE_METHODS(Proof, obj)
static uint32_t amountToScore(Amount amount)
size_t operator()(const ProofRef &proof) const
const Stake & getStake() const
bool verify(const StakeCommitment &commitment) const
SignedStake(Stake stake_, SchnorrSig sig_)
SERIALIZE_METHODS(SignedStake, obj)
const SchnorrSig & getSignature() const
Stake(COutPoint utxo_, Amount amount_, uint32_t height_, bool is_coinbase, CPubKey pubkey_)
uint256 getHash(const StakeCommitment &commitment) const
uint32_t getHeight() const
SERIALIZE_METHODS(Stake, obj)
const CPubKey & getPubkey() const
const COutPoint & getUTXO() const
const StakeId & getId() const
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
std::array< uint8_t, CPubKey::SCHNORR_SIZE > SchnorrSig
a Schnorr signature
static constexpr Amount PROOF_DUST_THRESHOLD
Minimum amount per utxo.
Implement std::hash so RCUPtr can be used as a key for maps or sets.
static constexpr int AVALANCHE_DEFAULT_STAKE_UTXO_CONFIRMATIONS
Minimum number of confirmations before a stake utxo is mature enough to be included into a proof.
static constexpr int AVALANCHE_MAX_PROOF_STAKES
How many UTXOs can be used for a single proof.
void Unserialize(Stream &, char)=delete
#define SER_READ(obj, code)
StakeCommitment(int64_t expirationTime, const CPubKey &master)
Dummy data type to identify deserializing constructors.
#define EXCLUSIVE_LOCKS_REQUIRED(...)