Skip to content

Conversation

BrandonOdiwuor
Copy link
Contributor

@BrandonOdiwuor BrandonOdiwuor commented Aug 29, 2023

This PR adds offline signing tutorial. Fixes #9492

Although there currently exists tutorials on external-signer and on multisig implemented on #24519 . The external-signer tutorial assumes a connected device and the multisig tutorial is only for multisig transactions and does not include using an offline wallet

  • The tutorial uses signet(instead of regtest) to be as close as possible to mainnet

@DrahtBot
Copy link
Contributor

DrahtBot commented Aug 29, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Code Coverage

For detailed information about the code coverage, see the test coverage report.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK achow101, pinheadmz, willcl-ark, Zero-1729
Concept ACK RandyMcMillan

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Docs label Aug 29, 2023
Copy link
Member

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK de9a0f7

Left a few comments - I think the complexity can be reduced to make it more practical for actual mainnet users as opposed to a purely educational exercise.

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @BrandonOdiwuor

Gave it a first pass too, and agree with many of @pinheadmz comments. I think removing the online wallet would remove a load of steps and make things easier to follow.

Later today I will try and manually test the steps myself using a docker instance, as you described.

@BrandonOdiwuor
Copy link
Contributor Author

Thanks all for the feedback, I have updated the docs to include the suggestions

@willcl-ark
Copy link
Member

Thanks @BrandonOdiwuor, I'll take another look as soon as I am able, but you'll also probably want to squash these commits, either now or later, but certainly before merge :)

achow101 added a commit that referenced this pull request Sep 12, 2023
…if complete

2e249b9 doc: add release note for PR #28414 (Matthew Zipkin)
4614332 test: remove unnecessary finalizepsbt rpc calls (ismaelsadeeq)
e3d484b wallet rpc: return final tx hex from walletprocesspsbt if complete (Matthew Zipkin)

Pull request description:

  See #28363 (comment)

  `walletprocesspsbt` currently returns a base64-encoded PSBT and a boolean indicating if the tx is "complete". If it is complete, the base64 PSBT can be finalized with `finalizepsbt` which returns the hex-encoded transaction suitable for `sendrawtransaction`.

  With this patch, `walletprocesspsbt` return object will ALSO include the broadcast-able hex string if the tx is already final. This saves users the extra step of calling `finalizepsbt` assuming they have already inspected and approve the transaction from earlier steps.

ACKs for top commit:
  ismaelsadeeq:
    re ACK 2e249b9
  BrandonOdiwuor:
    re ACK 2e249b9
  Randy808:
    Tested ACK 2e249b9
  achow101:
    ACK 2e249b9
  ishaanam:
    ACK 2e249b9

Tree-SHA512: 229c1103265a9b4248f080935a7ad5607c3be3f9a096a9ab6554093b2cd8aa8b4d1fa55b1b97d3925ba208dbc3ccba4e4d37c40e1491db0d27ba3d9fe98f931e
@BrandonOdiwuor
Copy link
Contributor Author

@pinheadmz I have updated the doc to include the changes on #28414

Copy link
Member

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, almost done just a few ideas to make the offline/online wallets less confusing

Frank-GER pushed a commit to syscoin/syscoin that referenced this pull request Sep 19, 2023
…sspsbt if complete

2e249b9 doc: add release note for PR bitcoin#28414 (Matthew Zipkin)
4614332 test: remove unnecessary finalizepsbt rpc calls (ismaelsadeeq)
e3d484b wallet rpc: return final tx hex from walletprocesspsbt if complete (Matthew Zipkin)

Pull request description:

  See bitcoin#28363 (comment)

  `walletprocesspsbt` currently returns a base64-encoded PSBT and a boolean indicating if the tx is "complete". If it is complete, the base64 PSBT can be finalized with `finalizepsbt` which returns the hex-encoded transaction suitable for `sendrawtransaction`.

  With this patch, `walletprocesspsbt` return object will ALSO include the broadcast-able hex string if the tx is already final. This saves users the extra step of calling `finalizepsbt` assuming they have already inspected and approve the transaction from earlier steps.

ACKs for top commit:
  ismaelsadeeq:
    re ACK 2e249b9
  BrandonOdiwuor:
    re ACK 2e249b9
  Randy808:
    Tested ACK 2e249b9
  achow101:
    ACK 2e249b9
  ishaanam:
    ACK 2e249b9

Tree-SHA512: 229c1103265a9b4248f080935a7ad5607c3be3f9a096a9ab6554093b2cd8aa8b4d1fa55b1b97d3925ba208dbc3ccba4e4d37c40e1491db0d27ba3d9fe98f931e
@BrandonOdiwuor
Copy link
Contributor Author

@pinheadmz, @willcl-ark , @rot13maxi I have updated the doc with the feedbacks received

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @BrandonOdiwuor looking pretty good now, nice work!

I left some (ok, quite a few!) nits, but not related to the process. Feel free to take whichever you feel improve the readability the most.

@BrandonOdiwuor
Copy link
Contributor Author

cc @willcl-ark @rot13maxi

could you please review the latest version of the doc

@achow101
Copy link
Member

achow101 commented Nov 3, 2023

ACK 3c208cc

Copy link
Member

@pinheadmz pinheadmz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3c208cc

Confirmed only updates since last review addressed achow101's nits re: send and blank

Show Signature
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

ACK 3c208cc05ea9efb145c956e70f80efd8b027ff33
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmVH8gIACgkQ5+KYS2KJ
yToV3Q//TyBSa0j3/cGSVnT7dNZREnfh2ecKV5IueWBK1OnS3Bae1eLFS9hikmuG
gjxgRJFcrQYnwrqst72fkXlhXWnldam9NRsMV7LB8e5Caq6Vu0Bw+Kn0A1iSGnAc
VpZ5BVTz/bfB5UaLsoxGmsSU7S36YiuleXmuf/y/V59O6bxKBR0AAyxSSPLCW0yZ
KScURimiX0Y7VIfZxQdnj/Jm4a0K9CfaFEjaAJeS622hdQTJDWx/Diwog4PWMdDe
jmjnBQ+zAUT4O90ACJoe+Dipgv4Hl2e4TuvhVU/+2bmycnzxIgD5R2ZUyX7tplbD
b9y4OpEdKuJDu6LMlIJtFvvhESRxGwWaliGS5afXxO4O4slqmMnyizm93jcJdhaQ
SpSCaywOTdbcRQ0/IHn0Lz+hECsAeJgdFgOXJXfH5y5Q1AZkSkXYyrKaNBR+EHpg
vBEPiJyoRu57xzH360JW0PFmUdF4P60mmHQaTl5uH2CdHw0YofTAcjs/KfijqjVu
gEPHHWflq6G9HcUinWZRcZ9asaJG2hzmoyrDTRnrL70ztRVyMtIU/99jN9lsix7s
9Hfv9MPBddFmLbBTKmulmzMZ9r+VOT4eexcq+J9zOwDEZZ/LHC2ClkzvrX7gJDlo
h/dQ9ud7qN5oGOSbbjQ7CTHaquTEw6ijbgHkaEw5E7j95JlSmaQ=
=9+H8
-----END PGP SIGNATURE-----

pinheadmz's public key is on keybase

@willcl-ark
Copy link
Member

ACK 3c208cc

Looks good to me!

@DrahtBot DrahtBot removed the request for review from willcl-ark November 6, 2023 09:45

### Process and Sign the PSBT

1. Unlock the `offline_wallet` with the Passphrase:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor capitalization nit.

Suggested change
1. Unlock the `offline_wallet` with the Passphrase:
1. Unlock the `offline_wallet` with the passphrase:

## Overview
In this tutorial we have two hosts, both running Bitcoin v25.0

* `offline` host which is disconnected from all networks (internet, Tor, wifi, bluetooth etc.) and does not have, or need, a copy of the blockchain.
Copy link
Contributor

@Zero-1729 Zero-1729 Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor capitalization nit.

Suggested change
* `offline` host which is disconnected from all networks (internet, Tor, wifi, bluetooth etc.) and does not have, or need, a copy of the blockchain.
* `offline` host which is disconnected from all networks (Internet, Tor, WiFi, Bluetooth, etc.) and does not have, or need, a copy of the blockchain.


This tutorial will describe how to use two instances of Bitcoin Core, one online and one offline, to greatly increase security by not having private keys reside on a networked device.

Maintaining an air-gap between private keys and any network connections drastically reduces the opportunity for those keys to be exfiltrated from the user.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor hyphenation nit.

Suggested change
Maintaining an air-gap between private keys and any network connections drastically reduces the opportunity for those keys to be exfiltrated from the user.
Maintaining an air gap between private keys and any network connections drastically reduces the opportunity for those keys to be exfiltrated from the user.

Copy link
Contributor

@Zero-1729 Zero-1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 3c208cc

Great work!

@achow101 achow101 merged commit 4cebad4 into bitcoin:master Nov 6, 2023
@BrandonOdiwuor BrandonOdiwuor deleted the offline_sining_doc branch November 21, 2023 09:36
@bitcoin bitcoin locked and limited conversation to collaborators Nov 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Write instructions on offline signing.
9 participants