Skip to main content

Module custody_bridge

Module custody_bridge 

Source
Expand description

Cryptographic and consent custody bridge for EMF v4 and QAC v1 sensing streams.

Bridges sensing::acquisition (Schemas 6/7 AcquisitionView and AcquisitionDerivation, original byte preservation mode 0x0104), sensing::authorization (SensingRequest, SensingModality, SensingAction, IdentityAuthority, SensingScopeAuthority, RevocationAuthority, TrustedUnixClock), sensing::sidecar_attestation, and sensing::local_custody (on non-wasm32 targets).

Enforces anti-substitution binding across authority_receipt_digest (Schema 4 key 6, Schema 7 key 8, Schema 137 key 4, Schema 207 key 5), original_blake3, envelope index_commitment, source_id, actor_id, purpose_hash, and SensingAction.

Structs§

AuthorityBindingClaims
Unsigned descriptor of all fields committed into a stream’s authority_receipt_digest.
ConsentBoundSidecarAuthority
Bridge binding a SidecarReceipt (sensing::sidecar_attestation) to a verified SignedAuthorityReceipt whose policy_commitment equals receipt.receipt_digest().
ExpectedStreamBinding
Expected stream and operation context verified against a SignedAuthorityReceipt.
LocalCustodyStoreBridge
Native-only adapter bridging ConsentBoundSidecarAuthority and RevalidatedSensingUse (SensingAction::Store) to sensing::local_custody::CustodyAuthority.
ReceiptReplayWindow
Zero-heap anti-replay tracker for SignedAuthorityReceipt consumption.
SignedAuthorityReceipt
Signed, anti-substitution authority receipt whose BLAKE3 digest populates authority_receipt_digest in Schema 4, Schema 7, Schema 137, or Schema 207.

Enums§

AuthorityReceiptTarget
Schema target where an authority_receipt_digest is anchored.
CustodyBridgeError
Errors returned by the cryptographic and consent custody bridge.

Constants§

AUTHORITY_RECEIPT_DOMAIN
Domain separator for BLAKE3 authority receipt digests stored in Schema 4/7/137/207.
AUTHORITY_SIGNATURE_DOMAIN
Domain separator for Ed25519 signing over an authority receipt binding.
MAX_RECEIPT_REPLAY_WINDOW
Maximum receipts tracked in a bounded zero-heap anti-replay window.

Functions§

verify_acquisition_derivation_custody
Verify a Schema 7 acquisition::Derivation against its SignedAuthorityReceipt, confirming that the receipt is anchored to AuthorityReceiptTarget::AcquisitionDerivationSchema7, the action is SensingAction::Process, and the output Original digest matches.
verify_acquisition_original_custody
Verify an acquisition::Original (mode 0x0104 preserved original bytes) against a SignedAuthorityReceipt and live consent authorities.
verify_and_consume_stream_receipt
Verify and consume a SignedAuthorityReceipt against live consent authorities, anti-replay state, and the exact stream digests (original_blake3, index_commitment, authority_receipt_digest).
verify_artifact_link_digest
Helper to bind an acquisition::Context calibration/uncertainty link to a known digest.