<p>Yes, it's even easier using Bitcoin Core 0.21.0, descriptors and PSBTs.</p>
<p><strong>How to spend/sweep <code>p2pkh</code> UTXOs air-gapped using Bitcoin Core's 0.21.0 GUI and PSBTs.</strong></p>
<p>Here are the required steps, many of them have to be entered into Bitcoin Core's <code>console</code>.</p>
<p><strong>OFFLINE</strong>
(best to use a laptop booted from a Ubuntu USB-stick and no internet connected)</p>
<ul>
<li><p>export the descriptor of the <code>p2pkh</code> address: <pre> getaddressinfo ADDRESS</pre></p>
</li>
<li><p>copy the <code>&quot;desc&quot;: &quot;pkh([....&quot;,</code> output to the ONLINE computer</p>
</li>
</ul>
<p><strong>ONLINE</strong></p>
<ul>
<li>optional: create a new wallet in Bitcoin Core</li>
<li>import the descriptor from above into Bitcoin Core: <pre> importmulti '[{ &quot;desc&quot;: &quot;pkh([....&quot;, &quot;timestamp&quot;:0, &quot;label&quot;:&quot;import&quot;, &quot;watchonly&quot;:true }]'</pre></li>
<li>optional: check that the following is now <code>&quot;solvable&quot;</code>: <pre> getaddressinfo ADDRESS</pre></li>
<li>now create the unsigned PSBT using Bitcoin Core's GUI: &quot;Send&quot;, &quot;Create Unsigned&quot;, &quot;Create Unsigned&quot; and &quot;Save&quot;</li>
<li>copy the file containing the unsigned PSBT to the OFFLINE computer</li>
</ul>
<p><strong>OFFLINE</strong></p>
<ul>
<li>if needed unlock your wallet <pre>walletpassphrase &quot;YOUR_WALLET-PASSWORD&quot; 600</pre></li>
<li>now import the file from above and sign the unsigned PSBT using Bitcoin Core's GUI: &quot;File-&gt;Load PSBT from file&quot;</li>
<li>double check the transaction and &quot;Sign Tx&quot;</li>
<li>then select &quot;Copy to Clipboard&quot;</li>
<li>copy this <code>hex</code> output (now in your Clipboard) from above to your ONLINE computer</li>
</ul>
<p><strong>ONLINE</strong></p>
<ul>
<li>send the raw transaction using <pre>sendrawtransaction HEX-FROM-ABOVE</pre></li>
<li>optional: copy the raw transaction into an block explorer like <a href="https://blockstream.info/tx/push" rel="nofollow noreferrer">blockstream.info</a> instead</li>
</ul>
<p>Done!</p>
<p>Feedback is welcome!</p>

CC BY-SA 4.0
2021-01-18T11:46:10.523Z
2021-01-18T11:46:10.523Z
hodddl
<p><strong>Update Aug 1, 2021</strong>: this answer covers Bitcoin Core &lt;= 0.20.1.
For Bitcoin Core &gt;= 0.21.0 using the GUI-integration for PSBTs check the <a href="https://bitcoin.stackexchange.com/a/101595/109416">second answer</a>.</p>
<p>Yes, it's possible using descriptors and PSBTs.</p>
<p><strong>How to spend/sweep <code>p2pkh</code> UTXOs air-gapped using Bitcoin Core's GUI and  PSBTs.</strong></p>
<p>Here are the required steps, most of them have to be entered into Bitcoin Core's console.</p>
<p><strong>OFFLINE</strong></p>
<ul>
<li><p>export the descriptor of the <code>p2pkh</code> address: <pre> getaddressinfo ADDRESS</pre></p>
</li>
<li><p>copy the <code>&quot;desc&quot;: &quot;pkh([....&quot;,</code> output to the ONLINE computer</p>
</li>
</ul>
<p><strong>ONLINE</strong></p>
<ul>
<li>optional: create a new wallet in Bitcoin Core</li>
<li>import the descriptor from above into Bitcoin Core: <pre> importmulti '[{ &quot;desc&quot;: &quot;pkh([....&quot;, &quot;timestamp&quot;:0, &quot;label&quot;:&quot;import&quot;, &quot;watchonly&quot;:true }]'</pre></li>
<li>optional: check that the following is now <code>&quot;solvable&quot;</code>: <pre> getaddressinfo ADDRESS</pre></li>
<li>now create the unsigned PSBT using Bitcoin Core's GUI</li>
<li>copy the unsigned PSBT (YOUR-PSBT) to the OFFLINE computer</li>
</ul>
<p><strong>OFFLINE</strong></p>
<ul>
<li>if needed unlock your wallet <pre>walletpassphrase &quot;YOUR_WALLET-PASSWORD&quot; 600</pre></li>
<li>optional: check the PSBT <pre> decodepsbt YOUR-PSBT</pre> and <pre> analyzepsbt YOUR-PSBT</pre></li>
<li>sign your PSBT: <pre>walletprocesspsbt YOUR-PSBT</pre></li>
<li>finalize your PSBT: <pre>finalizepsbt OUTPUT-FROM-WALLETPROCESSPSBT-ABOVE</pre></li>
<li>copy the <code>hex</code> output from above to your ONLINE computer</li>
</ul>
<p><strong>ONLINE</strong></p>
<ul>
<li>send the raw transaction using <pre>sendrawtransaction HEX-FROM-ABOVE</pre></li>
<li>optional: copy the raw transaction into an block explorer like <a href="https://blockstream.info/tx/push" rel="nofollow noreferrer">blockstream.info</a> instead</li>
</ul>
<p>Done!</p>
<p>Feedback is welcome!</p>

CC BY-SA 4.0
2021-07-15T21:43:39.097Z
Hi hodddl, am i understanding correctly that the difference between your two answers is that one is CLI-based and the other GUI-based? I think it might make sense to combine them both in one answer where give both variants for the offline step, as the two answers do not look obviously different to a skimming reader in the first place.
Murch
CC BY-SA 4.0
2021-07-28T13:21:41.550Z
Hi Murch, thank you for your feedback.
The first answer covers Bitcoin Core <= 0.20.1 and required a lot of CLI commands. 
The second answer is an update covering Bitcoin Core >= 0.21.0 using the GUI-integration for PSBTs.
hodddl
CC BY-SA 4.0
2021-07-28T17:16:04.980Z
Maybe you could add a little pointer at the top of this answer in which case people should read the other answer instead. :)
Murch
CC BY-SA 4.0
2020-10-06T11:12:48.867Z
2021-08-01T05:58:28.880Z
2021-08-01T05:58:28.880Z
hodddl
<p>With Bitcoin Core 22.0 it is even easier since it adds the command &quot;listdescriptors&quot;.</p>
<p>OFFLINE:</p>
<ul>
<li>Create a wallet with descriptors true.</li>
<li>In console type: listdescriptors.</li>
<li>Copy the desired descriptors.
( You will see descriptors with internal:false and internal:true. Internal false will provide the information needed for the watch-only wallet to generate receiving addresses while internal true is for the change addresses).</li>
</ul>
<p>ONLINE:</p>
<ul>
<li>Create a watch only</li>
<li>Import descriptors with the command &quot;importdescriptors&quot;</li>
</ul>
<p>After this the watch wallet only it is fully functional allowing  to receive payments and create unsigned transactions.</p>
<p>For payments:</p>
<p>ONLINE:
Create Unsigned, save the PSBT file</p>
<p>OFFLINE:
File→Load PSBT from file and sign</p>
<p>ONLINE:
File→Load psbt from file and broadcast signed tx</p>

CC BY-SA 4.0
2022-09-21T15:29:46.917Z
Are you sure that this will work with an old (OFFLINE) P2PKH-only addresses wallet?
hodddl
CC BY-SA 4.0
2022-04-16T14:33:25.520Z
2022-04-16T14:33:25.520Z
TracaChang
<p>I have stored my bitcoins on Bitcoin Core in a few P2PKH addresses with many UTXOs. I would like to have a plan, how these bitcoins can be moved air-gapped to a more up-to-date setup (not discussed here).</p>
<p>I have not touched this computer (OFFLINE) for many years and I am afraid to connect it to the internet.</p>
<p>I assume that I need to have access to the lastest UTXO set and then create air-gapped transactions. But how exactly can this be done?</p>
<p>Is it possible to setup a Bitcoin Core on another online computer (ONLINE) and import the addresses using &quot;importaddress&quot;?
<br/>
<b>Is it (and how) possible to create an unsigned transaction on this ONLINE computer including all UTXOs of one of the imported (watch-only) addresses?</b>
<br/>
And then move this unsigned transaction to the old offline computer (OFFLINE) with the old wallet.dat file and sign the transaction?</p>
<p>Is this possible or is there another way to do this air-gapped?</p>
<p>Has anyone documented all the necessary steps?</p>
<p>Thanks for your help!</p>
<p>-A frightened hodler</p>

CC BY-SA 4.0
2020-08-26T18:40:02.030Z
Thank you. But manually creating a transaction with many inputs seems too error-prone to me. Is this possible using the GUI?
hodddl
CC BY-SA 4.0
2020-08-27T05:56:13.570Z
Yes, that's my idea. But is this really possible using Bitcoin Core? Are you aware of any documentation/videos?
hodddl
CC BY-SA 4.0
2020-09-15T12:14:33.343Z
@Prayank I tried and I am stuck here: I've done `importaddress` on the ONLINE computer, `getaddressinfo` shows that the address is `iswatchonly`, not `ismine` and not `solvable`. What do I have to do now to create an unsigned PSBT tx using the GUI?
hodddl
CC BY-SA 4.0
2020-09-18T16:06:29.183Z
By setting up a wallet with disabled private keys and importing the `p2pkh` address using `importmulti` it's now possible to click on `Create Unsigned` but I'm now stuck like you at [The amount exceeds your balance](https://bitcoin.stackexchange.com/questions/99046/how-to-create-unsigned-tx-in-a-watch-only-wallet) Have you managed to get it to work? I guess the issues is somehow the missing output script. How can I import it?
hodddl
CC BY-SA 4.0
2020-09-22T10:24:09.917Z
@Prayank Great. But how do you create a descriptor when using a `p2pkh` address?
hodddl
CC BY-SA 4.0
2020-09-22T14:12:47.460Z
@Prayank Thank you, but `getaddressinfo` does not return the `pubkey` required by  `getdescriptorinfo`. Did you manage to test it using a `p2pkh`address?
hodddl
<p2pkh><sweep>
How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?
hodddl
# How to move/sweep your Bitcoin Core bitcoins safely and air-gapped to your new fancy cold storage?

(Asked by: username_0 on 2020-08-26)

I have stored my bitcoins on Bitcoin Core in a few P2PKH addresses with many UTXOs. I would like to have a plan, how these bitcoins can be moved air-gapped to a more up-to-date setup (not discussed here).

I have not touched this computer (OFFLINE) for many years and I am afraid to connect it to the internet.

I assume that I need to have access to the lastest UTXO set and then create air-gapped transactions. But how exactly can this be done?

Is it possible to setup a Bitcoin Core on another online computer (ONLINE) and import the addresses using "importaddress"?
  
**Is it (and how) possible to create an unsigned transaction on this ONLINE computer including all UTXOs of one of the imported (watch-only) addresses?**
  
And then move this unsigned transaction to the old offline computer (OFFLINE) with the old wallet.dat file and sign the transaction?

Is this possible or is there another way to do this air-gapped?

Has anyone documented all the necessary steps?

Thanks for your help!

-A frightened hodler

**Tags:** p2pkh, sweep

> **Comments:**
> **username_0**: Thank you. But manually creating a transaction with many inputs seems too error-prone to me. Is this possible using the GUI?  
> **username_0**: Yes, that's my idea. But is this really possible using Bitcoin Core? Are you aware of any documentation/videos?  
> **username_0**: @Prayank I tried and I am stuck here: I've done `importaddress` on the ONLINE computer, `getaddressinfo` shows that the address is `iswatchonly`, not `ismine` and not `solvable`. What do I have to do now to create an unsigned PSBT tx using the GUI?  
> **username_0**: By setting up a wallet with disabled private keys and importing the `p2pkh` address using `importmulti` it's now possible to click on `Create Unsigned` but I'm now stuck like you at [The amount exceeds your balance](https://bitcoin.stackexchange.com/questions/99046/how-to-create-unsigned-tx-in-a-watch-only-wallet) Have you managed to get it to work? I guess the issues is somehow the missing output script. How can I import it?  
> **username_0**: @Prayank Great. But how do you create a descriptor when using a `p2pkh` address?  
> **username_0**: @Prayank Thank you, but `getaddressinfo` does not return the `pubkey` required by  `getdescriptorinfo`. Did you manage to test it using a `p2pkh`address?  

---

## 3 answers

### Answer by username_0 on 2021-01-18. Score: 1 | Accepted answer

Yes, it's even easier using Bitcoin Core 0.21.0, descriptors and PSBTs.

**How to spend/sweep `p2pkh` UTXOs air-gapped using Bitcoin Core's 0.21.0 GUI and PSBTs.**

Here are the required steps, many of them have to be entered into Bitcoin Core's `console`.

**OFFLINE**
(best to use a laptop booted from a Ubuntu USB-stick and no internet connected)

* export the descriptor of the `p2pkh` address:

  ```
   getaddressinfo ADDRESS
  ```
* copy the `"desc": "pkh([....",` output to the ONLINE computer

**ONLINE**

* optional: create a new wallet in Bitcoin Core
* import the descriptor from above into Bitcoin Core:

  ```
   importmulti '[{ "desc": "pkh([....", "timestamp":0, "label":"import", "watchonly":true }]'
  ```
* optional: check that the following is now `"solvable"`:

  ```
   getaddressinfo ADDRESS
  ```
* now create the unsigned PSBT using Bitcoin Core's GUI: "Send", "Create Unsigned", "Create Unsigned" and "Save"
* copy the file containing the unsigned PSBT to the OFFLINE computer

**OFFLINE**

* if needed unlock your wallet

  ```
  walletpassphrase "YOUR_WALLET-PASSWORD" 600
  ```
* now import the file from above and sign the unsigned PSBT using Bitcoin Core's GUI: "File->Load PSBT from file"
* double check the transaction and "Sign Tx"
* then select "Copy to Clipboard"
* copy this `hex` output (now in your Clipboard) from above to your ONLINE computer

**ONLINE**

* send the raw transaction using

  ```
  sendrawtransaction HEX-FROM-ABOVE
  ```
* optional: copy the raw transaction into an block explorer like [blockstream.info](https://blockstream.info/tx/push) instead

Done!

Feedback is welcome!


---

### Answer by username_0 on 2020-10-06. Score: 2

**Update Aug 1, 2021**: this answer covers Bitcoin Core <= 0.20.1.
For Bitcoin Core >= 0.21.0 using the GUI-integration for PSBTs check the [second answer](https://bitcoin.stackexchange.com/a/101595/109416).

Yes, it's possible using descriptors and PSBTs.

**How to spend/sweep `p2pkh` UTXOs air-gapped using Bitcoin Core's GUI and PSBTs.**

Here are the required steps, most of them have to be entered into Bitcoin Core's console.

**OFFLINE**

* export the descriptor of the `p2pkh` address:

  ```
   getaddressinfo ADDRESS
  ```
* copy the `"desc": "pkh([....",` output to the ONLINE computer

**ONLINE**

* optional: create a new wallet in Bitcoin Core
* import the descriptor from above into Bitcoin Core:

  ```
   importmulti '[{ "desc": "pkh([....", "timestamp":0, "label":"import", "watchonly":true }]'
  ```
* optional: check that the following is now `"solvable"`:

  ```
   getaddressinfo ADDRESS
  ```
* now create the unsigned PSBT using Bitcoin Core's GUI
* copy the unsigned PSBT (YOUR-PSBT) to the OFFLINE computer

**OFFLINE**

* if needed unlock your wallet

  ```
  walletpassphrase "YOUR_WALLET-PASSWORD" 600
  ```
* optional: check the PSBT

  ```
   decodepsbt YOUR-PSBT
  ```

  and

  ```
   analyzepsbt YOUR-PSBT
  ```
* sign your PSBT:

  ```
  walletprocesspsbt YOUR-PSBT
  ```
* finalize your PSBT:

  ```
  finalizepsbt OUTPUT-FROM-WALLETPROCESSPSBT-ABOVE
  ```
* copy the `hex` output from above to your ONLINE computer

**ONLINE**

* send the raw transaction using

  ```
  sendrawtransaction HEX-FROM-ABOVE
  ```
* optional: copy the raw transaction into an block explorer like [blockstream.info](https://blockstream.info/tx/push) instead

Done!

Feedback is welcome!

> **Comments:**
> **username_1**: Hi username_0, am i understanding correctly that the difference between your two answers is that one is CLI-based and the other GUI-based? I think it might make sense to combine them both in one answer where give both variants for the offline step, as the two answers do not look obviously different to a skimming reader in the first place.  
> **username_0**: Hi username_1, thank you for your feedback. The first answer covers Bitcoin Core <= 0.20.1 and required a lot of CLI commands.  The second answer is an update covering Bitcoin Core >= 0.21.0 using the GUI-integration for PSBTs.  
> **username_1**: Maybe you could add a little pointer at the top of this answer in which case people should read the other answer instead. :)  

---

### Answer by username_2 on 2022-04-16. Score: 0

With Bitcoin Core 22.0 it is even easier since it adds the command "listdescriptors".

OFFLINE:

* Create a wallet with descriptors true.
* In console type: listdescriptors.
* Copy the desired descriptors.
  ( You will see descriptors with internal:false and internal:true. Internal false will provide the information needed for the watch-only wallet to generate receiving addresses while internal true is for the change addresses).

ONLINE:

* Create a watch only
* Import descriptors with the command "importdescriptors"

After this the watch wallet only it is fully functional allowing to receive payments and create unsigned transactions.

For payments:

ONLINE:
Create Unsigned, save the PSBT file

OFFLINE:
File→Load PSBT from file and sign

ONLINE:
File→Load psbt from file and broadcast signed tx

> **Comments:**
> **username_0**: Are you sure that this will work with an old (OFFLINE) P2PKH-only addresses wallet?  

---

