summaryrefslogtreecommitdiff
path: root/a0/47b8d62934d2f4a335f925d44ee43f18c6eb7b
blob: 703a257f9461cc722235dcadef947ae51ead24fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Return-Path: <aj@erisian.com.au>
Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 422FFC000D
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 15 Oct 2021 01:05:24 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by smtp4.osuosl.org (Postfix) with ESMTP id 165FD404A7
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 15 Oct 2021 01:05:24 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
X-Spam-Flag: NO
X-Spam-Score: -1.621
X-Spam-Level: 
X-Spam-Status: No, score=-1.621 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.276, SPF_HELO_NONE=0.001,
 SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001]
 autolearn=no autolearn_force=no
Received: from smtp4.osuosl.org ([127.0.0.1])
 by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 84o-FposCsBZ
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 15 Oct 2021 01:05:23 +0000 (UTC)
X-Greylist: from auto-whitelisted by SQLgrey-1.8.0
Received: from azure.erisian.com.au (cerulean.erisian.com.au [139.162.42.226])
 by smtp4.osuosl.org (Postfix) with ESMTPS id 7B6404049E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Fri, 15 Oct 2021 01:05:23 +0000 (UTC)
Received: from aj@azure.erisian.com.au (helo=sapphire.erisian.com.au)
 by azure.erisian.com.au with esmtpsa (Exim 4.92 #3 (Debian))
 id 1mbBew-0001F6-DS; Fri, 15 Oct 2021 11:05:20 +1000
Received: by sapphire.erisian.com.au (sSMTP sendmail emulation);
 Fri, 15 Oct 2021 11:05:12 +1000
Date: Fri, 15 Oct 2021 11:05:12 +1000
From: Anthony Towns <aj@erisian.com.au>
To: Pieter Wuille <bitcoin-dev@wuille.net>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Message-ID: <20211015010512.GC6451@erisian.com.au>
References: <cf1aa346-4f0d-8192-c8e8-1861e7840371@schildbach.de>
 <jNk5M87QACL8ySLGzR5sQVaJkQcIV8RrHnbWv6-lkjRhjTL6vEmaMJI7hENUO803wSZM0hOaCyeQI3jjPBbJKiMy8gBXtS_HLmKzPivk2M0=@wuille.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <jNk5M87QACL8ySLGzR5sQVaJkQcIV8RrHnbWv6-lkjRhjTL6vEmaMJI7hENUO803wSZM0hOaCyeQI3jjPBbJKiMy8gBXtS_HLmKzPivk2M0=@wuille.net>
User-Agent: Mutt/1.10.1 (2018-07-13)
X-Spam-Score-int: -18
X-Spam-Bar: -
Subject: Re: [bitcoin-dev] Taproot testnet wallet
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Oct 2021 01:05:24 -0000

On Sat, Oct 09, 2021 at 04:49:42PM +0000, Pieter Wuille via bitcoin-dev wrote:
> You can construct a taproot-capable wallet in Bitcoin Core as follows:
> * Have or create a descriptor wallet (createwallet RPC, with descriptors=true).
> * Import a taproot descriptor (of the form "tr(KEY)"), as active descriptor
> (with active=true), where KEY can be a tprv.../* or any other supported key
> expression.
> * Get a new address with addresstype=bech32m

Running master (which has PR#21500 merged), then the above can be
done with:

1. create a descriptor wallet

  bitcoin-cli -signet -named createwallet wallet_name=descwallet descriptors=true load_on_startup=true

2. get the associated bip32 tprv private key

  TPRV=$(bitcoin-cli -rpcwallet=descwallet -signet listdescriptors true | jq '.descriptors | .[].desc' | sed 's/^.*(//;s/[)/].*//' | uniq | head -n1)

(This step requires PR#21500 to extract the wallet's tprv; you'll need to
be running an updated version of bitcoin-cli here as well as bitcoind. You
could also generate the tprv some other way.)

3. construct the taproot descriptor per BIP 86

  DESC="tr($TPRV/86'/1'/0'/0/*)"
  CHK="$(bitcoin-cli -rpcwallet=descwallet -signet getdescriptorinfo "$DESC" | jq -r .checksum)"

4. import the descriptor

  bitcoin-cli -rpcwallet=descwallet -signet importdescriptors "[{\"desc\": \"$DESC#$CHK\", \"active\": true, \"timestamp\": \"now\", \"range\": [0,1000], \"next_index\": 1}]"

5. get an address

  bitcoin-cli -rpcwallet=descwallet -signet getnewaddress '' bech32m

You can then use the signet faucet to send a few million ssats to that
address directly.

Same stuff works with testnet, though I'm not sure if any testnet faucets
will accept bech32m addresses directly.

This is all a bit deliberately cumbersome prior to taproot activating on
mainnet; once that happens and PR#22364 is merged, you'll only need to
do steps (1) and (5).

Cheers,
aj