Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Multisig

Represents a multisig helper class that can be used for the creation of multisig wallets

Hierarchy

  • Multisig

Index

Accessors

address

  • Returns an address object representing the multisig wallet address

    Returns Address

current_participants

  • get current_participants(): number
  • Returns the number of participants currently loaded into the object

    Returns number

isReady

  • get isReady(): boolean
  • Returns if the object is ready for export and/or use

    Returns boolean

multisig_keys

participants

  • get participants(): number
  • Returns the participants (N) of the multisig wallet

    Returns number

private_multisig_keys

  • get private_multisig_keys(): string[]
  • Returns the private multisig keys

    Returns string[]

public_multisig_keys

  • get public_multisig_keys(): string[]
  • Returns the public multisig keys

    Returns string[]

spend

  • get spend(): string
  • Returns the shared public spend key of the multisig wallet

    Returns string

threshold

  • get threshold(): number
  • Returns the threshold (M) of the multisig wallet

    Returns number

view

  • get view(): string
  • Returns the shared private view key of the multisig wallet

    Returns string

Methods

addParticipant

  • addParticipant(publicSpendKeys: string[] | string, privateViewKey?: undefined | string): Promise<void>
  • Adds a participant to the multisig object Note: If this is an additional round of exchange, the publicSpendKeys should be the array of public multisig keys of the participant and we will not supply the private view key again.

    Parameters

    • publicSpendKeys: string[] | string

      the participant spend key(s)

    • Optional privateViewKey: undefined | string

    Returns Promise<void>

completeTransaction

  • Restores the ring signatures of a prepared transaction using the supplied partial signing keys

    Parameters

    Returns Promise<Transaction>

    the completed transaction

generatePartialKeyImages

  • generatePartialKeyImages(transactionHash: string, publicEphemeral: string, outputIndex: number): Promise<PartialKeyImage[]>
  • Generates the partial key images for the given public ephemeral

    Parameters

    • transactionHash: string

      the transaction hash containing the output used

    • publicEphemeral: string

      the public ephemeral of the output

    • outputIndex: number

      the index of the output in the transaction

    Returns Promise<PartialKeyImage[]>

    the partial key images

generatePartialSigningKeys

Static exchangeRoundsRequired

  • exchangeRoundsRequired(threshold: number, participants: number): number
  • Let's us know how many times participants must exchange information after the initial exchange

    Parameters

    • threshold: number

      the number of participants required to construct a new transaction

    • participants: number

      the wallet participants

    Returns number

    the number of additional exchange rounds required

Static fromAddress

  • fromAddress(wallet: Address, threshold: number, participants: number): Multisig
  • Initializes an initial multisig object using our address information

    Parameters

    • wallet: Address

      our base wallet used to create the wallet

    • threshold: number

      the number of participants required to construct a new transaction

    • participants: number

      the wallet participants

    Returns Multisig

    a new instance of the object

Static fromMultisigKeys

  • fromMultisigKeys(multisig_private_keys: string[], sharedPrivateViewKey: string, threshold: number, participants: number): Multisig
  • Initializes a multisig object using our previously generated multisig private keys

    Parameters

    • multisig_private_keys: string[]

      the previously generated multisig private keys

    • sharedPrivateViewKey: string

      the previously calculated view private key

    • threshold: number

      the number of participants required to construct a new transaction

    • participants: number

      the wallet participants

    Returns Multisig

    a new instance of the object

Static isValidThreshold

  • isValidThreshold(threshold: number, participants: number): boolean
  • Returns if the given M:N scheme is valid for this library

    Parameters

    • threshold: number

      the number of participants required to construct a new transaction

    • participants: number

      the wallet participants

    Returns boolean

    if the given scheme is valid for this library

Static requiredSigningKeys

  • requiredSigningKeys(threshold: number, participants: number): number
  • Returns the total number of signing keys created using the M:N values supplied

    Parameters

    • threshold: number

      the number of participants required to construct a new transaction

    • participants: number

      the wallet participants

    Returns number

    the total number of signing keys created

Static restoreKeyImage

  • restoreKeyImage(publicEphemeral: string, derivation: string, outputIndex: number, partialKeyImages: string[]): Promise<string>
  • Restores a key image from partial key images

    Parameters

    • publicEphemeral: string

      the key image public emphermal

    • derivation: string

      the key input derivation

    • outputIndex: number

      the key input output index

    • partialKeyImages: string[]

      the partial key images

    Returns Promise<string>

    the restored key image

Generated using TypeDoc