Skip to content

chainreg: accommodate buried taproot deployment in Bitcoin Core v31#10683

Open
pinheadmz wants to merge 1 commit intolightningnetwork:masterfrom
pinheadmz:bury-taproot-deployment
Open

chainreg: accommodate buried taproot deployment in Bitcoin Core v31#10683
pinheadmz wants to merge 1 commit intolightningnetwork:masterfrom
pinheadmz:bury-taproot-deployment

Conversation

@pinheadmz
Copy link
Copy Markdown

A PR merged since Bitcoin Core release v30 breaks how lnd detects taproot support:

error creating wallet config: unable to create partial chain control: node backend does not support taproot

This PR removes "taproot" from "deployments" in RPC getdeploymentinfo: bitcoin/bitcoin#26201

Fortunately a second PR adds a new "script_flags" field to RPC getdeploymentinfo: bitcoin/bitcoin#32998

This PR adds a (third) taproot-support check compatible with Bitcoin Core current master and eventually v31.

Note that taproot is active for all blocks since segregated witness is enforced. There is only one exception which is hard-coded into the software.

For your next bitcoin trivia night:

https://github.com/bitcoin/bitcoin/blob/4f8bd396f8ab04f7ea8bde0dce3829c345d6c54b/src/kernel/chainparams.cpp#L87-L88

https://b10c.me/blog/007-spending-p2tr-pre-activation/

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a breaking change in how Bitcoin Core reports taproot support via RPC. By introducing a fallback mechanism that checks for the newly added 'script_flags' field, the system ensures continued compatibility with upcoming Bitcoin Core releases where taproot is no longer listed as a standard BIP9 deployment.

Highlights

  • Compatibility Update: Updated the taproot support check to remain compatible with Bitcoin Core v31 and later versions.
  • New Verification Method: Implemented a check for the new 'script_flags' field in the getdeploymentinfo RPC response to detect taproot support.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the backendSupportsTaproot function to maintain compatibility with Bitcoin Core v31 and later by adding a ScriptFlags field to the deployment info structure and checking for the 'TAPROOT' flag. The review feedback points out an improvement opportunity to remove a redundant nil check before ranging over the ScriptFlags slice, which is idiomatic in Go.

@pinheadmz pinheadmz force-pushed the bury-taproot-deployment branch from 3950c6a to d7f5220 Compare March 27, 2026 18:43
@Roasbeef Roasbeef requested a review from erickcestari March 30, 2026 23:42
Copy link
Copy Markdown
Collaborator

@erickcestari erickcestari left a comment

Choose a reason for hiding this comment

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

Thanks! I tested it locally with and without the fix, and it works! This PR indeed fixes the issue.

By the way, it's amusing to read the b10c blog post about spending from P2TR outputs before activation, knowing that we now have one more hardcoded block hash in bitcoin nodes. 🫠

There's only one small nit, and then it should be good to go!

@pinheadmz pinheadmz force-pushed the bury-taproot-deployment branch from d7f5220 to 5e91d4c Compare March 31, 2026 19:55
Copy link
Copy Markdown
Collaborator

@erickcestari erickcestari left a comment

Choose a reason for hiding this comment

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

LGTM!

Removes "taproot" from deployments:
bitcoin/bitcoin#26201

Adds "script_flags" field to RPC getdeploymentinfo:
bitcoin/bitcoin#32998
@pinheadmz pinheadmz force-pushed the bury-taproot-deployment branch from 5e91d4c to 3867e46 Compare March 31, 2026 23:27
@Roasbeef Roasbeef added this to the v0.21.0 milestone Apr 1, 2026
@Roasbeef
Copy link
Copy Markdown
Member

Roasbeef commented Apr 1, 2026

@pinheadmz can you update the release notes here? That this is the first release that has taproot activation detection compatible with bitcoind v30?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants