Skip to content

BIP Draft SENDTEMPLATE #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ajtowns
Copy link
Contributor

@ajtowns ajtowns commented Aug 18, 2025

Adds a BIP for SENDTEMPLATE, GETTEMPLATE, TEMPLATE p2p messages. Discussion links:

https://delvingbitcoin.org/t/sharing-block-templates/1906

https://gnusha.org/pi/bitcoindev/[email protected]/T/#u

@jonatack
Copy link
Member

Post to bitcoindev group hasn't made it through

fixed, published

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

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

Interesting idea, thanks for sharing.

Comment on lines 73 to 74
5. A block containing the transactions making up the payload must not
exceed four million weight units as defined in [BIP-141][BIP-141].
Copy link
Contributor

Choose a reason for hiding this comment

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

Have you considered allowing more data than just the top block? Otherwise, would you recommend that a node requests a template after each block is found for the first few new blocks after they come online? Have you considered a reconciliation-based approach akin to Erlay?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See discussion in the delving thread.

I think having two blocks of txs could make sense, but in adversarial situations it doubles the potential memory usage and it's not immediately clear what would be a sensible way of addressing that.

My thought is that deploying a simple design and getting some real-world data to iterate on makes sense. You could update the specification to announce "SENDTEMPLATE 2" indicating you support v2, which indicates to your peers they can send you a "GETTEMPLATE 2" message requesting a 2MvB template rather than a 1MvB template, eg.

Likewise sending set differences through could make sense (and wouldn't need the complexity of minisketch since the sender knows their own previous templates), but there's still a lot of design space left, so getting real-world data also seems useful for resolving that. (Likewise an updated spec could allow SENDTEMPLATE 2D to indicate deltas are supported, and GETTEMPLATE 2 $hash could request a 2MvB template encoded as a delta against the previous template with hash $hash)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed the limit from 4M weight units to 8M weight units.

@ajtowns ajtowns force-pushed the 202508-sendtemplate branch from a89b303 to 55a8927 Compare August 20, 2025 06:05
@ajtowns ajtowns force-pushed the 202508-sendtemplate branch from 55a8927 to 4352c1b Compare August 21, 2025 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants