5#ifndef BITCOIN_AVALANCHE_PROOF_H
6#define BITCOIN_AVALANCHE_PROOF_H
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.
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
void Unserialize(Stream &, char)=delete
#define SER_READ(obj, code)
Dummy data type to identify deserializing constructors.
#define EXCLUSIVE_LOCKS_REQUIRED(...)