<p>Transactions with more than one <code>OP_RETURN</code> are non-standard and would not be relayed by most of the network.</p>
<p>That said using the <code>rust-bitcoin</code> library, which i understand you are using already, you can simply append more outputs to the inner transaction and to the PSBT.</p>

CC BY-SA 4.0
2023-12-31T16:25:31.107Z
Ah interesting, am I then limited to the 40 bytes of op_return? Your second solution doesn’t work as the additional op_return output will increase the cost of the tx no?
David 天宇 Wong
CC BY-SA 4.0
2024-01-02T17:34:45.413Z
I think the op_return output’s output script can have up to 83 bytes and be considered standard.
Murch
CC BY-SA 4.0
2023-12-31T11:51:43.553Z
2023-12-31T11:51:43.553Z
Antoine Poinsot
<p>I want to fund a PSBT transaction that I created with Bitcoin rust.</p>
<p>It looks like there is no such function to do that as the Creator is the only one that can set the inputs and outputs.</p>
<p>There is an API with Bitcoin Core rpc called <code>walletcreatefundedpsbt</code> but unfortunately it only accepts a single op_return data field.</p>
<p>What can I do?</p>

<bitcoind><op-return><bip174-psbt><non-standard-transaction><rust-bitcoin>
How can I add more OP_RETURN outputs to a PSBT transaction?
David 天宇 Wong
# How can I add more OP_RETURN outputs to a PSBT transaction?

(Asked by: username_0 on 2023-12-31)

I want to fund a PSBT transaction that I created with Bitcoin rust.

It looks like there is no such function to do that as the Creator is the only one that can set the inputs and outputs.

There is an API with Bitcoin Core rpc called `walletcreatefundedpsbt` but unfortunately it only accepts a single op\_return data field.

What can I do?

**Tags:** bitcoind, op-return, bip174-psbt, non-standard-transaction, rust-bitcoin


---

## 1 answers

### Answer by username_1 on 2023-12-31. Score: 2

Transactions with more than one `OP_RETURN` are non-standard and would not be relayed by most of the network.

That said using the `rust-bitcoin` library, which i understand you are using already, you can simply append more outputs to the inner transaction and to the PSBT.

> **Comments:**
> **username_0**: Ah interesting, am I then limited to the 40 bytes of op_return? Your second solution doesn’t work as the additional op_return output will increase the cost of the tx no?  
> **username_2**: I think the op_return output’s output script can have up to 83 bytes and be considered standard.  

---

