I'm able to create multisig with bitcoin-cli with addmultisigaddress

bitcoin-cli addmultisigaddress 2 '["'$ADDR_MITT_1'","'$ADDR_MITT_2'","'$ADDR_MITT_3'"]'

But How can I add extra OP like CLTV or another OP? Can I use bitcoin-cli to generate redeemscript and address?


You cannot. Bitcoin Core cannot reason about arbitrary scripts and does not have the capability to sign for them. As such, it cannot create arbitrary scripts and store them.

You can create the script yourself and import it into a wallet using importmulti. This will only add the script to the wallet to be tracked. This will only let your wallet see transactions and compute a balance. Again, Bitcoin Core cannot sign for arbitrary scripts, it does not know how to. So importing a script does not mean that the wallet will be able to sign transactions that use that script. It is purely for transaction tracking.

  • super clear, thanks – monkeyUser Mar 7 '20 at 15:15
  • what are the standard script? P2PK P2PKH and so on? bitcoin.org/en/transactions-guide#standard-transactions – monkeyUser Mar 14 '20 at 16:16
  • 1
    The scripts that Bitcoin Core can reason about are P2PK, P2PKH, Multisig, P2WPKH, P2SH containing the previous scripts, P2WSH containing the previous except P2SH (P2SH cannot be contained within a P2WSH). – Andrew Chow Mar 14 '20 at 17:37
  • nice and with these address I can use signrawtransactionwithkey? instead with customscript I need to create signature by hand? – monkeyUser Mar 14 '20 at 17:45
  • 1
    Yes. With custom scripts you will need to sign and construct the final scriptSig by hand. – Andrew Chow Mar 15 '20 at 1:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.