Skip to content
Almena Network— version v2026-12-beta
Auto
English

Protocols between participants

This document specifies the messages that participants exchange (persons and entities) within their relationships, regardless of how they are transported. They are implemented by whoever acts as a participant: the wallet on behalf of a person and, on behalf of an entity, its entity node (network, 6.4).

v2026-12-beta content:

  • First contact: normally started by the holder, from the public entity directory or from a link or QR code (interface, 3.1).
  • Forms: the public, versioned definition with which an entity describes what it asks for or what it offers.
  • Exchange: a single flow for issuance and verification (vision, 4.1).
  • Authorization token: issuance, redemption between entities, expiry, renewal and revocation (UC-01).
  • Records and receipts: what the person receives when an operation is recorded on the network (network, section 7).
  • Entity management: the manager credential, signing in to the entity console and the managers’ approvals (client).

Candidates to adopt or adapt: Issue Credential 3.0 and Present Proof 3.0 (DIDComm), with SD-JWT VC credentials.

A complete case with every message written out, and test vectors, is in Example: payment with a token.

A document in protocols/ MUST NOT depend on node/ or client/.

The steps to find the entity, check its identity and choose the form are in the interface, 3.1. The messages are defined here.

No prior handshake. There is no prior exchange to create the connection: the relationship is born with the first message, which is already the form request.

  1. The first message MUST carry the person’s full did:peer:4 and their mailbox (so that the entity can reply), the reference to the form version, the filled-in fields, the attachments and the person’s signature.
  2. The relationship exists from the moment the entity responds, with the credential or with a rejection. At that moment the entity MUST write the relationship.created record (network, 7.1.1).
  3. If the entity does not respond, there is no relationship and no record, and the wallet SHOULD tell the person.

While it is being processed.

  1. Acknowledgement of receipt. On receiving a request, the entity SHOULD automatically respond with a received message. The wallet shows the request as pending.
  2. No imposed deadline. How long it takes to resolve is up to the entity (P10). A form MAY state an indicative deadline, which the wallet shows the person.
  3. Cancellation. The person MAY cancel a pending request. The wallet sends a cancellation message and the entity stops processing it.
  4. No acknowledgement. If the acknowledgement does not arrive within 24 hours, the wallet SHOULD warn the person that the entity has not replied.
First contact: the relationship is born with the first request

One relationship per entity.

  1. If the person already has a relationship with the entity, the wallet MUST reuse it (same did:peer:4 and same mailbox). No other is created and no new relationship.created is written.
  2. Subsequent requests use that relationship with the same flow: form, acknowledgement and response.
  3. Closing. Either party MAY end the relationship with a closing message, and the entity MUST write relationship.ended. Credentials already issued do not change: only revocation invalidates them.
  4. If the person comes back after a closing, they start a new relationship with the same did:peer:4, because it is always the same for each entity. The entity can therefore link the old and the new history; this is accepted.
  5. Stable identifier. A person’s did:peer:4 with a given entity is always the same: the wallet derives it from the seed and the entity’s did:keri (cryptography, 5). Different entities always get different identifiers, so F2 still holds between entities.
Life cycle of a person–entity relationship

Invitation by the entity.

  1. The invitation is an almena:// link (or a QR code containing it) with the entity’s did:keri and, optionally, the specific form it offers. It is the out-of-band invitation (OOBI) of the interface, 3.1.
  2. The person always sends the first message. The wallet follows the normal flow: it checks the entity, shows the form and the person decides whether to send it.
  3. An entity cannot write to a person with whom it has no relationship, because it does not know any of their mailboxes. That way the person controls who gets into their wallet. The only exception is the QR code the person themself shows at a counter (next section), which is their express consent.

A single flow for issuance and verification. In both cases the holder (person or entity) proves something to an entity. The difference is only in the consequence:

  • Issuance: the entity asserts something new of which it is the source (relying on the form data, on documents or on the presentation of another credential) and responds with a credential or with a rejection.
  • Verification: the entity asserts nothing new: it only checks credentials from others (authentic, bound to the holder and not revoked) and responds with a result (accepted or rejected). No credential is generated; the verification generates its record (presentation.verified).

The flow is the same: form → signed request → acknowledgement → response. Only the type of response changes.

How it starts and one-time code. So that a presentation cannot be copied and reused, the entity MUST provide a one-time code (nonce), which the presentation includes in its Key Binding JWT together with the audience (the entity). There are two ways to start:

  1. The entity requests it within a relationship that already exists: it sends what it needs (DCQL), what it needs it for and the code.
  2. The holder starts it from a form. If the form does not ask for credentials, the holder’s request is already complete. If it does, the holder sends a request without presentations and the entity automatically responds with a presentation-request that carries the code; the holder then sends its complete request. The flow is therefore always the same, and the acknowledgement only means “received”.

In both cases the wallet shows the person what is requested and why, the person accepts, and the wallet sends only the necessary data (selective disclosure or predicate), signed with the holder key in the chip.

Exchange: one flow for issuance and verification

Holder profile: person or entity. In an exchange, both a person and an entity act with a holder profile, with the same flow.

  1. Person with several devices. Their relationships and their mailbox are the same on all of them, because the seed is synchronized. The copies of their credentials belong to each device: each one has its holder keys in its chip and requests its own copies from the issuer automatically (client). The person can present from any device that has copies.
  2. Entity as holder. Its credentials live in its entity store, handled by its entity node, not on its managers’ devices or on the console. They are bound to its did:keri (a key of its own, kept by the entity node), without batches of copies, because an entity is public and does not need its presentations to be unlinkable. The managers only approve, from their wallets, according to the approval flow the entity has configured (a specific manager or joint signatures).

In person, at a counter. Here the direction is reversed: the person shows a QR code in their wallet and a manager of the entity scans it.

  1. The QR code carries a single-use contact code (a temporary key and a mailbox), not the relationship identifier, because the wallet does not yet know which entity will scan it. It expires after a few minutes. Showing it is the person’s consent for that entity to write to them.
  2. The manager scans it with the computer’s camera from the entity console, signed in to the entity they represent, and the entity node sends its first message to that contact code. The QR code only carries a P-256 key, so that first message MUST NOT carry personal data: only the entity’s did:keri and the invitation to continue. Everything is hybrid from the wallet’s reply onwards (cryptography).
  3. The wallet checks the entity’s identity (Almena Trust) and shows the person who it is; the person MAY reject it. If the person accepts, the wallet answers with its stable did:peer:4 for that entity and discards the contact code. If a relationship already existed, it continues (one relationship per entity).
  4. If there was no relationship, it exists when the person accepts, and at that moment the entity writes relationship.created; if it already existed, no new record is written. From there the exchange follows the normal flow.
In person, at a counter: the person shows a QR code

Without an Internet connection there is no exchange in v2026-12-beta.

After a verification.

  1. Only the presentation.verified record remains on the network: operation code, time and salted hash, with no data about the person.
  2. The person receives a receipt with that record.
  3. The entity SHOULD NOT keep a copy of the presented data beyond what its declared purpose requires (F3). If the law obliges it to keep them, that is its responsibility (P10).

Informed consent. In every form, for issuance or verification, the wallet MUST show the person exactly which of their data will be shared (and why) before they approve or reject the operation. Without that express approval nothing is sent.

Use case: UC-01, payment without sharing the bank account.

What it is. The token is a verifiable credential of a special type. It is issued by the bank and its holder is the merchant: it is bound to the merchant’s did:keri and only that merchant can use it. It does not carry the account, only an opaque reference that only the bank understands, and its expiry. It has no amount or frequency limits. It reuses the format, revocation, records and flow of the exchange.

Flow.

  1. The merchant asks the person for a means of payment, with the verification flow.
  2. The wallet shows the person’s bank credentials and the person chooses one. That credential is not sent to the merchant: it only indicates which bank to ask for the token.
  3. The wallet asks that bank, through the relationship they already have, for a token for that merchant. The person sees and approves the charge permission for that merchant.
  4. The bank issues the token (record token.issued).
  5. The wallet delivers it to the merchant as the response to its request. The merchant presents it to the bank to collect payment (record token.redeemed).
Authorization token: payment without sharing the bank account

Permission, expiry and renewal.

  1. A distinction is made between the person’s permission, which lasts until the person or the bank revokes it or until the date the person chooses, and the token, which expires soon (for example, 30 days; value to be set in testing).
  2. The merchant renews it, asking the bank through their relationship between entities. If the permission is still in force, the bank issues a new token without the person’s intervention. Each renewal is recorded as token.issued.
  3. The wallet MUST show the person their active permissions (merchant and bank), from where they can revoke any of them.

Privacy. The token carries nothing about the person: neither their name nor their identifier with the bank, only a random reference that is different in each token. The merchant cannot link it to anything. The bank knows which merchant the person authorizes, because it needs that to collect, and nothing more.

Revocation. The token can be revoked at any time by the bank and by the person (from their wallet, which asks the bank). The revocation is published in the bank’s status list and recorded (token.revoked).

Token renewal and revocation

How records are stored on the network is in network, section 7. What the person receives and sees is defined here.

The receipt.

  1. Each time an entity writes a record (creation or closing of a relationship, issuance, verification, token…), it MUST attach the signed record to the same message with which it responds. No separate message is needed.
  2. The wallet stores it and, after 24 hours, checks that it is published on the network. If it is not, the wallet publishes it (network, 7.3).
  3. The wallet MUST show the person a history of each relationship in plain language (for example, “3 December, 10:15: the bank issued your account credential”).
  4. The person MAY hand a receipt to whomever they want (for example, an auditor or a judge) to prove an operation. Only with that receipt can a third party link the record to the person (F2).
Records and receipts: the wallet makes sure the record is published

Who writes each record. The entity responsible for the operation records it, and the other party receives the receipt.

Operation Records it Receives the receipt
Creation or closing of a relationship The entity The person, or the other entity
Issuance or revocation of a credential The issuer The holder
Verification The verifier The holder
Issuance, renewal and revocation of a token The bank The person (and the merchant, if it renews)
Redemption of the token The bank The merchant

When the person acts (for example, when revoking a token or closing a relationship), they request it and the entity records it. The person never writes records: they only publish a receipt if the entity did not.

Entities design, publish and version forms. A form is the public definition of an exchange that the entity offers, and holders consume it to:

  • request a verifiable credential from the entity (issuance), or
  • prove something to the entity (presentation).

It can be consumed by person holders (from their wallet) and entity holders.

Content: see “Format and request flow” below. Each form declares the purpose of each piece of data it asks for, so that the wallet can show it and warn if it asks for more than necessary (F4), and its presentation texts are translated with BCP 47 tags; codes remain in English.

Publication and versioning:

  • Each version of a form is immutable network content, identified by its hash (network, 1.1), and is signed by the entity with the keys of its KEL.
  • A published version does not change: a change generates a new version. That way a holder knows exactly what they accepted.
  • Every exchange request MUST refer to the specific version of the form it uses.

Issuer competence. Almena verifies the identity of an entity (with the credential Almena Trust publishes on the network), but does not guarantee that it is competent to issue a specific type of credential. Deciding whether to trust that issuer for that data is up to whoever receives the credential.

Self-provisioning. Each entity defines its own credential types and the forms a person fills in to request them. It does not need anyone’s permission to do so.

Field catalogue. So that each entity does not have to invent its fields, the platform offers a catalogue of predefined, reusable field types, based on standards whenever they exist (for example, the country according to ISO 3166). The catalogue is part of Almena’s published standard. A form SHOULD use a catalogue field when a suitable one exists, and MAY define its own fields when not. Almena is global, so the v2026-12-beta catalogue is based only on global standards:

  • Basic types, for custom fields: text, number, date (ISO 8601), yes/no and closed list of options.
  • Predefined fields: country and nationality (ISO 3166-1), region (ISO 3166-2), language (BCP 47), currency (ISO 4217), sex (ISO/IEC 5218), telephone (E.164), email, given name, family name, date of birth and postal address (OpenID Connect claim names), identity document (type, number and issuing country), bank account (IBAN, ISO 13616) and age predicates (age_over_NN).
  • Codes are in English; labels are translated, for example with Unicode CLDR for country, language and currency names.
  • The catalogue is versioned and can grow.

Future: optional regional profiles (for example, the European PID or the SEMIC vocabularies) that each entity can choose as a source, because what is European need not serve in other regions. The sources are chosen by the entity that defines the credential, not by the person.

Format and request flow.

  1. The form. It is a JSON document signed by the entity, with the type of exchange (issuance or presentation), the credential type (vct), the version and the list of fields. Each field is from the catalogue or custom, and carries its declared purpose. A field MAY be an attached document (for example, a copy of a degree certificate), with the formats and maximum size the entity specifies.
  2. The request. The person fills in the form in their wallet, signs it and sends it via DIDComm to the entity’s mailbox. Attachments travel inside the same encrypted message.
  3. The response. The entity processes the request and responds with a rejection, which MAY include the reason, or with the credential, issued in batches of copies (see vision, 5.2). Issuance generates its record on the network (credential.issued).
  4. Credential content. The entity defines the credential’s information. In addition, every credential MUST include the network’s own fields, required by the very concept of a verifiable credential: issuer (iss, its did:keri), issuance date (iat), type (vct), holder key (cnf) and revocation reference (status). Expiry (exp) is OPTIONAL and decided by the entity.
  5. Presentations. What a presentation form asks for is expressed with DCQL (the OpenID4VP query language), and its presentation in the wallet comes from the metadata of the vct type.

Form document. A form contains:

  1. Identity: the entity (did:keri), the exchange type (issuance or presentation), the credential type (vct and its version), the form version and the publication date.
  2. Texts: a title and a description, translated with BCP 47 tags, and a default language for when the person’s language is not available.
  3. Fields: a list. Each field carries a code; its origin (a catalogue field, with the catalogue version, or a basic type); whether it is required; its purpose, translated; and its label, translated (catalogue fields take the label from the catalogue). A closed list carries its options; an attachment carries the accepted formats and the maximum size.
  4. Credentials requested: the DCQL query, if the form asks for credentials.
  5. Indicative deadline (MAY).
  6. Signature of the entity with a current key of its KEL.

Active versions.

  1. For each credential type, an entity has a single active version of the request form. Publishing a new version deactivates the previous one. New requests MUST use the active version; those already sent with the previous one are processed with the version they used.
  2. The credential type (vct) is also versioned. Old versions do not lose validity: they are simply different versions.
  3. Whether a credential is in force is decided only by its revocation (and its expiry, if the entity set one), not by the version of its type or its form.

Where they are listed and who approves them.

  1. An entity’s forms are listed in its entry in the public entity directory: for each credential type, the active version of its form. They do not go in the KEL, which is only for keys.
  2. Publishing or changing a form, or a version of a credential type, follows the approval flow the entity has configured (a specific manager or joint signatures; see client). Responsibility lies with the managers, and the approval is kept in the entity’s internal audit log (network, section 7).

How the entity console and the managers’ wallets work is in the client. The messages are defined here.

Manager credential. The entity issues it with the normal issuance flow, over its relationship with the person: it is a credential of type almena.manager that carries the entity, the manager’s public keys for that entity and, optionally, a name or role. It is issued in a single copy per device, bound to a holder key in that device’s secure chip. Removing a manager revokes it (credential.revoked).

Signing in to the console. It is a verification in which the console acts as verifier on behalf of the entity. The console has no relationship with the person, so the request travels in the QR code, as in the counter, in the opposite direction.

  1. The sign-in QR code carries an out-of-band presentation-request for the almena.manager credential, with the nonce, its expiry, the console’s ephemeral session key and the temporary mailbox where to reply.
  2. The wallet answers with a request that carries the presentation of each chosen manager credential, encrypted for the session key. The Key Binding JWT carries the nonce and, as audience, the session key.
  3. The console opens a session with each entity node, which checks the presentation again (interface, 10).
  4. Signing in writes no activity record: it goes to the entity’s internal audit log.
  5. Creation mode. To create a new entity, the QR code asks for no credential and the wallet answers with a request without presentations, only to open the session (client).
Signing in to the entity console with the wallet

Approvals. The console only prepares operations. The entity node asks for the managers’ signatures over their relationship with the entity, and executes the operation when it reaches the threshold of the approval flow (or of the KEL, for a KEL event).

  1. The entity node sends an approval-request to the wallet of each manager who must approve.
  2. The wallet shows the manager the entity, the operation and its consequences, and asks for local user verification.
  3. The manager answers with an approval signed with their manager key, or rejects it.
  4. With enough approvals, the entity node executes the operation (for a KEL event, it publishes it) and records it in the internal audit log.
Approval of an operation from the managers' wallets

Ending a session from the wallet. The wallet MAY end any active console session with a session-end sent to the entity, which closes it at once.

All messages travel as DIDComm v2 messages inside the relationship (pairwise did:peer:4 on the person side, did:keri on the entity side).

Group Message Sender → recipient Purpose
Exchange request holder → entity Signed form request that starts an issuance or a verification.
Exchange presentation-request entity → holder The entity starts a verification and sends the form plus its nonce.
Exchange ack entity → holder “Received”: confirms the request. It carries no nonce.
Exchange issue entity → holder Issuance response: the credential (in batches for persons) and the record receipt.
Exchange result entity → holder Verification response: the result and the record receipt; no credential.
Exchange cancel holder → entity The holder withdraws a pending request.
Relationship close either party Ends the relationship (relationship.ended).
Relationship mailbox-change either party Announces a new mailbox (mediator) for the relationship.
Credentials refill wallet → issuer Asks for a new batch of copies of a credential already issued.
Token token-request wallet → bank Asks the bank to issue a token for a specific merchant.
Token token-revoke wallet → bank The person revokes the permission behind a token.
Token token-renew merchant → bank The merchant renews a token before it expires.
Token token-redeem merchant → bank The merchant redeems the token.
Notices revoke-notice entity → holder The entity revoked a credential or a token on its own initiative.
Notices incident-notice entity → holder After an incident, the entity offers new copies and the holder asks for them (incidents).
Management approval-request entity → manager Asks a manager to approve an operation of the entity.
Management approval manager → entity The manager approves or rejects the operation, signed with their manager key.
Management session-end manager → entity Ends an active console session.

Every message carries the standard DIDComm v2 header: id (unique), type (Almena message type and its version, as in the registries, 2), from, to, created_time and thid (thread identifier that links a request, its ack and its response).

Field Required Content
form MUST The entity, the credential type (vct) and the form version.
fields MUST The value of each field of the form.
mailbox first message of a relationship The person’s mailbox address (it is not in the did:peer:4 document).
attachments MAY Documents, if the form asks for them (DIDComm attachments).
holder_keys issuance to a person The 10 public holder keys, one per copy of the batch (a single one for a manager credential, which has one copy per device).
presentations if the form asks for credentials The presentations (only the necessary data), each with its Key Binding JWT including the entity’s nonce.
Field Required Content
form MUST The entity, the credential type and the form version. The form already states the credentials it asks for (DCQL) and the purpose of each piece of data, so they are not repeated.
nonce MUST The one-time code.
nonce_expires MUST Until when the code is valid. After that the entity responds nonce_invalid.

If it answers a holder’s request, it goes in the same thread (thid). If the entity starts it, it opens a new thread.

  1. issue (issuance response): the credentials (10 copies for a person, each bound to one of the keys sent in the request, in the same order; a single copy for a manager credential; for an entity, a single copy bound to its did:keri), the receipt of the credential.issued record, and a reference to the issuance that the wallet later uses in refill.
  2. result (verification response): the result (accepted) and the receipt of the presentation.verified record.

If the entity does not accept, in an issuance or in a verification, it responds with a problem report with the code request_rejected and an optional reason. result therefore only carries positive answers, and rejection works the same way in both cases.

Receipts in a response. Every response that carries receipts (issue, result, ack, close, revoke-notice) puts them in a receipts list, because the first response of a relationship carries two: relationship.created and that of the operation.

  1. ack: only the thread (thid) of the request it confirms. It MAY carry an estimated response time, which is indicative only.
  2. cancel: only the thread of the request being withdrawn. If the entity has already responded, it answers with a problem report.
  3. close: an optional reason. The entity is responsible for the relationship.ended record. If the person closes, the entity confirms with an ack that carries the receipt. If the entity closes, the receipt goes in the close itself.
  4. mailbox-change: the new mailbox address and the moment from which it applies. The old mailbox is kept until it is empty, for 30 days at most.
  5. refill: which credential is being refilled (a reference to the original issuance) and 10 new public holder keys. The issuer responds with an issue: a new batch of the same credential, with the same status and expiry. It generates no new record, because it is the same credential.
  1. token-request (wallet → bank): the merchant (its did:keri), the bank credential the person chose and, if the person wishes, an end date for the permission. The bank responds with an issue that carries the token, the receipt of token.issued and a reference to the permission.
  2. Delivery to the merchant: no new message. The wallet sends the token inside the request with which it answers the merchant’s request for a means of payment. The token travels without a Key Binding JWT, because its holder is the merchant, and the nonce does not apply to it. The merchant MUST check the bank’s signature, that the type is the token type, that cnf is its own did:keri and that it is not revoked. Possession is proven when collecting: token-redeem is signed by the merchant’s did:keri. Other credentials in the same request keep their Key Binding JWT with the nonce.
  3. token-revoke (wallet → bank): the reference to the permission. The bank confirms with an ack that carries the receipt of token.revoked.
  4. token-renew (merchant → bank): the current token. The bank responds with an issue carrying the new token. If the permission is no longer in force, it responds with a problem report credential_revoked.
  5. token-redeem (merchant → bank): the token, the amount and the concept of the charge. The bank responds with a result and the receipt of token.redeemed, or rejects it with request_rejected. How the payment is executed is the bank’s business (P10). No nonce is needed: the message is signed by the merchant’s did:keri, and the bank MUST reject a message it has already received (same id).

What was revoked (the reference to the issuance or to the token permission), an optional reason and the receipt of credential.revoked or token.revoked.

The reference to the incident notice published on the network and the list of issuances the entity reissues for that holder. The wallet responds with a refill for each one; an entity holder with a token, with token-renew (incidents, 2).

  1. approval-request (entity → manager): the operation (type and content, for example the form version or the KEL event to sign), a description in plain language of what it changes, who else has to approve and until when it can be approved.
  2. approval (manager → entity): the thread of the approval-request, the decision (approve or reject) and, if it approves, the signature with their manager key over the operation. For a KEL event, the signature is the one KERI requires for that event.
  3. session-end (manager → entity): the console session to end (the session key it used).

Console sign-in uses the out-of-band presentation-request and request messages of the exchange, with the additional fields of the console’s session key and temporary mailbox.

Standard DIDComm v2 messages are also used: problem report (errors, with the codes in interface, section 9), Discover Features 2.0 and Out-of-Band (invitations). A rejection is sent as a problem report with the code request_rejected.

The general view is in the threat model.

  • Replay. A presentation is tied to the entity’s nonce and audience; a token-redeem, to its message id. A copied message is worth nothing to anyone else.
  • Threads. A wallet SHOULD ignore a response whose thid does not match a request it has pending, so that nobody can slip in an unrequested credential or result.
  • Forms that change. Each request refers to an immutable, signed version of the form, so the entity cannot change afterwards what the person accepted.
  • Attachments. They are untrusted content for whoever receives them. The entity SHOULD treat them as such (for example, checking their format before opening them).
  • Stable identifier. Because the did:peer:4 is always the same for each entity, the entity can link a person’s history after a closing and a return. This is accepted; it does not affect F2 between entities.
  • Handing over a receipt. Whoever receives a receipt with its salt learns that operation and its parties. The person SHOULD hand it only to whoever needs it.
  • Counter. The entity’s first message to a contact code carries no personal data, and the code is single-use.
  • Token. The merchant learns nothing about the person from the token. The bank learns which merchants the person authorizes, because it needs that to collect.

None for now.