<p>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.</p>

<p>You can create the script yourself and import it into a wallet using <code>importmulti</code>. 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.</p>

CC BY-SA 4.0
2020-03-14T16:16:42.870Z
what are the standard script? P2PK P2PKH and so on? https://bitcoin.org/en/transactions-guide#standard-transactions
monkeyUser
CC BY-SA 4.0
2020-03-14T17:37:57.283Z
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).
Ava Chow
CC BY-SA 4.0
2020-03-14T17:45:12.153Z
nice and with these address I can use `signrawtransactionwithkey`? instead with customscript I need to create signature by hand?
monkeyUser
CC BY-SA 4.0
2020-03-15T01:14:08.640Z
Yes. With custom scripts you will need to sign and construct the final scriptSig by hand.
Ava Chow
CC BY-SA 4.0
2020-03-07T15:02:14.247Z
2020-03-07T15:02:14.247Z
Ava Chow
<p>I'm able to create multisig with bitcoin-cli with <code>addmultisigaddress</code></p>

<pre><code>bitcoin-cli addmultisigaddress 2 '["'$ADDR_MITT_1'","'$ADDR_MITT_2'","'$ADDR_MITT_3'"]'
</code></pre>

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

<bitcoin-core><script><multi-signature><bitcoin-cli>
Create Custom script from bitcoind
monkeyUser
# Create Custom script from bitcoind

(Asked by: username_0 on 2020-03-06)

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?

**Tags:** bitcoin-core, script, multi-signature, bitcoin-cli


---

## 1 answers

### Answer by username_1 on 2020-03-07. Score: 3 | Accepted answer

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.

> **Comments:**
> **username_0**: what are the standard script? P2PK P2PKH and so on? https://bitcoin.org/en/transactions-guide#standard-transactions  
> **username_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).  
> **username_0**: nice and with these address I can use `signrawtransactionwithkey`? instead with customscript I need to create signature by hand?  
> **username_1**: Yes. With custom scripts you will need to sign and construct the final scriptSig by hand.  

---

