From f831476127a4873485ab28375cd2ad9778e143e9 Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Fri, 27 Mar 2026 13:57:29 -0400 Subject: [PATCH 1/2] chainreg: accommodate buried taproot deployment in Bitcoin Core v31 Removes "taproot" from deployments: https://github.com/bitcoin/bitcoin/pull/26201 Adds "script_flags" field to RPC getdeploymentinfo: https://github.com/bitcoin/bitcoin/pull/32998 --- chainreg/taproot_check.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/chainreg/taproot_check.go b/chainreg/taproot_check.go index dedc717eb3d..45c5c5b1945 100644 --- a/chainreg/taproot_check.go +++ b/chainreg/taproot_check.go @@ -2,6 +2,7 @@ package chainreg import ( "encoding/json" + "slices" "github.com/btcsuite/btcd/rpcclient" ) @@ -48,6 +49,7 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool { } info := struct { + ScriptFlags []string `json:"script_flags"` Deployments map[string]struct { Type string `json:"type"` Active bool `json:"active"` @@ -59,6 +61,14 @@ func backendSupportsTaproot(rpc *rpcclient.Client) bool { return false } + // Before Bitcoin Core v31, taproot was still included as a BIP9 + // deployment. _, ok := info.Deployments["taproot"] - return ok + + // Since v31, taproot is activated at genesis and no longer appears + // as a deployment. Also in v31, Bitcoin Core added a "script_flags" + // field to getdeploymentinfo which lists all the verification flags. + hasFlag := slices.Contains(info.ScriptFlags, "TAPROOT") + + return ok || hasFlag } From 39639056adf0ac11f9826ac95676e4bca74d99b6 Mon Sep 17 00:00:00 2001 From: Matthew Zipkin Date: Mon, 6 Apr 2026 10:18:39 -0400 Subject: [PATCH 2/2] docs: update release notes --- docs/release-notes/release-notes-0.21.0.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/release-notes/release-notes-0.21.0.md b/docs/release-notes/release-notes-0.21.0.md index ad58f77da7f..10bf65efac9 100644 --- a/docs/release-notes/release-notes-0.21.0.md +++ b/docs/release-notes/release-notes-0.21.0.md @@ -360,6 +360,10 @@ ## Code Health +* [Update taproot detection](https://github.com/lightningnetwork/lnd/pull/10683) + to accommodate buried activation (and modified RPC `getdeploymentinfo` + response) beginning in Bitcoin Core v32. + ## Tooling and Documentation * [Added missing `lncli:` tags](https://github.com/lightningnetwork/lnd/pull/10658) @@ -382,6 +386,7 @@ * Erick Cestari * Gijs van Dam * hieblmi +* Matthew Zipkin * Mohamed Awnallah * Nishant Bansal * Pins