Home

Awesome

Wallet Framework for .NET

Wallet Framework for .NET is an open framework for building digital identity wallets. The framework was initiated as Aries Framework .NET in the Hyperledger Foundation and was forked to express the goal to broaden the supported identity protocols, especially with regard to OID4VC and SD-JWT.

Table of Contents <!-- omit in toc -->

Roadmap

Protocols

OpenID for Verifiable Credentials (OID4VC)

ProtocolLinkState
OpenID for Verifiable Credential IssuanceOID4VCI:construction:
- Pre-Authorized Code FlowPre-Auth-Flow:white_check_mark:
- Authorization Code FlowAuth-Flow:construction:
- Holder Binding / Key BindingKB-JWT:white_check_mark:
- Wallet AttestationWallet Attestation:construction:
- Issuer AuthenticationIssuer Authentication:construction:
- Demonstrating Proof of PossessionDPoP:construction:
OpenID for Verifiable PresentationsOID4VP:construction:
- Same-Device FlowSame-Device:white_check_mark:
- Cross-Device FlowCross-Device:white_check_mark:
- Verifier AuthenticationVerifier Authentication:construction:
Self-Issued OpenID Provider v2SIOPv2:construction:

Hyperledger Aries

AIP 1.0

ProtocolState
0019-encryption-envelope:white_check_mark:
0160-connection-protocol:white_check_mark:
0036-issue-credential:white_check_mark:
0037-present-proof:white_check_mark:
0056-service-decorator:white_check_mark:
0025-didcomm-transportsHttp supported
0015-acksPartially supported
0035-report-problemPartially supported

AIP 2.0

ProtocolState
0023-did-exchange:white_check_mark:
0048-trust-ping:white_check_mark:
0095-basic-message:white_check_mark:

Credential Formats

Credential FormatLinkState
AnonCreds 1.0Anonymous Credential Protocol:white_check_mark:
SD-JWT-based Verifiable CredentialsSD-JWT VC:construction:

Quickstart Guide

The framework fully leverages the .NET Core hosting model with full integration of dependency injection, configuration and hosting services.

Prerequisites

Create new web application

Using your favorite editor, create new web project. You can also create a project from the console.

dotnet new web -o AriesAgent

To setup your agent use the Startup.cs file to configure the framework.

Add the framework dependencies

Use the IServiceCollection extensions to add the dependent services to your application in the ConfigureServices(IServiceCollection services) method. Upon startup, the framework will create and configure your agent.

services.AddAriesFramework(builder =>
{
    builder.RegisterAgent(options =>
    {
        options.EndpointUri = "http://localhost:5000/";
    });
});

Note: If you'd like your agent to be accessible publically, use Ngrok to setup a public host and use that as the EndpointUri. When changing the endpoints, make sure you clear any previous wallets with the old configuration. Wallet data files are located in ~/.indy_client/wallet

For a list of all configuration options, check the AgentOptions.cs file.

Register the agent middleware

When running web applications, register the agent middleware in the Configure(IApplicationBuilder app, IWebHostEnvironment env) method. This will setup a middleware in the AspNetCore pipeline that will respond to incoming agent messages.

app.UseAriesFramework();

That's it. Run your project.

Demo

With Docker installed, run

docker-compose up

This will create an agent network with a pool of 4 indy nodes and 2 agents able to communicate with each other in the network. Navigate to http://localhost:7000 and http://localhost:8000 to create and accept connection invitations between the different agents.

Testing

To run the unit tests, the following dependencies also must be installed:

Install libindy library

Follow the build instructions for your OS on the Hyperledger Indy SDK Readme.

For macOS, if you get a 'indy' DLL not found exception, move the built libindy.dylib file to the test/Hyperledger.Aries.Tests/bin/Debug/netcoreapp3.1/ directory to explicitly add it to the path.

Run an indy node pool on localhost

docker build --build-arg pool_ip=127.0.0.1 -f docker/indy-pool.dockerfile -t indy_pool docker/
docker run -itd -p 9701-9709:9701-9709 indy_pool

Run an indy node pool on server

# replace <ip_address> with server IP address
docker build --build-arg pool_ip=<ip_address> -f docker/indy-pool.dockerfile -t indy_pool docker/
docker run -itd -p <ip_address>:9701-9709:9701-9709 indy_pool

Run the tests

First, edit the keyword in the scripts/tester.sh file to select the tests you want to run. Then, run the script

scripts/tester.sh 

Releases / Versioning

This Repository includes a github actions pipeline which builds and releases the wallet framework whenever a Pull Request is submitted or a merge to the main branch happens. When the build and release process is triggered by a pull request the build version has a "pr" suffix. If it is triggered by a merge towards the main branch the build version has a "rc" suffix. (e.g. 2.0.0-pr.x.x or 2.0.0-rc.x)

The build is accessible through the Open Wallet Foundation nuget feed.

License

Apache License Version 2.0