🔐network_auth
Struct NetworkAuth
Shared registry for identity key bindings.
Struct NetworkAuthInnerV1
Version one stored layout for [NetworkAuth].
Struct KeyBinding
Per-identity key binding stored at a deterministic derived address.
This object holds the full key lifecycle state for one identity:
key registration (with PoP),
active key selection (the only key verifiers accept),
revocations (for incident response / decommissioning).
Struct KeyBindingInnerV1
Version one stored layout for [KeyBinding].
Struct KeyRecord
Single key record stored in a binding.
Keys are append only (registered under a new key_id) and can be revoked.
Struct ProofOfIdentity
Ephemeral proof that the caller is authorized to act for an identity.
This prevents unauthorized parties from creating bindings or registering keys for identities they do not control.
Struct ProofOfKey
Ephemeral proof that a key is controlled by the signer.
This proves possession of the private key corresponding to public_key without revealing it, and is valid only for a single registration slot (bound to [KeyBinding::next_key_id]).
Struct NetworkAuthCreatedEvent
Emitted when a new network auth registry is created.
Struct KeyBindingCreatedEvent
Emitted when a new key binding is created.
Struct KeyRegisteredEvent
Emitted when a key is registered.
Struct KeyRevokedEvent
Emitted when a key is revoked.
Struct ActiveKeyUpdatedEvent
Emitted when the active key changes.
Enum IdentityKey
Canonical identity key namespace for key bindings.
This value is used as:
the key for the derived [KeyBinding] address, and
the identity commitment inside PoP signatures (via
bcs(IdentityKey)).
Constants
Required byte length of an Ed25519 public key.
Required byte length of an Ed25519 signature.
Identifier for Ed25519 keys.
Default domain separator for proof-of-possession.
Function prove_leader
Create proof for the leader (sender) using its leader capability.
The leader capability serves as the on-chain authorization to act as a Leader identity and register/rotate keys for IdentityKey::Leader { leader_cap_id: object::id(leader_cap) }.
Function prove_offchain_tool
Creates identity proof for an off-chain Tool using its owner capability.
The owner cap is validated against the Tool object before binding its stable ID.
Function proof_identity
Return the identity proven by the proof.
Function identity_key_leader
Build a leader identity key from a leader capability id.
Function identity_key_tool
Build a tool identity key from a stable Tool object ID.
Function new_proof_of_key
Create proof_of_possession for registering the given public key. Only Ed25519 keys are supported.
The signature must verify over POP_DOMAIN || bcs(IdentityKey) || bcs(key_id) || public_key using the same public key, proving control of the private key for this specific identity and key-id slot.
Function binding_address
Deterministic derived address for the key binding.
Uses the registry object ID and the identity as the derivation key.
This allows any caller to deterministically compute where the [KeyBinding] for an identity lives on-chain.
Function binding_exists
Check whether a binding has been created for the given identity.
Function registered_key_witness
Returns the singleton registered key verifier witness ID.
Function create_binding
Create a new key binding for the given identity.
This claims the derived object ID, initializes the binding state, and inserts the identity into the registry's discovery set.
Function key_binding_identity
Return the identity associated with a key binding.
Function key_binding_active_key_id
Return the active key id for a binding.
Offchain verifiers must accept signatures from this key only.
Function key_binding_next_key_id
Return the next key id that will be assigned on registration.
This value is also committed into PoP signatures to make them one-time-use.
Function key_binding_key
Borrow a key record by id.
Function active_key_is_usable
Returns whether the current active slot is a live, correctly-sized Ed25519 key.
Function verify_active_key_signature
Verify an Ed25519 signature against the currently active key for this binding.
Returns false unless:
the active key record exists and is not revoked,
the key scheme and sizes are valid Ed25519 values, and
signature verification succeeds.
Function register_key
Register a new key and set it as active.
This assigns a monotonically increasing key id, stores the key record, and updates the active key pointer.
Function revoke_key
Revoke an existing key.
This sets the revocation timestamp and clears the active key if needed.
Function set_active_key
Set the active key to an existing, non-revoked key.
This switches the active key pointer without altering key records.
Last updated

