Blockchain Commons Components TypeScript Library - v1.0.0-alpha.13
    Preparing search index...

    Class Signature

    A digital signature created with various signature algorithms.

    Currently supports:

    • Schnorr signatures (64 bytes) - bare byte string in CBOR
    • ECDSA signatures (64 bytes) - discriminator 1
    • Ed25519 signatures (64 bytes) - discriminator 2
    • Sr25519 signatures (64 bytes) - discriminator 3
    • MLDSA signatures (post-quantum) - tagged CBOR delegating to MLDSASignature

    Implements

    • CborTaggedEncodable
    • CborTaggedDecodable<Signature>
    Index

    Properties

    UR_TYPE: "signature"

    Get the UR type for signatures.

    Methods

    • Returns a human-readable string identifying the signature type.

      Returns string

      A string like "Ed25519", "Schnorr", "ECDSA", "Sr25519", "MLDSA-44", etc.

    • Returns the Schnorr signature data if this is a Schnorr signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is a Schnorr signature, null otherwise

    • Returns the ECDSA signature data if this is an ECDSA signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an ECDSA signature, null otherwise

    • Returns the Ed25519 signature data if this is an Ed25519 signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an Ed25519 signature, null otherwise

    • Returns the Sr25519 signature data if this is an Sr25519 signature.

      Returns Uint8Array<ArrayBufferLike> | null

      The 64-byte signature data if this is an Sr25519 signature, null otherwise

    • Returns the untagged CBOR encoding.

      Format (matching Rust bc-components):

      • Schnorr: h'<64-byte-signature>' (bare byte string)
      • ECDSA: [1, h'<64-byte-signature>']
      • Ed25519: [2, h'<64-byte-signature>']
      • Sr25519: [3, h'<64-byte-signature>']

      Returns Cbor

    • Returns the tagged value in CBOR binary representation.

      Returns Uint8Array

    • Creates a Signature by decoding it from untagged CBOR.

      Format (matching Rust bc-components):

      • h'<64-byte-signature>' (bare byte string) for Schnorr
      • [1, h'<64-byte-signature>'] for ECDSA
      • [2, h'<64-byte-signature>'] for Ed25519
      • [3, h'<64-byte-signature>'] for Sr25519

      Parameters

      • cborValue: Cbor

      Returns Signature