Skip to content

Commit

Permalink
Merge #940: Add psbt watch-only/cold-storage example
Browse files Browse the repository at this point in the history
cd2369b Run ecdsa-psbt example in test script (Tobin C. Harding)
6967c0e Add psbt example (Tobin Harding)

Pull request description:

  Add an example PSBT workflow. The workflow we simulate is that of a setup using a watch-only online wallet (contains only public keys) and a cold-storage wallet (contains the private keys).

  We create and update a PSBT using the watch-only wallet then pass the PSBT to the cold-storage wallet to sign.

  Partially resolves #892 (more done in #935).

  ## Note

  This PR includes a sub-module in `examples/psbt.rs` that implements ECDSA signing. This will hopefully eventually be merged into the main crate by way of #957.  We have three PRs that add examples/tests of PSBTs that need to do signing, in order to help us design a good AP in #957 I think it would be beneficial to complete and merge these three PRs.

  1. This PR (PSBT ECDSA example)
  2. PBST ECDSA integration test: #935
  3. PSBT taproot example: #999

  Note to self, this will need a change to `test.sh` if #1079 merges.

ACKs for top commit:
  apoelstra:
    ACK cd2369b
  sanket1729:
    ACK cd2369b. The example is clean, you can address the comments in followups.

Tree-SHA512: c4fb8ec631bf8bfc30534e8974b1f6c4bb7cc6def165a4ee2bb7aa73f5aa7fdc11d2000ca25792a4b534b2c5bf1592efe542ada14a9d702c7dfacbaa808f3aea
  • Loading branch information
sanket1729 committed Jul 19, 2022
2 parents 0c22359 + cd2369b commit d6d5415
Show file tree
Hide file tree
Showing 3 changed files with 635 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Expand Up @@ -56,3 +56,7 @@ name = "bip32"
[[example]]
name = "handshake"
required-features = ["std"]

[[example]]
name = "ecdsa-psbt"
required-features = ["std", "bitcoinconsensus"]
2 changes: 2 additions & 0 deletions contrib/test.sh
Expand Up @@ -62,6 +62,8 @@ do
cargo test --verbose --features="$feature"
done

cargo run --example ecdsa-psbt --features=bitcoinconsensus

# Build the docs if told to (this only works with the nightly toolchain)
if [ "$DO_DOCS" = true ]; then
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --features="$FEATURES" -- -D rustdoc::broken-intra-doc-links
Expand Down

0 comments on commit d6d5415

Please sign in to comment.