Multisignature Transaction Creation and Walkthrough

Introduction

Multisignature (multisig) is a technology used to increase the number of signatures required for a transaction from an address. This provides an additional layer of security to cryptocurrency transactions.

In this guide we demonstrate the creation and usage of a 2of2 multisignature wallet. We use two nodes with the DIC main chain.

To accomplish the same task on another Indexchain Smart Chain, add -ac_name=NAMEOFCHAIN to each command.

Get a New Address, Public Key, and Private Key

Create addresses on two nodes. We will combine these two addresses into a single multisig address.

Node One

Generate a New Address

Command

./komodo-cli getnewaddress

Response

RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5

Get the Public Key Using validateaddress

Command

./komodo-cli validateaddress RDomQ4tftJGjcHBVpAUx549jZfxtJx74r5

Response

Get the Private Key

Command

Response

A Summarization of Data from Node One

Node Two

Follow the same steps.

Generate a New Address

Command

Response

Get the Pubkey Value Using validateaddress

Command

Response

Get the Private Key

Command

Response

Summarization of Data From Node Two

Create a Multisig Address

Combine the pubkeys to create a 2of2 multisig address.

A 2of2 address requires that both addresses sign for every transaction.

::: tip

You can customize the signature requirements for essentially any combination. For example, you can make a 3of5 multisig address that requires 3 of 5 available addresses for each transaction.

:::

Execute the following command on either node. The command returns the redeemScript json object, which is required to spend funds.

Command

Response

Fund the multisig Address

Fund the multisig address.

(You may use either node.)

Command

Response

Create the Raw Transaction

As input we use the unspent vout of the transaction used to create the multisig address. We also place our desired target destination address in the transaction.

In this example, we send the full 7.77 sum to the destination address.

If you do not want to send the full amount, you must manually specify the "change" address and state how much of the change you desire to keep.

Recall that any amount taken from the initial utxo and not included in either the destination address, or in the change address, will automatically be given to the miners as a mining fee.

Command

Response

Sign the Raw Transaction

Sign the raw transaction using both nodes.

Sign Using Node One

Command

Response

Sign Using Node Two

Use the hex value from node one, but change the privkey to the privkey of node two's address.

Command

Response

Broadcast the transaction

Broadcast the raw hex to finish send the transaction.

Command

Response

The above is the output txid which can be used in an online DIC block explorer to verify the transaction.

Last updated

Was this helpful?