Expand description
Node identity registry.
A Node is a physical thing in the mesh — an ESP32, the daemon
host, a Pi. It signs emissions (sensor data, heartbeats, anything
it merely reports). Sensing is not acting; nodes are deliberately
distinct from actors (crate::agent_registry::AgentRegistry),
which sign Actions (Foundry-style mutations).
Each node holds an Ed25519 keypair. The node-id is
hex(SHA-256(pubkey)[..16]) (32 hex chars, ADR-103 D11), computed by
crate::node_id::node_id_from_pubkey — self-authenticating
(recompute to verify), and a 32-hex segment can never equal a
reserved word like _derived or meta. A friendly human label lives as a property at
substrate/<node-id>/meta/label, not as the identity itself —
labels can collide, keys cannot.
§Substrate write gate
Under the node-identity contract every substrate write belongs to exactly one node and must land under that node’s namespace:
substrate/<node-id>/...This module provides the registry (node-id → pubkey) and the
canonical signing payload
(node_publish_payload). Enforcement of the prefix rule lives
on SubstrateService;
signature verification lives at the RPC boundary in
clawft-weave. Both consult this registry.
The registry is in-memory. Node keys are provisioned on the node side (firmware-burned for the ESP32, persisted on disk for the daemon) and registered at kernel boot. Restart-resets by design — the on-disk provisioning is the source of truth.
Re-exports§
pub use crate::node_id::node_id_from_pubkey;
Structs§
- Derived
Write Grant - Capability allowing a node to publish under
substrate/_derived/<topic>(or its subtree, depending onGrantScope). - Node
Registry - In-memory node-id → public-key map.
- Registered
Node - A registered node: node-id, public key, optional friendly label, and when it was added to the registry.
Enums§
- Derived
Grant Error - Failure modes for
NodeRegistry::issue_derived_grant. - Grant
Scope - Scope of a
DerivedWriteGrant. Decides whether the registeredtopicmatches one literal subtree or all subtrees beneath it.
Constants§
- MESH_
CANONICAL_ PREFIX - Required path prefix for a mesh-canonical write. Trailing slash
included so a
strip_prefixcleanly leaves the remaining<topic>segment without a leading separator. See R3.0.
Functions§
- node_
publish_ payload - Compose the canonical byte payload a node must sign for a
substrate.publish. - node_
register_ payload - Compose the canonical byte payload a node must sign as the
proof-of-possession for
node.register. - path_
belongs_ to - Whether
pathis a legal write target fornode_id. Convenience wrapper overrequired_path_prefix. - required_
path_ prefix - Required path prefix for any substrate write originated by
node_id.