MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / attest

Function attest

atomic-canonical/src/proof.rs:164–167  ·  view source on GitHub ↗

Produce a fully attested Intent node — a thin wrapper over [`attest_value`] so hash and signature can never drift from any other node type. The round trip through serde is lossless for an already-constructed node (all fields are symmetric), so `from_value` cannot fail.

(node: CanonicalNode, identity: &Identity, keypair: &KeyPair)

Source from the content-addressed store, hash-verified

162/// type. The round trip through serde is lossless for an already-constructed
163/// node (all fields are symmetric), so `from_value` cannot fail.
164pub fn attest(node: CanonicalNode, identity: &Identity, keypair: &KeyPair) -> CanonicalNode {
165 let value = attest_value(node.to_value(), identity, keypair);
166 serde_json::from_value(value).expect("attested intent re-deserializes")
167}
168
169/// Verify an attested Intent node — thin wrapper over [`verify_value`].
170pub fn verify(node: &CanonicalNode, public_key: &PublicKey) -> Result<()> {

Callers 3

attested_baseFunction · 0.85
lift_and_attestFunction · 0.85

Calls 2

attest_valueFunction · 0.85
to_valueMethod · 0.45

Tested by 1