Skip to content

decentralized-identity/didwebvh-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

did:webvh implementation

Crates.io Documentation Rust

A complete implementation of the did:webvh method in Rust. Supports version 1.0 spec.

This library implements the Rust SSI Library resolver traits for use in universal resolvers such as the Affinidi DID resolver or your own.

A helpful implementation site is the webvh DID Method Information site

Features

  • Create a did:webvh LogEntry and DID Document
  • Resolve a did:webvh method
  • Validate webvh LogEntries to v1.0 specification
  • Update webvh DID
  • Revoke webvh DID
  • Witness webvh DID
  • Migration of DID (portability)
  • Validate witness information
  • DID Query Parameters versionId and versionTime implemented
  • WebVH DID specification version support (v1.0 and pre-v1.0)

Usage

Add this to your Cargo.toml:

[dependencies]
didwebvh-rs = "0.1"

Then:

use didwebvh_rs::DIDWebVHState;

let mut webvh = DIDWebVHState::default();

// Load LogEntries from a file
webvh.load_log_entries_from_file("did.jsonl")?;

Everyone likes a wizard

Getting started with webvh at first can be daunting given the complexity of the specification and supporting infrastructure such as witness and watcher nodes.

To help with getting started, a wizard for webvh has been created to help you.

To run this wizard, you need to have Rust installed on your machine.

cargo run --example wizard -- --help

WARNING: This wizard will generate secrets locally on your machine, and display the secret on the screen.

The wizard is meant for demonstration purposes only. Use in a production environment is not recommended.

Default Wizard Files

did.jsonl is the default WebVH LogEntry file that the wizard will create.

did-witness.json where Witness Proofs are saved.

did.jsonl-secrets is the default file containing key secrets

Is WebVH performant?

There is a lot going on with the WebVH DID method. A lot of keys, signing and validations

Depending on how often you are creating LogEntries, number of witnesses etc can have a big impact on performance.

To help with testing different usage scenario's, there is an example tool that can help you with testing real-world performance of the WebVH method.

To get options for the generate_history performance tool, run:

cargo run --release --example generate_history -- --help

For example, to generate 200 LogEntries with 10 witnesses each, you can run:

cargo run --release --example generate_histroy -- -c 200 -w 10

This tool will generate the output to

  • did.jsonl (LogEntries)
  • did-witness.json (Witness Proofs)

License

Licensed under:

About

A complete Rust implementation of the did:webvh specification

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages