Skip to content

H4: Use BIP-341 NUMS point as unspendable Taproot internal key for V3+#914

Merged
dangershony merged 1 commit into
mainfrom
security/h4-nums-internal-key
Jul 7, 2026
Merged

H4: Use BIP-341 NUMS point as unspendable Taproot internal key for V3+#914
dangershony merged 1 commit into
mainfrom
security/h4-nums-internal-key

Conversation

@DavidGershony

Copy link
Copy Markdown
Collaborator

Summary

Use the well-known BIP-341 NUMS (Nothing Up My Sleeve) point as the Taproot internal key for V3+ projects, making the key path provably unspendable.

Problem

The current implementation derives the internal key from project data. While it was intended to be unspendable, there's no cryptographic guarantee — a flaw in the derivation logic or a future refactor could accidentally make it spendable, allowing funds to bypass the script path.

Solution

For V3+ projects, use the standard NUMS point from BIP-341:
0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0

This point is the SHA-256 hash of the Generator point G interpreted as a public key. No one can know its discrete logarithm, so the key path is cryptographically guaranteed to be unspendable.

Changes

  • Add CreateUnspendableInternalKeyV2() returning the NUMS TaprootInternalPubKey
  • BuildTaprootSpendInfo now accepts projectVersion parameter
  • V1/V2 continues using the legacy derived key (backward compatible)

Testing

All 154 shared tests pass.

Add CreateUnspendableInternalKeyV2() using the well-known BIP-341 NUMS
point (0x50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)
which is provably unspendable because no one knows its discrete log.

BuildTaprootSpendInfo now accepts a projectVersion parameter:
- V3+: uses the NUMS point (cryptographically guaranteed unspendable)
- V1/V2: uses the legacy derived internal key (backward compatible)

This prevents any possibility of spending via the key path in Taproot
outputs, ensuring funds can only be spent via the script path as intended.

@dangershony dangershony left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need to make sure the version is used in later upgrade right?

@dangershony dangershony merged commit 7f547e6 into main Jul 7, 2026
3 checks passed
@dangershony dangershony deleted the security/h4-nums-internal-key branch July 7, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants