Node–client interface
Contract between a node and a client. It is the only thing each side needs to know about the other. For the wallet, it defines how a mailbox is obtained, how messages are left and collected, how the network’s information is read and how a wallet is notified that it has messages. For the entity console, it defines how it connects to the entity’s nodes to manage it (section 10).
The content of the messages (issuance, presentation, tokens, receipts) is not defined here, but in protocols/. This interface is the transport.
1. Overview
Section titled “1. Overview”| Function | With which node | Mechanism |
|---|---|---|
| Messaging with an entity | The person’s mediators (to receive) and the entity’s (to deliver) | DIDComm v2 over HTTPS and WebSocket (sections 2 to 5) |
| Reading the network | Any node | HTTPS query in the style of DID Resolution (section 6) |
| Notice of new messages | The person’s mediator, through the wallet’s push service | Optional empty notice (section 7) |
| Managing an entity (console) | The entity’s nodes | Management interface over HTTPS and WebSocket (section 10) |
gRPC is not used between client and node.
2. Messaging
Section titled “2. Messaging”- Every message between a wallet and an entity MUST be a DIDComm Messaging v2 message, end-to-end encrypted between the two parties to the relationship.
- The node acts as a mediator: it stores and delivers messages, but MUST NOT be able to read their content. It only sees what it needs to route them.
- The signature and encryption algorithms, including the DIDComm encryption profile with hybrid ML-KEM-768 + P-256 keys, are specified in cryptography, 3. A participant MUST support that profile.
3. Obtaining the mailbox
Section titled “3. Obtaining the mailbox”- The wallet obtains its mailbox for each relationship at its own mediators (network, 6.1) through Coordinate Mediation 3.0, when establishing the pairwise relationship. It delivers messages for the entity at the entity’s mediators.
- The mailbox is per relationship: each relationship has its own, at one of the person’s 3 mediators chosen at random (network, 6.1).
- When requesting the mailbox, the wallet MAY declare the notification data of section 7.
3.1. First contact
Section titled “3.1. First contact”Normally the holder starts the relationship, because it needs a credential to prove something. Since an entity’s DID document is public, no prior invitation is needed:
- Find the entity. The wallet obtains the entity’s did:keri from the network’s public entity directory, or from a deep link or a QR code containing that same link.
- Resolve it. The wallet resolves the did:keri through a gateway (section 6) and obtains its mediators, published as
DIDCommMessagingservices (network, 6.1). - Check its identity. The wallet SHOULD check the identity credential that Almena Trust has published on the network about that entity, and SHOULD warn the person if it does not exist or is revoked.
- Choose the form published by the entity for what it needs (protocols).
- Create the relationship. The wallet MUST derive the did:peer:4 for this entity from the seed and the entity’s did:keri (cryptography, 5), and request its mailbox from its own mediators with Coordinate Mediation 3.0. The did:peer:4 document contains only keys; the mailbox is sent in the first message and updated with
mailbox-change(protocols). - Send the request, encrypted for the entity and citing the exact version of the form.
When it is the entity that takes the first step, it uses an out-of-band invitation (OOBI) carrying its did:keri; from there the process continues in the same way from step 2. At a counter it is the other way round: the person shows a QR code and the entity writes first (protocols).
4. Collecting messages
Section titled “4. Collecting messages”- The wallet collects its messages with Message Pickup 3.0, in its two modes:
- Batch: the wallet asks for pending messages and confirms the ones received.
- Live: while the connection is open, the node delivers messages as soon as they arrive.
- The wallet delivers its messages for the entity at the entity’s mediators, not in its own mailbox (see vision, 2.6).
Expiry. An uncollected message MUST be kept in the mailbox for at least 30 days and MAY be deleted afterwards. A collected message is deleted when its recipient confirms receipt.
sequenceDiagram
%% kinds: W=wallet MP=mediator PS=push ME=mediator E=entity
participant W as Wallet
participant MP as Person's mediator
participant PS as Wallet's push service
participant ME as Entity's mediator
participant E as Entity node
W->>MP: Coordinate Mediation: mailbox for this relationship (+ optional push URL)
MP-->>W: Mailbox
W->>ME: Request for the entity (encrypted end to end)
E->>ME: Collects with Message Pickup
E->>MP: Response for the person (encrypted end to end)
MP->>PS: Empty notice, signed by the mediator
PS->>W: Operating system notice: "there are messages"
W->>MP: Message Pickup: collects and confirms
MP->>MP: Deletes the confirmed message (uncollected: kept at least 30 days)5. Transport
Section titled “5. Transport”- A mediator node MUST offer HTTPS for sending and collecting messages.
- A mediator node SHOULD offer WebSocket over TLS for live collection while the wallet application is open.
- TLS connections SHOULD use a hybrid key exchange that combines ML-KEM-768 with X25519 or P-256. DIDComm content is already protected end to end (section 2); this also protects the metadata.
- The service URLs of an entity’s mediators are published in its DID document; those of a person’s mediators are only sent to the other party inside the relationship (first message and
mailbox-change).
6. Reading the network
Section titled “6. Reading the network”- The wallet MAY query the network’s information (entity DID documents, attestations, records) from any gateway.
- The wallet MUST ship with a bootstrap list with gateways from several operators, SHOULD update it from the node directory and SHOULD spread its queries and switch gateway if one fails (see network, 8).
- The query is REST over HTTPS in the style of HTTP DID resolution (DIF DID Resolution), for example
GET /1.0/identifiers/{did}. - Routes. Every node MUST offer these read-only routes:
| Route | Returns |
|---|---|
GET /1.0/identifiers/{did} |
An entity’s DID document, with its KEL. |
GET /1.0/directory?q=… |
Search results in the entity directory. An Archive Node resolves it; other nodes forward it. |
GET /1.0/directory/{did} |
An entity’s entry in the directory. |
GET /1.0/trust/{did} |
Almena Trust’s credentials about that entity. |
GET /1.0/forms/{did}/{formId}/{version} |
A specific form. |
GET /1.0/status/{listId} |
A revocation list (Token Status List). |
GET /1.0/records/{did}/{hash} |
An activity record. |
GET /1.0/info |
The versions the node supports and its complementary function (section 8). |
GET /1.0/nodes |
The node directory, including Mediator Nodes for random assignment. |
- Entities’ internal audit logs and mailboxes have no public route.
- The wallet MUST verify what it receives, by hash and signature (see network, 1.1). It does not trust the node that answers.
7. Notices of new messages (push)
Section titled “7. Notices of new messages (push)”A wallet on a mobile phone is not always connected. Waking it up requires an operating system notice. That external dependency is accepted (see vision, 2.9), limited to waking the wallet up.
- The notice is sent by the wallet’s push service, run by whoever publishes that wallet with an Almena Push Node (network, 6).
- When requesting the mailbox, the wallet MAY declare a push URL. It is RECOMMENDED (SHOULD) that it be an opaque URL, unique to each relationship, in the style of Web Push (RFC 8030), which already identifies the destination without revealing anything else.
- The wallet MUST only declare URLs of push services of its own publisher.
- The push URL is known only to the person’s mediators. When a message arrives in the mailbox, the mediator SHOULD send a notice to that URL.
- The entity does not see the push URL or know which wallet the person uses.
- The notice MUST be empty: it only means “there are messages”. It carries no content, sender or message type.
- The mediator node that hosts the mailbox MUST NOT know the operating system token. Only the wallet’s push service knows it.
- Against fake notices.
- When registering the URL, the wallet tells its push service which Mediator Node can use it. The service MUST only accept notices signed with that node’s key, in the style of VAPID in Web Push.
- The service SHOULD limit notices to one per mailbox and minute, and group any extra ones.
- If a mediator abuses it, the wallet withdraws its URL and the service invalidates it.
- Push is optional. A wallet without push is still conformant: it collects its messages when it is opened.
8. Version and capabilities
Section titled “8. Version and capabilities”Wallet and node announce the version and capabilities they support (principle P9):
- Version in the route. Routes carry the version (
/1.0/…). An incompatible change uses a new route (/2.0/…), and a node SHOULD keep serving the previous one during a transition period. - Information route. Every node MUST offer
GET /1.0/info, public and signed with the node’s key, with the versions it supports, the signature and encryption algorithms it supports and its complementary function if it has one. - Messaging. Wallet and mediator discover the DIDComm protocols the other supports with Discover Features 2.0.
9. Errors
Section titled “9. Errors”- Formats. Read routes return errors as HTTP Problem Details (RFC 9457). Messages use DIDComm v2 problem reports.
- A single catalogue of codes for both channels, in English (conventions, 6). The wallet translates the text for the person. The catalogue is versioned and can grow.
| Code | Meaning |
|---|---|
invalid_signature |
The signature is not valid. |
invalid_format |
The message or data does not have the expected format. |
not_found |
The data does not exist or was not found. |
unsupported_version |
The requested version is not supported (section 8). |
quota_exceeded |
The entity’s daily quota has been exceeded (network, 10). |
rate_limited |
Too many requests in a short time. |
mailbox_full |
The mailbox has reached its capacity. |
clock_skew |
The time deviates more than allowed (network, 6.2.3). |
form_version_inactive |
The form version is not the current one (protocols). |
nonce_invalid |
The one-time code has already been used or has expired. |
credential_revoked |
The credential is revoked. |
token_not_for_holder |
The token does not belong to whoever presents it. |
request_rejected |
The entity rejects the request; it MAY include a reason. |
unauthorized |
There is no valid console session for the requested operation. |
10. Entity console and entity node
Section titled “10. Entity console and entity node”The console is stateless (client): it keeps no keys or data and works through the management interface that every entity node offers.
- Finding the nodes. The console resolves the entity’s did:keri, reads in its KEL which nodes are bound to it and obtains their addresses from the node directory (network, 8.1). A node behind a Relay Node is reached through it.
- Sign-in. The sign-in QR code carries the console’s ephemeral session key and a temporary mailbox, which the console requests from a Mediator Node chosen at random and abandons at the end of the session. The wallet delivers there the presentation of the manager credential (protocols).
- Session. The console presents that presentation to the entity node, which MUST check it (signature of the entity, not revoked,
nonce, audience) and opens a session bound to the console’s session key. Each request of the console MUST be signed with that key. - Transport. HTTPS for requests and WebSocket over TLS for live changes, end-to-end encrypted between the console and the node, also through a Relay Node. The key agreement MUST be hybrid, ML-KEM-768 with X25519 or P-256 (cryptography).
- What it allows. Reading the entity’s data and preparing operations. The node MUST NOT execute an operation that requires approval until it has the managers’ signatures, which it requests from their wallets (protocols).
- Routes. The management routes carry the version, like the read routes (section 8), and have no public access: without a valid session the node answers
unauthorized. - Several nodes. The console talks to the entity’s active node (network, 6.4.1). If it does not respond, it tries the next in the binding order.
11. Security and privacy considerations
Section titled “11. Security and privacy considerations”- Content. The node cannot read the messages (end-to-end encryption).
- Metadata at the person’s mediator. It sees when and how much each mailbox is used, and the wallet’s IP address. It does not see the content, but it does see which mailboxes the same wallet collects from, so it could link the relationships it hosts. To limit this, the person hosts each relationship on only one of their 3 mediators, chosen at random (network, 6.1).
- Several relationships on the same mediator node. A mediator node can serve several entities. If the wallet collects the mailboxes of two relationships from the same IP and at the same time, that node could deduce that the two did:peer belong to the same person, which would break F2. That is why the wallet MUST use a separate connection per mailbox and SHOULD NOT synchronize in time the collection of different mailboxes (for example, with random delays). Anonymity towards the network (for example, with a network relay) is out of v2026-12-beta.
- Reading the network. The queried node knows which entity DIDs are queried. The wallet SHOULD spread its queries across nodes or use a cache so as not to reveal which entities it deals with.
- Push. An opaque push URL that differs per relationship prevents two entities from correlating the person through it. The push service does know that the wallet has several relationships and when it receives messages, but not with whom or what. The person places that trust when choosing the wallet.
- Quantum computer. Message content uses hybrid encryption, so storing it now does not allow it to be decrypted later. The exceptions are the first message at the counter and the sign-in presentation, which carry nothing secret (cryptography).
- Console. It keeps nothing after the session, so a lost or shared computer exposes no keys or entity data. What the entity can do is limited by the approvals, which are always signed in the managers’ wallets.
- Wallet brand. The push URL is known only to the person’s mediators, not to entities. It reveals which push service, and therefore which wallet brand, the person uses. It is minor metadata; it can be mitigated with a neutral domain or a push service shared among several wallets.
12. Open questions
Section titled “12. Open questions”None for now.