<p>In this approach, Bitcoin Core is used to create the transaction offline without the hassle of manually creating the transaction:</p>
<p><a href="https://bitcoin.stackexchange.com/questions/98715/how-to-move-sweep-your-bitcoin-core-bitcoins-safely-and-air-gapped-to-your-new-f/99354#99354">How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?</a></p>

CC BY-SA 4.0
2021-03-22T16:39:36.147Z
2021-03-22T16:39:36.147Z
hodddl
<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki" rel="nofollow noreferrer">Partialy Signed Bitcoin Transactions (PSBTs)</a> cover most of your requirements.
PSBTs however require for the <a href="https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#signer" rel="nofollow noreferrer">Signer</a> to have the full UTXO, not just the Transaction ID, Output index and Amount.</p>
<p>There are many libraries that support PSBTs or simple Transaction creation &amp; signing. You do not need to connect to a full Bitcoin node to use them.</p>
<p>The one that I have used most is <a href="https://github.com/bitcoinjs/bitcoinjs-lib" rel="nofollow noreferrer">Bitcoin JS</a>. It has a clean API, <a href="https://github.com/bitcoinjs/bitcoinjs-lib#documentation" rel="nofollow noreferrer">good documentation</a> and unit tests that you can use as examples. You can export the transaction in Hex format, ready for broadcast.</p>
<p>It also has a <a href="https://bitcoincore.tech/apps/bitcoinjs-ui/index.html" rel="nofollow noreferrer">Web UI for PSBT and Transaction</a> creation and signing. If you want to build your Transactions offline you can just clone the <a href="https://github.com/bitcoincoretech/bitcoinjs-ui" rel="nofollow noreferrer">GitHub repo</a> and open the <code>index.html</code> file.</p>
<p><strong>Disclaimer</strong>: I am a contributor for the <a href="https://bitcoincore.tech/apps/bitcoinjs-ui/index.html" rel="nofollow noreferrer">Web UI</a></p>

CC BY-SA 4.0
2021-03-02T08:25:38.423Z
2021-03-02T08:25:38.423Z
Vlad Stan
<p>I mean generating the transaction itself offline, assuming I know in advance how much bitcoin a UTXO has. In other words, without querying the network for the UTXO balance.</p>
<p>Then I also need to sign that tx, also offline.</p>
<p>And finally I can pass the signed tx to someone via bluetooth, and then he can drive to an Internet connection, and broadcast the tx.</p>
<p>I'm pretty sure there isn't a wallet that does this, so this needs to be some special script or a sequence of cli commands</p>

<raw-transaction><offline>
Is there a way to create a tx completely offline? Maybe with a script or cli commands?
Pineapple29
# Is there a way to create a tx completely offline? Maybe with a script or cli commands?

(Asked by: username_0 on 2021-03-01)

I mean generating the transaction itself offline, assuming I know in advance how much bitcoin a UTXO has. In other words, without querying the network for the UTXO balance.

Then I also need to sign that tx, also offline.

And finally I can pass the signed tx to someone via bluetooth, and then he can drive to an Internet connection, and broadcast the tx.

I'm pretty sure there isn't a wallet that does this, so this needs to be some special script or a sequence of cli commands

**Tags:** raw-transaction, offline


---

## 2 answers

### Answer by username_1 on 2021-03-22. Score: 1

In this approach, Bitcoin Core is used to create the transaction offline without the hassle of manually creating the transaction:

[How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?](https://bitcoin.stackexchange.com/questions/98715/how-to-move-sweep-your-bitcoin-core-bitcoins-safely-and-air-gapped-to-your-new-f/99354#99354)


---

### Answer by username_2 on 2021-03-02. Score: 0

[Partialy Signed Bitcoin Transactions (PSBTs)](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki) cover most of your requirements.
PSBTs however require for the [Signer](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki#signer) to have the full UTXO, not just the Transaction ID, Output index and Amount.

There are many libraries that support PSBTs or simple Transaction creation & signing. You do not need to connect to a full Bitcoin node to use them.

The one that I have used most is [Bitcoin JS](https://github.com/bitcoinjs/bitcoinjs-lib). It has a clean API, [good documentation](https://github.com/bitcoinjs/bitcoinjs-lib#documentation) and unit tests that you can use as examples. You can export the transaction in Hex format, ready for broadcast.

It also has a [Web UI for PSBT and Transaction](https://bitcoincore.tech/apps/bitcoinjs-ui/index.html) creation and signing. If you want to build your Transactions offline you can just clone the [GitHub repo](https://github.com/bitcoincoretech/bitcoinjs-ui) and open the `index.html` file.

**Disclaimer**: I am a contributor for the [Web UI](https://bitcoincore.tech/apps/bitcoinjs-ui/index.html)


---

