test: use ExtendedPrivateKey in wallet_descriptor.py
What changed, and why it matters
This is a minor test-only change in Bitcoin Core. It replaces a hard-coded test private key with a freshly generated one for use in an automated functional test. There is no change to production wallet code, no security fix, and no vulnerability.
No action required. This is a routine test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/functional/wallet_descriptor.py to import ExtendedPrivateKey and descsum_create helpers, then replaces a static BIP32 tprv descriptor string with a dynamically generated one. The generated key is used only inside a test that exercises encrypted-wallet descriptor import and hardened derivation. The diff is +3/-1 lines and touches no consensus, P2P, or wallet runtime code.
Changed components
test/functional/wallet_descriptor.pyInspect captured patch +3 / −1
diff --git a/test/functional/wallet_descriptor.py b/test/functional/wallet_descriptor.py
index ee8ea192..c3597011 100755
--- a/test/functional/wallet_descriptor.py
+++ b/test/functional/wallet_descriptor.py
@@ -12,6 +12,8 @@ except ImportError:
import re
from test_framework.blocktools import COINBASE_MATURITY
+from test_framework.descriptors import descsum_create
+from test_framework.extendedkey import ExtendedPrivateKey
from test_framework.messages import ser_string
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import (
@@ -173,7 +175,7 @@ class WalletDescriptorTest(BitcoinTestFramework):
self.log.info("Test that unlock is needed when deriving only hardened keys in an encrypted wallet")
with WalletUnlock(send_wrpc, "pass"):
send_wrpc.importdescriptors([{
- "desc": "wpkh(tprv8ZgxMBicQKsPd7Uf69XL1XwhmjHopUGep8GuEiJDZmbQz6o58LninorQAfcKZWARbtRtfnLcJ5MQ2AtHcQJCCRUcMRvmDUjyEmNUWwx8UbK/0h/*h)#y4dfsj7n",
+ "desc": descsum_create(f"wpkh({ExtendedPrivateKey.generate().to_string()}/0h/*h)"),
"timestamp": "now",
"range": [0,10],
"active": True
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.