<p>You can create any kind of script spend with bcoin but for taproot you will need to use the <a href="https://github.com/bcoin-org/bcoin/tree/taproot" rel="nofollow noreferrer">taproot branch</a> which has not yet been sufficiently reviewed or released. You can follow along with <a href="https://github.com/bcoin-org/bcoin/blob/taproot/test/taproot-check-test.js#L110" rel="nofollow noreferrer">this test</a> to learn how to add a script to a taproot tree, derive the address, send BTC to it and then spend it, revealing the witness</p>

CC BY-SA 4.0
2023-02-19T00:27:59.943Z
2023-02-19T00:27:59.943Z
pinhead
<p>According to</p>
<p><a href="https://bitcoin.stackexchange.com/questions/117018/understanding-how-ordinals-work-with-the-bitcoin-blockchain-what-is-exactly-sto">Understanding how ordinals work with the Bitcoin blockchain. What is exactly stored on the blockchain?</a></p>
<p>you can add data to the unexecuted branch of a taproot input like so:</p>
<pre><code>OP_0
OP_IF
(embedded data comes here)
OP_ENDIF
</code></pre>
<p>How would I go about creating such transaction using bcoin or btcwallet?</p>

<bcoin><btcd><ordinals>
Can I create an ordinals-like transaction using bcoin / btcwallet?
tuxcanfly
# Can I create an ordinals-like transaction using bcoin / btcwallet?

(Asked by: username_0 on 2023-02-18)

According to

[Understanding how ordinals work with the Bitcoin blockchain. What is exactly stored on the blockchain?](https://bitcoin.stackexchange.com/questions/117018/understanding-how-ordinals-work-with-the-bitcoin-blockchain-what-is-exactly-sto)

you can add data to the unexecuted branch of a taproot input like so:

```
OP_0
OP_IF
(embedded data comes here)
OP_ENDIF

```

How would I go about creating such transaction using bcoin or btcwallet?

**Tags:** bcoin, btcd, ordinals


---

## 1 answers

### Answer by username_1 on 2023-02-19. Score: 2

You can create any kind of script spend with bcoin but for taproot you will need to use the [taproot branch](https://github.com/bcoin-org/bcoin/tree/taproot) which has not yet been sufficiently reviewed or released. You can follow along with [this test](https://github.com/bcoin-org/bcoin/blob/taproot/test/taproot-check-test.js#L110) to learn how to add a script to a taproot tree, derive the address, send BTC to it and then spend it, revealing the witness


---

