The difference of type=multisig and type=scripthash in scriptPubKey

Tokenview.io
2 min readApr 12, 2024

--

In Bitcoin scripting, both `type=multisig` and `type=scripthash` refer to different types of locking scripts (scriptPubKeys) used in transactions.

1. `type=multisig`: This refers to a locking script that involves multiple public keys and requires a certain number of signatures (specified during script creation) to unlock the funds. In other words, it’s a multisignature script, commonly used for shared control over funds, like in joint accounts or corporate wallets. The scriptPubKey typically includes all the public keys involved and specifies the required number of signatures.

In the above picture, the desc is “multi(1, xx, xx, xx)”, and the type is “multisig”. The funds of the above output will be unlocked by any of the 1/3 public keys when spending out. Normally, this type of address either is displayed as a group of 3 addresses, or a single unknown address on blockchain explorer.

2. `type=scripthash`: This refers to a locking script where the actual script required to unlock the funds is not directly included in the output scriptPubKey but is instead hashed and included. This allows for more complex scripting possibilities without bloating the blockchain. The redeeming script is then provided separately during the spending transaction, and it must hash to the same value as the one in the scriptPubKey. This is commonly used for various smart contract applications or for implementing more complex spending conditions.

In the above picture, type=”scripthash”. If the funds in address 36KA needs to be spent out, it will be unlocked by a locking script, not a simple pub key’s signature. The unlocking script could be anything, including multisignature conditions, time-locked conditions, or other custom smart contract logic. So normally this address will be displayed apparently without any “in-depth” parsing logic on blockchain explorer.

In summary, `type=multisig` is specifically for multisignature scripts, while `type=scripthash` is a more general category for scripts where the actual redeeming script is hashed and included in the output scriptPubKey.

--

--

Tokenview.io

Our mission is to build Freedom Safe Easy Web3/Crypto world. visit us at https://tokenview.io for General Multi-chain Explorer and Blockchain APIs entrance.