Return-Path: Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 422FFC000D for ; 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 ; 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 ; 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 ; 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 To: Pieter Wuille , Bitcoin Protocol Discussion Message-ID: <20211015010512.GC6451@erisian.com.au> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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