Skip to main content

secp256k1_blake160_multisig_all

One of the CKB genesis Scripts, SECP256K1/multisig (Source Code, is a Lock Script which enables a group of users to collectively sign a single transaction. It is designed to support:

  • Multiple signature verification
  • Time-lock functionalities for Cells.

How It Works

This Script prepares the signing message in a way that is similar – but not identical – to the single signing script.

The main difference lies in how the lock field of the first witness is interpreted. It is treated as a WitnessArgs object with the following structure:

multisig_script: S | R | M | N | PubKeyHash1 | PubKeyHash2 | ...
DescriptionBytes
Sreserved field, must be zero1
Rfirst nth public keys must match1
Mthreshold1
Ntotal public keys1
PubkeyHashNblake160 hash of compressed pubkey20
SignatureNrecoverable signature65

To preserve the Script size, this Lock Script uses a scheme similar to Bitcoin's P2SH. Instead of including the full multisig_script in the Script itself, it only includes the blake160 hash of the multisig_script in the args field. This way, no matter how many public keys or signatures are involved, the Script's on-chain size stays fixed. One implication is that the multisig_script content must not change, since its hash is already fixed in the Script's args.

Reference RFC

Using CKB-C-STDLIB

This Script requires a few C header files. We now maintain a new ckb-c-stdlib repository, which contains most of these headers. If you are building a new Script, we recommend using the code from that repository directly.

Deployment

  • Mainnet
parametervalue
code_hash0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8
hash_typetype
tx_hash0x71a7ba8fc96349fea0ed3a5c47992e3b4084b031a42264a018e0072e8172e46c
index0x1
dep_typedep_group
  • Testnet
parametervalue
code_hash0x5c5069eb0857efc65e1bca0c07df34c31663b3622fd3876c876320fc9634e2a8
hash_typetype
tx_hash0xf8de3bb47d055cdf460d93a2a6e1b05f7432f9777c8c474abf4eec1d4aee5d37
index0x1
dep_typedep_group