hc_deepkey_types/
authority_spec.rs

1use crate::KeyBytes;
2use hdi::prelude::*;
3
4// Represents an M:N multisignature spec.
5// The trivial case 1:1 represents a single agent to sign.
6// We need an entry to define the rules of authority
7// (for authorizing or revoking) keys in the space under a KeysetRoot.
8// This is only committed by the first Deepkey agent.
9#[hdk_entry_helper]
10#[derive(Clone)]
11pub struct AuthoritySpec {
12    // set to 1 for a single signer scenario
13    pub sigs_required: u8,
14    // These signers may not exist on the DHT.
15    // E.g. a revocation key used to create the first change rule.
16    pub authorized_signers: Vec<KeyBytes>,
17}
18
19impl AuthoritySpec {
20    pub fn new(sigs_required: u8, authorized_signers: Vec<KeyBytes>) -> Self {
21        Self {
22            sigs_required,
23            authorized_signers,
24        }
25    }
26}