Skip to main content

Module storage_attestation

Module storage_attestation 

Source
Expand description

Signed storage attestations — the durability verdict in a form a client can keep (SSoT: Transfer — Durability: Signed Storage Attestation).

POST /v1/storage/verify answers whether the server holds what a client is about to stop holding. Unsigned, that answer is a claim the server can later deny. Signed under the server attestation key — the key that signs custody receipts — and bound to a nonce the client chose, it is evidence: an honest server’s self-reported loss and a periodic audit both become statements the server cannot take back.

§Why this lives in crypto

For the reason crate::crypto::receipts does: the server that signs an attestation links capsule-core without native, and a signed structure defined at both ends stops verifying the day either copy gains a field. One definition, ungated and shared. It must stay std::fs-free; persisting an attestation is the client library’s business.

§What the nonce is for

A signed verdict with no client contribution can be replayed: a server that once held the bytes could answer a later audit with the old signature. The nonce is 32 bytes the client draws fresh per request and checks on the way back, so an attestation proves the server looked after the client asked. checked_at is the server’s clock and evidentiary only; freshness rides the nonce.

§What a client checks

verify_storage_attestation accepts an attestation only when the signature verifies under a pinned attestation key, the version is this one, the nonce is the one the client sent, and the verdicts answer exactly the question the client asked — the same assets in the same order, each with the same declared hashes in the same order. An attestation that answers a different question is not evidence about this one, however validly it is signed.

Structs§

AttestedAsset
One asset’s verdict, as signed.
AttestedBlob
One declared blob’s verdict, as signed.
DeclaredAsset
One asset the client asked about, with the hashes it declared — what an attestation must answer.
StorageAttestation
A signed storage attestation: a StorageAttestationCore plus its hybrid signature.
StorageAttestationCore
The signed core of a StorageAttestation — every field the attestation key covers.

Enums§

AttestationRejection
Why an attestation was rejected. Every variant means it is not evidence for this request.

Constants§

ATTESTATION_NONCE_LEN
The length of the client’s nonce, in bytes.
STORAGE_ATTESTATION_VERSION
The schema version every storage attestation carries.

Functions§

verify_storage_attestation
Verify a storage attestation for one request.

Type Aliases§

AttestationNonce
The client’s per-request nonce.