4.0.2 • Published 2 months ago

hypercore-signing-request v4.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

hypercore-signing-request

Generate shareable signing requests for Hypercore

npm install hypercore-signing-request

Useful for manual multisig

Usage

const { generate, decode, signable } = require('hypercore-signing-request')

API

requestBuffer = await generate(coreOrDrive, { length = core.length })

Generate a signing request, returned as a buffer so it can be shared. Only works for non-compat cores (ie manifest backed).

Alternatvely a Hyperdrive can be passed and a joint request for signing both metadata and blob cores will be generated. Only works for v1 manifest backed Hyperdrives.

req = decode(requestBuffer)

Decode the signing request. Looks like this:

{
  version, // request version
  id, // hypercore id
  key, // the key as well
  manifest, // core manifest
  treeHash, // the tree hash
  length, // the core length
  fork // the core fork id
}

buffer = signable(publicKey, req)

Get the buffer to sign. Pass your public key and it validates that you can sign it.

License

Apache-2.0

4.0.1

2 months ago

4.0.2

2 months ago

3.1.2

3 months ago

4.0.0

3 months ago

3.1.1

3 months ago

3.1.0

3 months ago

3.0.2

3 months ago

3.0.1

3 months ago

3.0.0

3 months ago

2.0.0

3 months ago

1.0.0

3 months ago