Getting started
This page helps you pick the right Yivi protocol for your use case, and points you to the setup guide for that path. Before you start, install the Yivi app (Android, iOS) on your phone.
Choose your protocol
Yivi is a crypto agile wallet: it speaks both Yivi's own privacy-preserving IRMA protocol and the EUDI-aligned OpenID4VP / OpenID4VCI standards. Which one to use depends on what matters most for your use case.
Verification (asking users for attributes)
| Use case | Recommended protocol |
|---|---|
| Privacy-preserving scenarios — age verification, digital voting, anonymous attestations, attribute-based signatures, anything where sessions must not be linkable to the same user | IRMA — Idemix gives you issuer unlinkability and relying-party unlinkability out of the box. OpenID4VP does not support attribute-based signatures. |
| Maximum interoperability — accepting credentials from any EUDI-compliant wallet, or integrating with EU/national identity ecosystems | OpenID4VP — standards-based, carries SD-JWT VCs that any EUDI wallet can produce |
Issuance (giving users attributes)
| Use case | Recommended protocol |
|---|---|
| Privacy-preserving issuance — you want issuer unlinkability, or you need to issue Idemix attributes alongside SD-JWT VCs | IRMA — the IRMA protocol supports both Idemix and SD-JWT VC issuance with the privacy properties Yivi is known for |
| Maximum interoperability — issue credentials that any EUDI wallet (not just Yivi) can receive | OpenID4VCI — standards-based, produces SD-JWT VCs other EUDI wallets understand |
Issuance and disclosure are decoupled. Yivi is crypto agile: the IRMA protocol can issue multiple credential formats side by side — both Idemix and SD-JWT VC — from a single issuer setup. Once they are in the wallet, Idemix credentials are disclosed over IRMA and SD-JWT VCs over OpenID4VP, so users can hold credentials of both formats in one wallet at the same time.
Starting points
Pick the section that matches your protocol of choice:
- Verifying over IRMA — full step-by-step quickstart on this page.
- Issuing over IRMA — extends the IRMA quickstart with issuance.
- Verifying over OpenID4VP — pointers to the dedicated guide.
- Issuing over OpenID4VCI — pointers to the dedicated guide (private beta).
Verifying over IRMA
This walkthrough uses the following components:
irma server, a server that verifies or issues IRMA attributes to Yivi apps.yivi-frontend, a JavaScript library for drawing the Yivi QR in your website and handling the IRMA session with theirma server.
If you want to compile from source instead of using prebuilt binaries, follow the build prerequisites documented in the upstream repositories: the irmago README for the irma server, and the yivi-frontend-packages README for yivi-frontend.
Installing irma server
You can install the yivi command line tool in the following three ways.
- Prebuilt binary
- Compile and install binary from source
- Docker
- Download prebuilt binary from GitHub. Choose the binary for your OS and architecture (most likely amd64).
- Rename the file to
/usr/local/bin/yivito have it available in your PATH.
go install github.com/privacybydesign/irmago/yivi@latest
docker pull ghcr.io/privacybydesign/irma:latest
Running irma server
After installing the yivi binary, start the server (with increased verbosity but otherwise default configuration):
- Binary
- Docker
yivi irma server -v
IP=192.168.1.2 # Replace with your local IP address.
docker run -p 8088:8088 ghcr.io/privacybydesign/irma:latest server -v --url "http://$IP:port"
Configuration
Run yivi irma server -h to see configuration options. In order to verify your configuration, run yivi irma server check -v. General documentation can be found on the irma server page, API documentation of HTTP endpoints can be found on the api irma server page.
Perform a command line IRMA session
Given:
- a running IRMA server (see above)
- the Yivi app with developer mode turned on
- the devices with the Yivi app and IRMA server on the same network
you can perform a first IRMA session using your server on the command line as follows:
- Binary
- Docker
yivi irma session --server http://localhost:8088 --disclose pbdf.pbdf.irmatube.type
IP=192.168.1.2 # Replace with your local IP address.
docker run ghcr.io/privacybydesign/irma:latest session --server "http://$IP:8088" --disclose pbdf.pbdf.irmatube.type
IRMATube attributes are available on the YiviTube demo page. This will print a QR that you can scan with your Yivi app, and the attribute contents after they have been received and verified by the server. yivi irma session can also perform issuance sessions and attribute-based signature sessions. If you pass -v it logs the session request JSON that it sends to your irma server.
Installing an example webpage for yivi-frontend
Download the yivi-frontend-packages source code, as zip from GitHub, or using git:
git clone https://github.com/privacybydesign/yivi-frontend-packages && cd yivi-frontend-packages
Examples for the browser and for Node.js are included in the examples folder. In this guide we will use the yivi-frontend example for browsers to realize the example webpage. This example has to be installed first.
cd examples/browser/yivi-frontend/
npm install
npm run build
Perform browser IRMA session
(Re)start your irma server, configuring it such that it statically hosts the yivi-frontend example webpage we just built with the commands below. Change ~ to the actual folder you have downloaded yivi-frontend-packages to.
- Binary
- Docker
yivi irma server -v --static-path ~/yivi-frontend-packages/examples/browser/yivi-frontend
IP=192.168.1.2 # Replace with your local IP address.
docker run -v ~/yivi-frontend-packages:/yivi-frontend-packages -p 8088:8088 ghcr.io/privacybydesign/irma:latest server -v --url "http://$IP:port" --static-path /yivi-frontend-packages/examples/browser/yivi-frontend
A webpage demoing IRMA attribute issuance verification should now be available at http://localhost:8088.
Open the browser console and the console running irma server to see various log messages and possibly error messages as the IRMA session proceeds.
Example configuration and IRMA session
Generally, your IRMA server runs in your backend alongside a server application serving your frontend (website), with which the Yivi app user is interacting. Your server application starts and manages sessions at your IRMA server to verify or issue attributes (for example, when the user wants to log in). This can be set up as follows.
Configure irma server
In production, it is generally best to authenticate incoming session requests from your application. The following is an example production configuration file (in YAML) for the irma server (start with yivi irma server -c /path/to/config.yml) that will accept session requests if they include a Authorization: mysecrettoken HTTP header.
production: true
port: 443
url: "https://example.com/irma/"
tls_cert: "/etc/letsencrypt/live/example.com/fullchain.pem"
tls_privkey: "/etc/letsencrypt/live/example.com/privkey.pem"
no_auth: false
requestors:
myapp:
auth_method: "token"
key: "mysecrettoken"
- You may want to restrict permissions to verify or issue specific attributes, globally or per requestor.
- The server can be made into a daemon on most Linux systems using a systemd unit file.
- Another common setup is to have a reverse proxy between the IRMA server and the internet, which handles TLS instead and forwards traffic on
https://example.com/irma/to the IRMA server.
Perform a session
Assuming your application runs on the same server as the IRMA server, your application can now start a session at your IRMA server as follows (using curl as example):
curl https://example.com/session \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: mysecrettoken" \
-d '{
"@context": "https://irma.app/ld/request/disclosure/v2",
"disclose": [[["irma-demo.MijnOverheid.ageLower.over18"]]]
}'
This will output something like the following:
{
"token": "X7LU5Q8Jhig0330gjYUO",
"sessionPtr": {"u": "https://example.com/irma/t1nXs4ZduyhvAeAAlB77","irmaqr": "disclosing"},
"frontendRequest":{"authorization":"X9XeI0gJG2HZv4hZ1WkP","minProtocolVersion":"1.0","maxProtocolVersion":"1.1"}
}
- Use the
tokento track the session status, and to get the session result after the session has finished. - The
sessionPtrandfrontendRequestare used byyivi-frontendto show a Yivi QR code or toggle to the Yivi app. Generally you configureyivi-frontendwith a URL that returns thesessionPtrandfrontendRequest; it will then start the session automatically.
Instead of managing sessions with HTTP requests as shown here, for certain languages (currently Go and JavaScript) it is also possible to include an IRMA library and manage sessions using function invocations.
Issuing over IRMA
The IRMA quickstart above mostly focuses on verifying — receiving IRMA attributes from Yivi apps and establishing their authenticity. Issuing attributes to Yivi apps can be done with the same software and largely similar flows, but is more involved, because the identity of prospective issuers needs to be verified and the contents and structure of the credentials to be issued needs to be established. This process is documented in the issuer guide.
For experimenting and demoing, however, it is possible to issue any of the existing credentials within the irma-demo scheme. For example, if the requestors block in the YAML example configuration of the IRMA server above would include permission to issue irma-demo attributes, as follows:
requestors:
myapp:
auth_method: "token"
key: "mysecrettoken"
issue_perms:
- "irma-demo.*"
Then an issuance session for the credential used in the example disclosure session above can be started at the IRMA server as follows:
curl https://example.com/session \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: mysecrettoken" \
-d '{
"@context": "https://irma.app/ld/request/issuance/v2",
"credentials": [
{
"credential": "irma-demo.MijnOverheid.ageLower",
"attributes": {
"over12": "yes",
"over16": "yes",
"over18": "yes",
"over21": "no"
}
}
]
}'
To issue a demo credential of your own not already present in the irma-demo scheme, see the issuer guide. To issue SD-JWT VCs over the IRMA protocol (so they can later be disclosed over OpenID4VP), see Issuing SD-JWT VC over IRMA.
Verifying over OpenID4VP
OpenID4VP carries SD-JWT VCs and is the right choice when you want the broadest interoperability with the EUDI ecosystem. The full path is:
- Read the OpenID4VP Introduction for an overview of the protocol and what Yivi currently supports.
- Apply for a verifier certificate via the Yivi portal and Yivi support — every verifier needs an X.509 certificate on the Yivi Trust List before it can request attributes.
- Build your DCQL queries and authorization requests following Disclosing SD-JWT VCs over OpenID4VP.
- Wire up your frontend using the Verifier Integration Guide, which walks through a working end-to-end example based on the openid4vp-demo-frontend reference repository.
Issuing over OpenID4VCI
OpenID4VCI is the standards-based path to issuing SD-JWT VCs into Yivi (and any other EUDI-compliant wallet).
OpenID4VCI issuance is currently in private beta. Reach out to Yivi support if you would like to participate. If you are an existing Yivi issuer and want something operational today, prefer Issuing over IRMA instead.
To get started:
- Read the OpenID4VCI Introduction for an overview of the pre-authorized code flow and what's in scope for the private beta.
- Follow the Issuer Integration Guide for credential offer creation, the optional
tx_codestep, and polling for issuance completion. The code samples mirror the openid4vp-demo-frontend reference repository.