Class: BIP340Cryptosuite ​
Defined in: cryptosuite/index.ts:28
An implementation of a Cryptosuite using BIP340 Schnorr signatures and JCS canonicalization.
Implements ​
BIP340Cryptosuite
Implements ​
Constructors ​
Constructor ​
new BIP340Cryptosuite(
multikey):BIP340Cryptosuite
Defined in: cryptosuite/index.ts:51
Constructs an instance of Cryptosuite.
Parameters ​
multikey ​
The SchnorrMultikey to use for signing and verifying proofs.
Returns ​
BIP340Cryptosuite
Properties ​
cryptosuite ​
cryptosuite:
"bip340-jcs-2025"='bip340-jcs-2025'
Defined in: cryptosuite/index.ts:39
The name of the cryptosuite
Implementation of ​
multikey ​
multikey:
SchnorrMultikey
Defined in: cryptosuite/index.ts:45
The multikey used to sign and verify proofs
Implementation of ​
type ​
type:
"DataIntegrityProof"='DataIntegrityProof'
Defined in: cryptosuite/index.ts:33
The type of the proof
Implementation of ​
Methods ​
createProof() ​
createProof(
document,config):DataIntegrityProofObject
Defined in: cryptosuite/index.ts:69
Create a proof for an insecure document.
Parameters ​
document ​
The document to create a proof for.
config ​
The options to use when creating the proof.
Returns ​
The proof for the document.
Implementation of ​
generateHash() ​
generateHash(
config,document):Bytes
Defined in: cryptosuite/index.ts:169
Generate a hash of the canonical proof configuration and document.
Parameters ​
config ​
string
The canonicalized proof configuration.
document ​
string
The canonicalized document.
Returns ​
The hash string of the proof configuration and document.
Implementation of ​
proofConfiguration() ​
proofConfiguration(
config):string
Defined in: cryptosuite/index.ts:189
Configure the proof by canonicalzing it.
Parameters ​
config ​
The config to use when transforming the proof.
Returns ​
string
The canonicalized proof configuration.
Throws ​
if the proof configuration cannot be canonicalized.
Implementation of ​
Cryptosuite.proofConfiguration
proofSerialization() ​
proofSerialization(
hash,config):Bytes
Defined in: cryptosuite/index.ts:226
Serialize the proof into a byte array.
Parameters ​
hash ​
The canonicalized proof configuration.
config ​
The config to use when serializing the proof.
Returns ​
The serialized proof.
Throws ​
if the multikey does not match the verification method.
Implementation of ​
Cryptosuite.proofSerialization
proofVerification() ​
proofVerification(
hash,signature,config):boolean
Defined in: cryptosuite/index.ts:248
Verify the proof by comparing the hash of the proof configuration and document to the proof bytes.
Parameters ​
hash ​
The canonicalized proof configuration and document hash.
signature ​
The proof bytes to verify against.
config ​
The config to use when verifying the proof.
Returns ​
boolean
True if the proof is verified, false otherwise.
Throws ​
if the multikey does not match the verification method.
Implementation of ​
toDataIntegrityProof() ​
toDataIntegrityProof():
BIP340DataIntegrityProof
Defined in: cryptosuite/index.ts:59
Constructs an instance of BIP340DataIntegrityProof from the current Cryptosuite instance.
Returns ​
A new BIP340DataIntegrityProof instance.
transformDocument() ​
transformDocument(
document,config):string
Defined in: cryptosuite/index.ts:142
Transform a document into canonical form.
Parameters ​
document ​
The document to transform.
config ​
The config to use when transforming the document.
Returns ​
string
The canonicalized document.
Throws ​
if the document cannot be transformed.
Implementation of ​
verifyProof() ​
verifyProof(
secureDocument):VerificationResult
Defined in: cryptosuite/index.ts:109
Verify a proof for a secure document.
Parameters ​
secureDocument ​
The secure document to verify.
Returns ​
The result of the verification.