key-did-provider-ed25519
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    ed25519 key did provider

    This is a DID Provider which implements EIP2844 for did:key: using ed25519. It also supports decryption using x25519.

    Installation

    npm install --save key-did-provider-ed25519
    

    Usage

    import { Ed25519Provider } 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 Ed25519Provider(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)
    
    // create JWE
    const jwe = await did.createDagJWE({ very: 'secret' }, [did.id])
    
    // decrypt JWE
    const decrypted = await did.decryptDagJWE(jwe)

    License

    Apache-2.0 OR MIT

    Keywords

    none

    Install

    npm i key-did-provider-ed25519

    DownloadsWeekly Downloads

    2,345

    Version

    1.1.0

    License

    (Apache-2.0 OR MIT)

    Unpacked Size

    232 kB

    Total Files

    11

    Last publish

    Collaborators

    • npm.3box
    • smrz2001
    • oed
    • zachferland
    • paul_lecam
    • stbrody
    • ukstv