Rust client library for managing DID operations for Sidetree API services

Crates.io

This library provides a set of client services to help work with DID operations for the Sidetree REST API. The goal is to provide access to Sidetree based DID methods using a cross platform library.

Requirements

This library requires sidetree node to be running and expose API interface. Check the ION and Element implementations for running a node locally.

Usage

You can use the library directly in your code, or use the provided CLI to generate requests in console.

Using the library in your code

Install from crates.io

toml sidetree-client = "*"

Using the CLI from terminal

Install the CLI with

bash cargo install sidetree-client

Generate create request

sidetree-client create

See a list of all commands supported

sidetree-client --help

Specifications

Sidetree Operations

This library provides objects that are compatible with the API spec. The objects can be converted to JSON using Rust's serde_json crate.

Create Operation

To generate new DID, you can use the create() or create_config(OperationInput) methods.

Create new DID

To generate a request for new DID use the create() function. It will generate a request and document with random EC key for secp256k1 curve:

```rust use sidetree_client::*;

let create_operation = operations::create().unwrap();

// generate JSON request for use with API spec let json = serdejson::tostringpretty(&createoperation.operation_request);

println!("did:ion:{}", createoperation.didsuffix); println!("{}", json); ```

This operation returns an object of type OperationOutput which has the following fields

Update Operation

Add key to your DID Document

TODO

Remove key from your DID Document

TODO

Add service entry to your DID Document

TODO

Remove service entry from your DID Document

TODO

Recover Operation

TODO

Deactivate Operation

TODO

License

Apache 2.0