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/.
First contact
Section titled “First contact”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.
- 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.
- 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.createdrecord (network, 7.1.1). - 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.
- Acknowledgement of receipt. On receiving a request, the entity SHOULD automatically respond with a received message. The wallet shows the request as pending.
- 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.
- Cancellation. The person MAY cancel a pending request. The wallet sends a cancellation message and the entity stops processing it.
- No acknowledgement. If the acknowledgement does not arrive within 24 hours, the wallet SHOULD warn the person that the entity has not replied.
sequenceDiagram
%% kinds: W=wallet E=entity
actor P as Person
participant W as Wallet
participant E as Entity
P->>W: Opens the invitation (almena:// link or QR) or the entity directory
W->>W: Checks the entity's identity (Almena Trust)
W->>P: Shows the form, the data requested and its purpose
P->>W: Fills in and approves
W->>E: request (full did:peer:4, mailbox, form version, fields, attachments, signature)
E-->>W: ack ("received")
W->>P: Request pending
opt The person cancels
W->>E: cancel
end
alt The entity responds
E->>W: issue / result, or problem report request_rejected
Note over E: Writes relationship.created and attaches the receipt
else No ack within 24 h
W->>P: Warns that the entity has not replied (no relationship, no record)
endOne relationship per entity.
- 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.createdis written. - Subsequent requests use that relationship with the same flow: form, acknowledgement and response.
- 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. - 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.
- 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.
stateDiagram-v2
direction TB
[*] --> Requested: first request
Requested --> [*]: no response or cancelled (no relationship)
Requested --> Active: the entity responds (credential or rejection) / relationship.created
Active --> Active: new requests reuse the relationship
Active --> Ended: close / relationship.ended
Ended --> Active: the person comes back (same did:peer:4) / relationship.createdInvitation by the entity.
- 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. - 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.
- 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.
Exchange
Section titled “Exchange”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:
- The entity requests it within a relationship that already exists: it sends what it needs (DCQL), what it needs it for and the code.
- The holder starts it from a form. If the form does not ask for credentials, the holder’s
requestis already complete. If it does, the holder sends arequestwithout presentations and the entity automatically responds with apresentation-requestthat carries the code; the holder then sends its completerequest. 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.
sequenceDiagram
%% kinds: H=wallet E=entity
actor P as Person
participant H as Holder (wallet)
participant E as Entity
alt The entity starts it (existing relationship)
E->>H: presentation-request (form, nonce, nonce_expires) in a new thread
else The holder starts it from a form that asks for credentials
H->>E: request without presentations
E-->>H: presentation-request (form, nonce, nonce_expires) in the same thread
end
H->>P: Shows exactly which data will be shared and why
P->>H: Approves
H->>E: request (only the necessary data, Key Binding JWT with nonce and audience)
E-->>H: ack ("received")
alt Issuance
E->>H: issue (credentials + receipt of credential.issued)
else Verification
E->>H: result (accepted + receipt of presentation.verified)
else Not accepted
E->>H: problem report request_rejected
endHolder profile: person or entity. In an exchange, both a person and an entity act with a holder profile, with the same flow.
- 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.
- 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.
- 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.
- 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).
- 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).
- 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.
sequenceDiagram
%% kinds: W=wallet E=entity
actor P as Person
participant W as Wallet
actor M as Manager (console)
participant E as Entity node
W->>P: Shows a QR with a one-time contact code (temporary key + mailbox, expires in minutes)
M->>W: Scans the QR from the entity console
M->>E: The console hands over the contact code
E->>W: First message, addressed to the contact code
W->>W: Checks the entity's identity (Almena Trust)
W->>P: Shows who the entity is
alt The person accepts
W->>E: Answers with its stable did:peer:4 for this entity
W->>W: Discards the contact code
Note over E: Writes relationship.created (unless the relationship already existed)
Note over W,E: The exchange follows the normal flow
else The person rejects
W->>W: Discards the contact code (no relationship)
endWithout an Internet connection there is no exchange in v2026-12-beta.
After a verification.
- Only the
presentation.verifiedrecord remains on the network: operation code, time and salted hash, with no data about the person. - The person receives a receipt with that record.
- 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.
Authorization token
Section titled “Authorization token”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.
- The merchant asks the person for a means of payment, with the verification flow.
- 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.
- 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.
- The bank issues the token (record
token.issued). - 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).
sequenceDiagram
%% kinds: W=wallet C=entity B=entity
actor P as Person
participant W as Wallet
participant C as Merchant
participant B as Bank
C->>W: presentation-request: a means of payment
W->>P: Shows the person's bank credentials
P->>W: Chooses one (it is not sent to the merchant)
W->>P: Shows the charge permission for this merchant
P->>W: Approves
W->>B: token-request (merchant did:keri, chosen credential, optional end date)
B->>W: issue (token + receipt of token.issued + permission reference)
W->>C: request carrying the token
Note over C,B: Later, to collect
C->>B: token-redeem (token, amount, concept)
B->>C: result + receipt of token.redeemed (or request_rejected)Permission, expiry and renewal.
- 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).
- 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. - 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).
sequenceDiagram
%% kinds: W=wallet C=entity B=entity
participant W as Wallet
participant C as Merchant
participant B as Bank
Note over C,B: Renewal, before the token expires
C->>B: token-renew (current token)
alt The permission is still in force
B->>C: issue (new token) and records token.issued
else The permission was revoked or ended
B->>C: problem report credential_revoked
end
Note over W,B: Revocation by the person
W->>B: token-revoke (permission reference)
B->>W: ack + receipt of token.revoked
Note over B: Publishes the revocation in its status list
Note over C,B: Revocation by the bank
B->>W: revoke-notice + receipt of token.revokedRecords and receipts
Section titled “Records and receipts”How records are stored on the network is in network, section 7. What the person receives and sees is defined here.
The receipt.
- 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.
- 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).
- 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”).
- 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).
sequenceDiagram
%% kinds: W=wallet E=entity N=network
participant W as Wallet
participant E as Entity
participant N as Network
E->>E: Writes and signs the record (code, UTC time, salted commitment)
E->>N: Publishes the record
E->>W: Response message with the receipt (signed record, salt, details)
W->>W: Stores the receipt in the relationship's history
Note over W: After 24 hours
W->>N: Is the record published?
alt Published
N-->>W: Yes
else Not published
W->>N: Publishes the record itself (the entity's signature makes it valid)
endWho 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.
- 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. - 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.
- 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). - 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. - 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
vcttype.
Form document. A form contains:
- Identity: the entity (did:keri), the exchange type (issuance or presentation), the credential type (
vctand its version), the form version and the publication date. - Texts: a title and a description, translated with BCP 47 tags, and a default language for when the person’s language is not available.
- 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.
- Credentials requested: the DCQL query, if the form asks for credentials.
- Indicative deadline (MAY).
- Signature of the entity with a current key of its KEL.
Active versions.
- 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.
- The credential type (
vct) is also versioned. Old versions do not lose validity: they are simply different versions. - 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.
- 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.
- 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).
Entity management
Section titled “Entity management”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.
- The sign-in QR code carries an out-of-band
presentation-requestfor thealmena.managercredential, with thenonce, its expiry, the console’s ephemeral session key and the temporary mailbox where to reply. - The wallet answers with a
requestthat carries the presentation of each chosen manager credential, encrypted for the session key. The Key Binding JWT carries thenonceand, as audience, the session key. - The console opens a session with each entity node, which checks the presentation again (interface, 10).
- Signing in writes no activity record: it goes to the entity’s internal audit log.
- Creation mode. To create a new entity, the QR code asks for no credential and the wallet answers with a
requestwithout presentations, only to open the session (client).
sequenceDiagram
%% kinds: W=wallet C=console N=entity
actor P as Manager
participant W as Wallet (mobile)
participant C as Entity console
participant N as Entity node
C->>C: Generates an ephemeral session key and asks a mediator for a temporary mailbox
C->>P: Shows the sign-in QR (presentation-request, nonce, session key, mailbox)
P->>W: Scans the QR
W->>P: Shows the entities the person can manage
P->>W: Chooses one or several and approves
W->>C: request: manager credential presentations (nonce, audience = session key)
C->>C: Checks each presentation
C->>N: Opens a session with the presentation
N->>N: Checks it again and records the sign-in in the audit log
N-->>C: Session open
Note over C,N: The console reads and prepares. It keeps nothing when the session ends.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).
- The entity node sends an
approval-requestto the wallet of each manager who must approve. - The wallet shows the manager the entity, the operation and its consequences, and asks for local user verification.
- The manager answers with an
approvalsigned with their manager key, or rejects it. - With enough approvals, the entity node executes the operation (for a KEL event, it publishes it) and records it in the internal audit log.
sequenceDiagram
%% kinds: C=console N=entity W1=wallet W2=wallet
participant C as Entity console
participant N as Entity node
participant W1 as Manager 1 wallet
participant W2 as Manager 2 wallet
C->>N: Prepares an operation (for example, publishing a form)
N->>W1: approval-request (operation, what it changes, deadline)
N->>W2: approval-request (operation, what it changes, deadline)
W1->>N: approval, signed with the manager key
W2->>N: approval, signed with the manager key
alt Threshold reached
N->>N: Executes the operation (a KEL event is published on the network)
N->>N: Records it in the internal audit log
N-->>C: Operation done
else Rejected or deadline passed
N-->>C: Operation not done
endEnding 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.
Message catalogue
Section titled “Message catalogue”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. |
Common header
Section titled “Common header”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).
Fields of request
Section titled “Fields of request”| 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. |
Fields of presentation-request
Section titled “Fields of presentation-request”| 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.
Fields of issue and result
Section titled “Fields of issue and result”issue(issuance response): the credentials (10 copies for a person, each bound to one of the keys sent in therequest, 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 thecredential.issuedrecord, and a reference to the issuance that the wallet later uses inrefill.result(verification response): the result (accepted) and the receipt of thepresentation.verifiedrecord.
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.
Fields of the simpler messages
Section titled “Fields of the simpler messages”ack: only the thread (thid) of therequestit confirms. It MAY carry an estimated response time, which is indicative only.cancel: only the thread of therequestbeing withdrawn. If the entity has already responded, it answers with a problem report.close: an optional reason. The entity is responsible for therelationship.endedrecord. If the person closes, the entity confirms with anackthat carries the receipt. If the entity closes, the receipt goes in thecloseitself.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.refill: which credential is being refilled (a reference to the original issuance) and 10 new public holder keys. The issuer responds with anissue: a new batch of the same credential, with the same status and expiry. It generates no new record, because it is the same credential.
Fields of the token messages
Section titled “Fields of the token messages”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 anissuethat carries the token, the receipt oftoken.issuedand a reference to the permission.- Delivery to the merchant: no new message. The wallet sends the token inside the
requestwith 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, thatcnfis its own did:keri and that it is not revoked. Possession is proven when collecting:token-redeemis signed by the merchant’s did:keri. Other credentials in the samerequestkeep their Key Binding JWT with the nonce. token-revoke(wallet → bank): the reference to the permission. The bank confirms with anackthat carries the receipt oftoken.revoked.token-renew(merchant → bank): the current token. The bank responds with anissuecarrying the new token. If the permission is no longer in force, it responds with a problem reportcredential_revoked.token-redeem(merchant → bank): the token, the amount and the concept of the charge. The bank responds with aresultand the receipt oftoken.redeemed, or rejects it withrequest_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 (sameid).
Fields of revoke-notice
Section titled “Fields of revoke-notice”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.
Fields of incident-notice
Section titled “Fields of incident-notice”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).
Fields of the management messages
Section titled “Fields of the management messages”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.approval(manager → entity): the thread of theapproval-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.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.
Security and privacy considerations
Section titled “Security and privacy considerations”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 messageid. A copied message is worth nothing to anyone else. - Threads. A wallet SHOULD ignore a response whose
thiddoes 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.
Open questions
Section titled “Open questions”None for now.