purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
construction_parent_verifier.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
9
10#pragma once
11
12#include <cstdint>
13#include <memory>
14#include <span>
15#include <string_view>
16#include <utility>
17#include <vector>
18
21
22#if defined(PURIFY_HAS_CONSTRUCTION_PARENT_VERIFIER)
23
24namespace purify::accountable {
25
33class VerifiedConstructionReceipt {
34public:
35 [[nodiscard]] const ConstructionReceiptStatementDigest&
36 statement_digest() const noexcept {
37 return statement_digest_;
38 }
39
40 [[nodiscard]] std::uint32_t anchor_count() const noexcept {
41 return anchor_count_;
42 }
43
52 const FieldElement& exposed_signing_scalar,
53 std::size_t anchor_index,
54 purify_secp_context* secp_context) const;
55
56private:
61 std::vector<ConstructionReceiptAnchorEntry> entries,
62 std::vector<ResolvedConstructionReceiptEntry> resolved_entries)
63 : statement_digest_(statement_digest),
64 anchor_count_(static_cast<std::uint32_t>(entries.size())),
65 roster_(std::move(roster), aggregate.recovery_root()),
66 aggregate_(std::move(aggregate)),
67 entries_(std::move(entries)),
68 resolved_entries_(std::move(resolved_entries)) {}
69
70 ConstructionReceiptStatementDigest statement_digest_{};
71 std::uint32_t anchor_count_{};
72 RecoveryBoundSigningRoster roster_;
73 RecoveryRootShareAggregate aggregate_;
74 std::vector<ConstructionReceiptAnchorEntry> entries_;
75 std::vector<ResolvedConstructionReceiptEntry> resolved_entries_;
76
78};
79
82public:
85 const ConstructionParentVerifier&) = delete;
90
99 [[nodiscard]] static Result<ConstructionParentVerifier> load(
100 std::string_view artifact_path);
101
112 const ResolvedConstructionSetup& setup,
113 const ConstructionReceiptEnvelope& envelope,
114 std::span<const ResolvedConstructionReceiptEntry> resolved_entries,
115 const ConstructionLeafAccumulator& leaves,
116 purify_secp_context* secp_context) const;
117
118private:
119 struct Impl;
120 explicit ConstructionParentVerifier(std::unique_ptr<Impl> impl);
121
122 std::unique_ptr<Impl> impl_;
123};
124
125} // namespace purify::accountable
126
127#endif // PURIFY_HAS_CONSTRUCTION_PARENT_VERIFIER
Field element modulo the backend scalar field used by this implementation.
Definition numeric.hpp:834
ConstructionParentVerifier(ConstructionParentVerifier &&) noexcept
ConstructionParentVerifier(const ConstructionParentVerifier &)=delete
Result< VerifiedConstructionReceipt > verify(const ResolvedConstructionSetup &setup, const ConstructionReceiptEnvelope &envelope, std::span< const ResolvedConstructionReceiptEntry > resolved_entries, const ConstructionLeafAccumulator &leaves, purify_secp_context *secp_context) const
ConstructionParentVerifier & operator=(const ConstructionParentVerifier &)=delete
static Result< ConstructionParentVerifier > load(std::string_view artifact_path)
An ordered signing roster bound to one core and nonce-host list.
Result< AnchorPunishmentKey > recover_anchor(const FieldElement &exposed_signing_scalar, std::size_t anchor_index, purify_secp_context *secp_context) const
const ConstructionReceiptStatementDigest & statement_digest() const noexcept
Canonical transport for a construction receipt parent proof.
std::array< unsigned char, 32 > ConstructionReceiptStatementDigest
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99
Registry-resolved public inputs for one ordered anchor entry.