Intro
forge_did
implement by Rust
. Forge_wallet core implementation.
Generate forge did
from pk, or sk, or pk hash. forge did
example did:abt:zNYm1gM23ZGHNYDYyBwSaywzTqLKoj4WuTeC
. Prefix did
means the string is a DID
, abt
means the did is forge did
. zNYm1gM23ZGHNYDYyBwSaywzTqLKoj4WuTeC
is address.
API
get_did_by_sk(sk: &[u8], did_type: &Option<DidType>) -> Result<String>
get_did_by_pk(pk: &[u8], did_type: &Option<DidType>) -> Result<String>
get_did_by_pk_hash(pk_hash: &[u8], did_type: &Option<DidType>) -> Result<String>
Usage
// generate key pair
let = get_key_pair;
let did_type = DidType
let did_by_sk = get_did_by_sk?;
let did_by_pk = get_did_by_pk?;
// did_by_pk example: "did:abt:zNYm1gM23ZGHNYDYyBwSaywzTqLKoj4WuTeC";
assert_eq!;