purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::accountable::AnchorEscrowRecord Class Reference

#include <anchor_escrow.hpp>

Public Member Functions

 AnchorEscrowRecord (const AnchorEscrowRecord &)=default
AnchorEscrowRecord & operator= (const AnchorEscrowRecord &)=default
 AnchorEscrowRecord (AnchorEscrowRecord &&) noexcept=default
AnchorEscrowRecord & operator= (AnchorEscrowRecord &&) noexcept=default
const AnchorEscrowCiphertext & ciphertext () const noexcept
Result< Bytes > serialize (purify_secp_context *secp_context) const

Static Public Member Functions

static Result< AnchorEscrowRecord > deserialize (std::span< const unsigned char > encoded, purify_secp_context *secp_context)

Static Public Attributes

static constexpr unsigned char kSerializationVersion = 4
static constexpr std::size_t kNormProofSize = 974
static constexpr std::size_t kProofPayloadSize = 1136
static constexpr std::size_t kSerializedSize

Friends

class ConstructionLeafAccumulator
Result< AnchorEscrowRecord > create_anchor_escrow (const RecoveryBoundSigningRoster &roster, const UInt512 &advertised_anchor_root, const AnchorPunishmentKey &punishment_key, const AnchorEscrowContextDigest &context_digest, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr)
Result< AnchorEscrowRecord > create_anchor_escrow_with_aux_randomness (const RecoveryBoundSigningRoster &roster, const UInt512 &advertised_anchor_root, const AnchorPunishmentKey &punishment_key, const AnchorEscrowContextDigest &context_digest, const bppp::ScalarBytes &auxiliary_randomness, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr)
Result< bool > verify_anchor_escrow (const RecoveryBoundSigningRoster &roster, const UInt512 &advertised_anchor_root, const AnchorPunishmentPublicKey &punishment_key, const AnchorEscrowContextDigest &context_digest, const AnchorEscrowRecord &record, purify_secp_context *secp_context, bppp::ExperimentalCircuitBackend *cache=nullptr)

Detailed Description

Fixed-size proof that one exact BIP340 punishment scalar is encrypted to a recovery-bound coalition. Record version 4 fixes Purify's modern tagged field-hash suite; legacy-hash builds reject proof construction and verification. Parsing is syntax only.

Definition at line 149 of file anchor_escrow.hpp.

Constructor & Destructor Documentation

◆ AnchorEscrowRecord() [1/2]

purify::accountable::AnchorEscrowRecord::AnchorEscrowRecord ( const AnchorEscrowRecord & )
default

◆ AnchorEscrowRecord() [2/2]

purify::accountable::AnchorEscrowRecord::AnchorEscrowRecord ( AnchorEscrowRecord && )
defaultnoexcept

References AnchorEscrowRecord().

Member Function Documentation

◆ ciphertext()

const AnchorEscrowCiphertext & purify::accountable::AnchorEscrowRecord::ciphertext ( ) const
inlinenodiscardnoexcept

◆ deserialize()

◆ operator=() [1/2]

AnchorEscrowRecord & purify::accountable::AnchorEscrowRecord::operator= ( AnchorEscrowRecord && )
defaultnoexcept

References AnchorEscrowRecord().

◆ operator=() [2/2]

AnchorEscrowRecord & purify::accountable::AnchorEscrowRecord::operator= ( const AnchorEscrowRecord & )
default

References AnchorEscrowRecord().

◆ serialize()

Result< Bytes > purify::accountable::AnchorEscrowRecord::serialize ( purify_secp_context * secp_context) const
nodiscard

Definition at line 418 of file anchor_escrow.cpp.

References kSerializationVersion, kSerializedSize, and PURIFY_RETURN_IF_ERROR.

◆ ConstructionLeafAccumulator

friend class ConstructionLeafAccumulator
friend

Definition at line 202 of file anchor_escrow.hpp.

References ConstructionLeafAccumulator.

Referenced by ConstructionLeafAccumulator.

◆ create_anchor_escrow

Result< AnchorEscrowRecord > create_anchor_escrow ( const RecoveryBoundSigningRoster & roster,
const UInt512 & advertised_anchor_root,
const AnchorPunishmentKey & punishment_key,
const AnchorEscrowContextDigest & context_digest,
purify_secp_context * secp_context,
bppp::ExperimentalCircuitBackend * cache = nullptr )
friend

Encrypt an anchor's existing punishment scalar to a verified coalition root.

Operating-system auxiliary randomness is hedged with the punishment secret and exact roster, root, and context statement. Separately tagged derivations produce the ephemeral key and proof seed. The proof binds the exact advertised anchor root, canonical punishment key, ciphertext, recovery-bound roster, and application context. The advertised anchor root must differ from the coalition recovery root so exposure cannot directly reconstruct the advertised anchor key.

Definition at line 485 of file anchor_escrow.cpp.

References purify::accountable::create_anchor_escrow_with_aux_randomness(), purify::fill_secure_random(), PURIFY_RETURN_IF_ERROR, and purify::require_secp_context().

◆ create_anchor_escrow_with_aux_randomness

◆ verify_anchor_escrow

Result< bool > verify_anchor_escrow ( const RecoveryBoundSigningRoster & roster,
const UInt512 & advertised_anchor_root,
const AnchorPunishmentPublicKey & punishment_key,
const AnchorEscrowContextDigest & context_digest,
const AnchorEscrowRecord & record,
purify_secp_context * secp_context,
bppp::ExperimentalCircuitBackend * cache = nullptr )
friend

Field Documentation

◆ kNormProofSize

std::size_t purify::accountable::AnchorEscrowRecord::kNormProofSize = 974
staticconstexpr

◆ kProofPayloadSize

std::size_t purify::accountable::AnchorEscrowRecord::kProofPayloadSize = 1136
staticconstexpr

Definition at line 153 of file anchor_escrow.hpp.

◆ kSerializationVersion

unsigned char purify::accountable::AnchorEscrowRecord::kSerializationVersion = 4
staticconstexpr

Definition at line 151 of file anchor_escrow.hpp.

Referenced by deserialize(), and serialize().

◆ kSerializedSize

std::size_t purify::accountable::AnchorEscrowRecord::kSerializedSize
staticconstexpr

The documentation for this class was generated from the following files: