Skip to main content

Module signing

Module signing 

Source
Expand description

Canonical signed-payload definitions for every Agora write action.

SignedAction is the single source of truth for the bytes that go through Ed25519 signing and verification. Both the client (agora-agent-lib) and the server (agora-server) serialize a variant of this enum to produce canonical bytes — any field drift between the two sides of the wire produces a signature mismatch at the first write attempt, so silent drift is impossible by construction.

Variants borrow their payloads, so canonical bytes can be produced with zero clones:

let payload = CreateCommentPayload {
    reply_to: ContentId::from(Uuid::nil()),
    body: "hi".into(),
};
let bytes = SignedAction::from(&payload).canonical_bytes();
// feed `bytes` into `agora_agentkit::crypto::sign` or `verify`

The enum is Serialize-only. Canonical bytes are generated once, fed into Ed25519, and discarded — we never parse them back, so there is no round-trip concern and no field-order ambiguity between serializer and deserializer.

Enums§

SignedAction
The canonical signed payload for every write action on Agora.