pub struct SubScopeProof {
pub subset_intents: Vec<IntentHash>,
pub proofs: Vec<MerkleProof>,
}Expand description
Cryptographic evidence that a delegated scope is a strict subset of the delegator’s authorized intent set.
Each entry in subset_intents has a corresponding Merkle proof against
the parent scope root. After verification, the subset is formed into its
own Merkle tree whose root becomes the child scope root.
An empty SubScopeProof is a full-scope pass-through: the child receives
the same scope root as the parent. This is explicit in the API — callers
must consciously choose between SubScopeProof::full_passthrough and
SubScopeProof::build.
Fields§
§subset_intents: Vec<IntentHash>§proofs: Vec<MerkleProof>Implementations§
Source§impl SubScopeProof
impl SubScopeProof
Sourcepub fn full_passthrough() -> Self
pub fn full_passthrough() -> Self
Full-scope pass-through: the delegated scope equals the parent scope.
Sourcepub fn build(
parent_tree: &IntentTree,
intents: &[IntentHash],
) -> Result<Self, A1Error>
pub fn build( parent_tree: &IntentTree, intents: &[IntentHash], ) -> Result<Self, A1Error>
Build a sub-scope proof by proving each intent against parent_tree.
Returns A1Error::IntentNotFound if any intent is absent from the tree.
Sourcepub fn verify_and_derive_root(
&self,
parent_root: &IntentHash,
) -> Result<IntentHash, A1Error>
pub fn verify_and_derive_root( &self, parent_root: &IntentHash, ) -> Result<IntentHash, A1Error>
Verify every subset intent against parent_root, then return the
Merkle root of the subset as the new delegated scope root.
Returns A1Error::InvalidSubScopeProof if any proof fails.
Sourcepub fn commitment(&self) -> [u8; 32]
pub fn commitment(&self) -> [u8; 32]
A deterministic commitment to the full proof structure.
Included in every certificate signature so no one can substitute a different proof on an existing certificate.
Trait Implementations§
Source§impl Clone for SubScopeProof
impl Clone for SubScopeProof
Source§fn clone(&self) -> SubScopeProof
fn clone(&self) -> SubScopeProof
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more