@did-btc1/cryptosuite / SchnorrMultikey
Class: SchnorrMultikey
Defined in: multikey/index.ts:28
SchnorrMultikey is an implementation of 2.1.1 Multikey. The publicKeyMultibase value of the verification method MUST be a base-58-btc Multibase encoding of a Multikey encoded secp256k1 public key. The secretKeyMultibase value of the verification method MUST be a Multikey encoding of a secp256k1 secret key. SchnorrMultikey
Implements
Constructors
Constructor
> new SchnorrMultikey(params
): SchnorrMultikey
Defined in: multikey/index.ts:51
Creates an instance of SchnorrMultikey.
Parameters
params
MultikeyParams
The parameters to create the multikey
Returns
SchnorrMultikey
Throws
if neither a publicKey nor a privateKey is provided
Properties
controller
> readonly
controller: string
Defined in: multikey/index.ts:36
Implementation of
id
> readonly
id: string
Defined in: multikey/index.ts:33
Implementation of
type
> readonly
static
type: string
= 'Multikey'
Defined in: multikey/index.ts:30
Accessors
keys
Get Signature
> get keys(): SchnorrKeyPair
Defined in: multikey/index.ts:69
Returns
SchnorrKeyPair
Implementation of
publicKey
Get Signature
> get publicKey(): PublicKey
Defined in: multikey/index.ts:76
Returns
PublicKey
Implementation of
secretKey
Get Signature
> get secretKey(): SecretKey
Defined in: multikey/index.ts:83
Returns
SecretKey
Implementation of
signer
Get Signature
> get signer(): boolean
Defined in: multikey/index.ts:242
Returns
boolean
Implementation of
Methods
fromVerificationMethod()
> fromVerificationMethod(verificationMethod
): Multikey
Defined in: multikey/index.ts:192
Convert a verification method to a multikey.
Parameters
verificationMethod
DidVerificationMethod
The verification method to convert.
Returns
Multikey instance.
Throws
if the verification method is missing required fields. if the verification method has an invalid type. if the publicKeyMultibase has an invalid prefix.
Implementation of
Multikey
.fromVerificationMethod
fullId()
> fullId(): string
Defined in: multikey/index.ts:164
Get the full id of the multikey
Returns
string
The full id of the multikey
Implementation of
json()
> json(): MultikeyObject
Defined in: multikey/index.ts:250
Convert the multikey to a JSON object.
Returns
The multikey as a JSON object.
Implementation of
sign()
> sign(data
, opts?
): Bytes
Defined in: multikey/index.ts:109
Produce a schnorr signature over arbitrary data.
Parameters
data
Hex
Data to be signed.
opts?
CryptoOptions
Returns
Bytes
Signature byte array.
Throws
if no private key is provided.
Implementation of
toCryptosuite()
> toCryptosuite(cryptosuite?
): Cryptosuite
Defined in: multikey/index.ts:99
Constructs an instance of Cryptosuite from the current Multikey instance.
Parameters
cryptosuite?
"bip340-jcs-2025"
| "bip340-rdfc-2025"
Returns
toVerificationMethod()
> toVerificationMethod(): DidVerificationMethod
Defined in: multikey/index.ts:173
Convert the multikey to a verification method.
Returns
DidVerificationMethod
The verification method.
Implementation of
verify()
> verify(signature
, data
, opts?
): boolean
Defined in: multikey/index.ts:137
Verify a schnorr signature.
Parameters
signature
Bytes
Signature for verification.
data
Hex
Data for verification.
opts?
CryptoOptions
Returns
boolean
If the signature is valid against the public key.
Implementation of
verifyEcdsa()
> verifyEcdsa(signature
, data
): boolean
Defined in: multikey/index.ts:155
Verify an ecdsa signature.
Parameters
signature
Bytes
Signature for verification.
data
Hex
Data for verification.
Returns
boolean
If the signature is valid against the public key.
fromPrivateKey()
> static
fromPrivateKey(params
): SchnorrMultikey
Defined in: multikey/index.ts:284
Creates a Multikey
instance from a private key
Parameters
params
The parameters to create the multikey
Returns
SchnorrMultikey
The new multikey instance
fromPublicKey()
> static
fromPublicKey(params
): Multikey
Defined in: multikey/index.ts:306
Creates a Multikey
instance from a public key
Parameters
params
The parameters to create the multikey
Returns
The new multikey instance
fromPublicKeyMultibase()
> static
fromPublicKeyMultibase(params
): SchnorrMultikey
Defined in: multikey/index.ts:322
Creates a Multikey
instance from a public key multibase.
Parameters
params
See FromPublicKeyMultibaseParams for details.
Returns
SchnorrMultikey
The new multikey instance.
initialize()
> static
initialize(params
): SchnorrMultikey
Defined in: multikey/index.ts:272
Static convenience method to create a new Multikey instance.
Parameters
params
MultikeyParams
The parameters to create the multikey
Returns
SchnorrMultikey
A new Multikey instance
Throws
if neither a publicKey nor a privateKey is provided