Skip to main content

Module pointer

Module pointer 

Source
Expand description

Pointers — paid mutable references with an immutable owner.

Implements docs/adr/ADR-0016-pointers-immutable-owner.md.

A pointer is a mutable, owner-signed reference stored at an address derived from the owner’s public key. Ownership is fixed at creation: there is no transfer, no lineage, no certificates and no key rotation. That choice is what lets the design be this small — the owner key is inlined in the record, so validating a pointer needs nothing but the pointer.

§What lives here

The record itself is a wire type and lives in ant_protocol::pointer: its encoding, identifiers and merge rule are things the client and the node must agree on byte for byte. This module is the node’s half.

  • store — durable storage with merge-on-put, which is the part the immutable chunk store cannot do.
  • service — the request handler: validate, check payment, merge.

§The two identifiers

NameDerivationJob
Aderive_key("autonomi.pointer.address.v1", owner)routes, and decides which nodes are responsible
state_idderive_key("autonomi.pointer.state.v1", body)names the state, and is what a quote is paid against

BLAKE3’s derive-key mode, not a hash of a prefix and the input. A chunk is addressed by a plain hash of its content, so a prefix would put both of these inside the chunk address space for anyone who could write the preimage — squatting an address before its owner used it, or buying a pointer and a chunk with one payment. The two modes still share a 32-byte range; what changed is that crossing it is a preimage problem.

They are separate because A must be stable for the pointer’s life while the paid identifier must change with every update, or updates after the first would be free — the 1.0 defect this design exists to fix.

§Why the merge rule ignores signature bytes

ML-DSA signing in saorsa-pqc is randomized and exposes no deterministic mode, so one authenticated state has unboundedly many valid encodings. A merge rule that ordered record bytes would let an owner sign one paid state repeatedly, sort worst-first, and have every submission win — unbounded storage, replication and Merkle-rebuild work for a single payment. So equal state never replaces, and replicas may legitimately hold different encodings of one state. Nothing compares record bytes across replicas; state_id is compared instead.

Re-exports§

pub use service::PointerService;
pub use store::PointerStore;
pub use store::PutOutcome;

Modules§

service
The node’s pointer request handler.
store
Durable storage for pointer records, with merge-on-put.

Structs§

ParsedPointer
Bytes that have been structurally parsed but not yet verified.
Pointer
A paid, mutable, owner-signed reference.
PointerState
The parts of a record that determine its authenticated state.
PointerTarget
A kind tag plus the address it refers to.

Enums§

PointerError
Why a pointer was refused.
PointerTargetKind
What a pointer points at, as clients interpret it.

Constants§

DATA_TYPE_POINTER
Data type identifier for pointers, alongside DATA_TYPE_CHUNK.
POINTER_BODY_LEN
Length of the signed body: everything before the signature.
POINTER_FORMAT_VERSION
Wire format discriminator carried by every pointer.
POINTER_WIRE_LEN
Total size of an encoded pointer.
TARGET_WIRE_LEN
Length of an encoded PointerTarget: a kind tag plus an address.

Functions§

pointer_address
Derive a pointer address from an owner key.
state_id_for_body
Derive the authenticated-state identifier from a signed body.