purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
accountable_roster.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 <span>
9#include <vector>
10
11#include "purify/numeric.hpp"
12
13namespace purify::accountable {
14
17 std::array<unsigned char, 33> public_key;
20};
21
31class SigningRoster {
32public:
33 [[nodiscard]] static Result<SigningRoster> aggregate(
34 std::span<const std::array<unsigned char, 33>> ordered_public_keys,
35 purify_secp_context* secp_context);
36
38 [[nodiscard]] std::span<const SigningRosterMember> members() const { return members_; }
39
41 [[nodiscard]] const std::array<unsigned char, 32>& signing_key() const { return signing_key_; }
42
44 [[nodiscard]] const std::array<unsigned char, 32>& key_list_hash() const { return key_list_hash_; }
45
47 [[nodiscard]] bool aggregate_was_negated() const { return aggregate_was_negated_; }
48
49private:
50 SigningRoster() = default;
51
52 std::vector<SigningRosterMember> members_;
53 std::array<unsigned char, 32> signing_key_{};
54 std::array<unsigned char, 32> key_list_hash_{};
55 bool aggregate_was_negated_ = false;
56};
57
58} // namespace purify::accountable
Field element modulo the backend scalar field used by this implementation.
Definition numeric.hpp:815
Experimental public key aggregation for one ordered coalition roster.
bool aggregate_was_negated() const
Whether the unnormalized weighted sum had odd Y.
std::span< const SigningRosterMember > members() const
Members in their original order; effective weights include parity.
const std::array< unsigned char, 32 > & signing_key() const
Canonical even-Y aggregate signing key for ConflictContext.
static Result< SigningRoster > aggregate(std::span< const std::array< unsigned char, 33 > > ordered_public_keys, purify_secp_context *secp_context)
const std::array< unsigned char, 32 > & key_list_hash() const
BIP327 key-list hash; this is NOT the authenticated Purify host commitment U.
Expected< T, Error > Result
Expected-returning convenience alias for Purify value-producing APIs.
Definition error.hpp:99
Fixed-width integer and field arithmetic helpers used throughout Purify.
An ordered individual signing key and its normalized public weight.
FieldElement coefficient
BIP327 key coefficient multiplied by the aggregate parity sign.
std::array< unsigned char, 33 > public_key