purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
construction_receipt_accumulation.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Judica, Inc.
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or https://opensource.org/license/mit/.
4
5#pragma once
6
7#include <array>
8#include <bit>
9#include <cstddef>
10#include <span>
11#include <utility>
12
16
17namespace purify::accountable {
18
27public:
30 const ResolvedConstructionSetup&) = delete;
32 default;
34 ResolvedConstructionSetup&&) noexcept = default;
35
36 [[nodiscard]] static Result<ResolvedConstructionSetup> create(
41
42 [[nodiscard]] const NonceHostBoundSigningRoster& roster()
43 const noexcept {
44 return roster_;
45 }
46
47 [[nodiscard]] const CoalitionFormation& formation() const noexcept {
48 return formation_;
49 }
50
51 [[nodiscard]] const UInt512& recovery_root() const noexcept {
52 return recovery_root_;
53 }
54
56 const noexcept {
57 return resolved_digest_;
58 }
59
60private:
66 : roster_(std::move(roster)),
67 formation_(std::move(formation)),
68 recovery_root_(recovery_root),
69 resolved_digest_(std::move(resolved_digest)) {}
70
71 NonceHostBoundSigningRoster roster_;
72 CoalitionFormation formation_;
73 UInt512 recovery_root_{};
74 ResolvedConstructionSetupDigest resolved_digest_;
75};
76
81public:
82 static constexpr std::size_t kRootClaimRounds = std::bit_width(
84 static constexpr std::size_t kRootClaimSerializedSize =
85 33 + 32 + kRootClaimRounds * 32;
86 static_assert(kRootClaimSerializedSize == 545);
87
89 delete;
91 const ConstructionReceiptAccumulator&) = delete;
93 ConstructionReceiptAccumulator&&) noexcept = default;
95 ConstructionReceiptAccumulator&&) noexcept = default;
96
97 [[nodiscard]] static Result<ConstructionReceiptAccumulator> create(
98 purify_secp_context* secp_context);
99
100 [[nodiscard]] const ConstructionLeafAccumulator& leaves()
101 const noexcept {
102 return leaves_;
103 }
104
105private:
108 : leaves_(std::move(leaves)) {}
109
110 ConstructionLeafAccumulator leaves_;
111};
112
113} // namespace purify::accountable
ConstructionReceiptAccumulator(const ConstructionReceiptAccumulator &)=delete
ConstructionReceiptAccumulator & operator=(const ConstructionReceiptAccumulator &)=delete
const ConstructionLeafAccumulator & leaves() const noexcept
static Result< ConstructionReceiptAccumulator > create(purify_secp_context *secp_context)
ConstructionReceiptAccumulator(ConstructionReceiptAccumulator &&) noexcept=default
An ordered signing roster bound to one core and nonce-host list.
Immutable registry-record digest selected by a recovery root.
static Result< ResolvedConstructionSetup > create(NonceHostBoundSigningRoster roster, CoalitionFormation formation, UInt512 recovery_root, ResolvedConstructionSetupDigest resolved_digest)
ResolvedConstructionSetup(const ResolvedConstructionSetup &)=delete
ResolvedConstructionSetup & operator=(const ResolvedConstructionSetup &)=delete
const ResolvedConstructionSetupDigest & resolved_digest() const noexcept
const NonceHostBoundSigningRoster & roster() const noexcept
ResolvedConstructionSetup(ResolvedConstructionSetup &&) noexcept=default
Canonical public statement for a coalition construction receipt.
BigUInt< 8 > UInt512
512-bit unsigned integer used for private and packed public keys.
Definition numeric.hpp:821
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99