Skip to main content

Crate hyprstream_resource

Crate hyprstream_resource 

Source
Expand description

Dependency-light semantic contracts for dual-attested resources (#1067).

This crate deliberately exposes no Serde implementation and no wire codec. #1065 exclusively owns canonical DAG-CBOR/CDDL. Values entering a trust boundary must pass the validating constructors in this crate; public struct layout is not a persistence or interoperability format.

Structs§

AcceptedAuthority
An accepted-current authority root supplied by the authority-specific verifier. A DID or a KeyPurpose label is not an authority root.
CanonicalResourceIntent
A canonical intent can only be created after canonical decoding and digest verification. Its fields are intentionally private.
Cid
ContentLabelCommitment
Did
DualAttestation
Joined attestations can only be constructed after both signatures have been verified under their own accepted-current roots, the roots pass deployment separation policy, and all cross-claim/accounting checks pass.
FencingToken
Registrar term is monotonically increasing across leadership/authority epochs (the #1069-owned backend term-allocation rule); generation is monotonically increasing per resource inside a term. The compare-and-apply contract orders numeric (registrar_term, generation, resource_version) tuples.
FinalizationStatement
Signed registrar statement. It is untrusted until accepted by FinalizedResource::verify and a configured accepted-current verifier.
FinalizedResource
Verified registrar output. Private fields prevent fabrication by namespace, storage, PDS, or recovery callers.
IntentCandidate
Untrusted wire/persistence candidate presented to the validating boundary.
IntentClaims
Semantic claims returned by the trusted #1065 canonical decoder.
IntentDigest
LedgerAttestationCandidate
Digest-only economic statement. This is private registrar/evidence material, never the ordinary namespace/public-PDS projection.
MacAttestationCandidate
Digest-only MAC statement; richer claim data is re-derived from canonical bytes.
OperationCapabilityCommitment
A blinded anonymous capability value bound to exactly one intent digest.
OperationEntitlementCommitment
A one-use anonymous entitlement/nullifier bound to exactly one intent.
OperationId
OwnerCommitment
A stable, private ownership commitment. It is deliberately not assignable to anonymous capability, entitlement, label, or public-evidence fields.
PredecessorRef
PrivateEvidenceCommitment
ProjectionEffect
Ordered desired-state effect. Publishers compare (registrar_term, generation, resource_version) and reject stale or conflicting effects.
ProjectionEntryId
PublicEvidenceCommitment
The only evidence commitment permitted in a public projection. Its digest binding prevents copying a holder/entitlement value across redemptions.
PublicResourceProjection
Privacy-minimized namespace/public-PDS projection. It contains no detailed attestation CID, payer, issuer, unit, amount, transfer ID, capability root, or signing-key coordinates.
RegistrationSnapshot
Registrar snapshot of one operation. Fields are private: construction goes through RegistrationSnapshot::new, which rejects terminal states without exactly one matching resolution and nonterminal states carrying one, so an inconsistent state/resolution pair is unrepresentable.
RejectSharedAttester
The baseline policy used by the canonical profile rejects a shared authority root or signer DID. It deliberately does not compare key_id: that value can be a local fragment (for example, #resource-v1) scoped by its authority namespace, and equal fragments do not prove shared key material. A deployment that needs cross-namespace key-material detection must supply an independence policy with a globally scoped verifier-derived key identity or fingerprint.
ResolutionRef
ResolutionTarget
Immutable identity of the operation whose terminal outcome is recorded. Every resolution variant carries it; no terminal accounting outcome can be attached to a different operation/resource/fence.
ResourceId
Signature
SignatureEnvelope
Signer selection and historical-verification coordinates authenticated by the envelope. (signer, key_id, key_epoch) resolves through retained accepted-current evidence; state_epoch is not a substitute for key epoch.
TransferId
VerifiedEvidence
Result material returned by a trusted attestation verifier. The verifier is the cryptographic/accepted-current boundary; this crate then seals it into a non-public verified evidence value.
VerifiedLedgerAttestation
VerifiedMacAttestation
Verified evidence is minted only by verify_and_join; raw candidates do not satisfy the registrar interface.
WithdrawalTarget

Enums§

Assurance
Mirrors the canonical hyprstream_rpc::auth::mac::Assurance discriminants. It has no serialization contract. #1065 MUST use checked conversion and byte-compatibility vectors against the canonical owner.
AuthorityError
CapabilityBinding
Anonymous profiles use a blinded, operation-scoped value that is not holder-stable or cross-operation-linkable.
ConflictAccountingResolution
The losing side’s accounting disposition in a Resolution::RejectedConflict record. The referenced transfer MUST be durably confirmed by the economic authority before the terminal resolution is committed, so an identical retry or recovery query discovers the exact economic outcome.
ContractError
ContractVersion
Current semantic-contract version. Wire format versions remain #1065-owned.
ControllerRef
DigestSuite
Digest suite for ResourceIntent canonical bytes.
IntentFormatVersion
Canonical intent format understood by a configured #1065 codec.
KeyPurpose
LedgerPhase
OwnershipRef
PayerRef
ProjectionAction
QuarantineReason
RegistrarState
RequiredAssurance
The minimum assurance a canonical intent is permitted to require. Unlike Assurance, this type intentionally has no Unverified variant: an intent cannot make unverified evidence sufficient by selecting a zero floor.
Resolution
Immutable terminal resolution. ManualReview and Quarantined are never terminal until one of these records is durably committed. A record that references an accounting effect (Voided, Compensated, or the losing side’s disposition in RejectedConflict) is committed only after the referenced transfer is durably confirmed.
ResourceKind
ResourceOperation
Closed operation vocabulary. Namespace link/rename/bind operations use #1071’s separate child-owned vocabulary and will never be added here without a semantic-contract version increase.
SignatureSuite
Signature profile reference; this is semantic metadata, not wire encoding.

Traits§

AttestationIndependencePolicy
Deployment policy for the separation of the two signing authorities. Default deployments reject a shared accepted root or signer. Service or host co-location is not itself evidence of independence: if it lets one compromise control both roots/keys, this policy must reject the deployment or the deployment has explicitly accepted that residual risk outside this contract.
EconomicAuthority
FinalizationProofVerifier
IntentValidator
Trusted codec boundary implemented by #1065.
LedgerAttestationVerifier
MacAttestationVerifier
MacAuthority
ResourceMaterializer
ResourcePublisher
ResourceRegistrar