Skip to content

Class: SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1678

A signature proof represents a signature together with its public key and the public key's merkle path. It is used as the proof for transactions.

Properties

publicKey

readonly publicKey: ES256PublicKey | PublicKey

Defined in: @nimiq/core/types/wasm/web.d.ts:1727

The embedded public key.


signature

readonly signature: ES256Signature | Signature

Defined in: @nimiq/core/types/wasm/web.d.ts:1723

The embedded signature.


ES256_SINGLE_SIG_SIZE

readonly static ES256_SINGLE_SIG_SIZE: number

Defined in: @nimiq/core/types/wasm/web.d.ts:1719


SINGLE_SIG_SIZE

readonly static SINGLE_SIG_SIZE: number

Defined in: @nimiq/core/types/wasm/web.d.ts:1718

Methods

free()

free(): void

Defined in: @nimiq/core/types/wasm/web.d.ts:1680

Returns

void


isSignedBy()

isSignedBy(sender): boolean

Defined in: @nimiq/core/types/wasm/web.d.ts:1705

Checks if the signature proof is signed by the provided address.

Parameters

sender

Address

Returns

boolean


serialize()

serialize(): Uint8Array

Defined in: @nimiq/core/types/wasm/web.d.ts:1709

Serializes the proof to a byte array, e.g. for assigning it to a transaction.proof field.

Returns

Uint8Array


toPlain()

toPlain(): PlainTransactionProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1713

Creates a JSON-compatible plain object representing the signature proof.

Returns

PlainTransactionProof


verify()

verify(data): boolean

Defined in: @nimiq/core/types/wasm/web.d.ts:1701

Verifies the signature proof against the provided data.

Parameters

data

Uint8Array

Returns

boolean


deserialize()

static deserialize(bytes): SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1717

Deserializes a signature proof from a byte array.

Parameters

bytes

Uint8Array

Returns

SignatureProof


multiSig()

static multiSig(signer_key, public_keys, signature): SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1689

Creates a Ed25519/Schnorr signature proof for a multi-sig signature. The public keys can also include ES256 keys.

Parameters

signer_key

PublicKey

public_keys

(ES256PublicKey | PublicKey)[]

signature

Signature

Returns

SignatureProof


singleSig()

static singleSig(public_key, signature): SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1684

Creates a Ed25519/Schnorr signature proof for a single-sig signature.

Parameters

public_key

PublicKey

signature

Signature

Returns

SignatureProof


webauthnMultiSig()

static webauthnMultiSig(signer_key, public_keys, signature, authenticator_data, client_data_json): SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1697

Creates a Webauthn signature proof for a multi-sig signature.

Parameters

signer_key

ES256PublicKey | PublicKey

public_keys

(ES256PublicKey | PublicKey)[]

signature

ES256Signature | Signature

authenticator_data

Uint8Array

client_data_json

Uint8Array

Returns

SignatureProof


webauthnSingleSig()

static webauthnSingleSig(public_key, signature, authenticator_data, client_data_json): SignatureProof

Defined in: @nimiq/core/types/wasm/web.d.ts:1693

Creates a Webauthn signature proof for a single-sig signature.

Parameters

public_key

ES256PublicKey | PublicKey

signature

ES256Signature | Signature

authenticator_data

Uint8Array

client_data_json

Uint8Array

Returns

SignatureProof