Skip to content

Manage a privatekey or seed by multiple Ids

License

Notifications You must be signed in to change notification settings

sdmg15/CeramicSeedSDK

 
 

Repository files navigation

CeramicSeedSDK

Manage a privatekey or seed by multiple Ids

Getting Started

Install Ceramic-seed-sdk into your project

npm install ceramic-seed-sdk

Usage

import { CeramicSDK } from 'ceramic-seed-sdk'
  • Create a new instance of the sdk:
const sdk = new CeramicSDK("https://ceramic-clay.3boxlabs.com");
  • Initialize a DID based on private key and create a new one if none exists:
    const sdkClient = new CeramicSDK(NODE_URL_3BOXLABS);
    const myPrvkey = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // Length need to be 32
    const res = await sdkClient.initialize(myPrvkey, "pubkeyToUseAsAuthId");
  • Add the given private key as another authSecret that can access the DID seed:
    const res = await sdkClient.addAuthenticator(myNewPrvkey, derivedPubkey2);
  • Remove the provided authenticator:
    const removed = await sdkClient.removeAuthenticator(pubkey);
  • Retrieves the unencrypted master seed:
    const ms = await sdkClient.getMasterSeed();

About

Manage a privatekey or seed by multiple Ids

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%