Skip to content
This repository has been archived by the owner on Apr 26, 2023. It is now read-only.

secp256k1 key did provider

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

symfoni/key-did-provider-secp256k1

 
 

Repository files navigation

secp256k1 key did provider

This is a DID Provider which implements EIP2844 for did:key: using secp256k1. It does not support encryption / JWE. It is based on key-did-provider-ed25519 and was designed to be used with Ceramic.

Installation

npm install --save key-did-provider-secp256k1

Usage

import { Secp256k1Provider } from 'key-did-provider-ed25519'
import KeyResolver from 'key-did-resolver'
import { DID } from 'dids'

const seed = new Uint8Array(...) //  32 bytes with high entropy
const provider = new Secp256k1Provider(seed)
const did = new DID({ provider, resolver: KeyResolver.getResolver() })
await did.authenticate()

// log the DID
console.log(did.id)

// create JWS
const { jws, linkedBlock } = await did.createDagJWS({ hello: 'world' })

// verify JWS
await did.verifyJWS(jws)

License

Apache-2.0 OR MIT

About

secp256k1 key did provider

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%