10 Commits

Author SHA1 Message Date
ac6ae69329 fix: implement BIP341 key tweaking for P2TR transaction signing
This commit fixes P2TR (Pay-to-Taproot) transaction signing by properly
implementing BIP341 key path spending.

Key changes:
- Add SignSchnorrTaproot() method to CKey for BIP341 tweaked signing
- Implement ComputeTapTweak() and CreatePayToTaprootPubKey() in XOnlyPubKey
- Add GetTaprootInternalKey() to SigningProvider interface for internal key lookup
- Store taproot internal key mappings in LegacyScriptPubKeyMan
- Fix FindTaprootPubKey() to use internal key mapping with fallback
- Use empty scriptCode for Taproot key-path spending (per BIP341 spec)
- Update HaveTaprootKey() to verify tweaked keys correctly

Technical details:
- Internal keys are tweaked using secp256k1_keypair_xonly_tweak_add
- Parity handling is automatic via secp256k1 library
- Empty scriptCode ensures correct sighash for key-path spending
- Internal key to output key mapping stored for efficient lookup

Testing:
- P2TR address creation, funding, and spending work end-to-end
- Multi-hop P2TR transactions tested successfully
- All functional tests pass (feature_taproot.py, wallet_*, rpc_*)

Fixes: non-mandatory-script-verify-flag error on P2TR spending
2026-02-08 00:55:02 +01:00
49d13674e1 validation,policy,test: activate taproot flags and harden wallet fs checks
Wire Taproot script verification into validation/policy/libconsensus and update standardness flags.

Adapt wallet_multiwallet functional test to match filesystem error variants (create_directory/create_directories/filesystem error), making the suite robust across fs backends and library versions.
2026-02-07 10:55:38 +01:00
613bcdbed7 encoding,test: backport BIP350 bech32m and align test vectors to Palladium
- use Bech32 for witness v0 and Bech32m for witness v1+ in key_io
- update C++ bech32 tests and python segwit_addr framework
- realign key/address test vectors and fixtures to Palladium prefixes/params
- adjust chain-parameter-sensitive tests (maturity, BIP66/regtest, message verify)
- fix incorrect historical sha256 expected vector in unit tests
2026-02-06 15:23:23 +01:00
c539ebedc7 git add test/util/data/ test/util/test_runner.py test/README.md test/lint/lint-format-strings.py contrib/devtools/circular-dependencies.py src/qt/palladiumgui.cpp 2026-02-05 13:31:07 +01:00
a5545a27ed Adapt functional tests to Palladium consensus rules 2026-02-05 13:30:12 +01:00
ba4446842d Adapt test framework to Palladium consensus rules 2026-02-05 13:29:25 +01:00
f94645004a chmod +x lint scripts 2026-02-04 09:31:28 +01:00
ffbaef8388 testnet update: rename testnet3 to testnet
Update all references to 'testnet3' to 'testnet' for consistency. This includes:
- Changing magic bytes in network messages
- Updating directory paths and configuration files
- Modifying documentation and test framework references
- Adjusting chain parameters and validation logic
2025-10-30 23:25:15 +01:00
NotRin7
d1c7a411de v1.1.0 2024-03-15 18:21:54 +01:00
NotRin7
0a6901a7f0 1.1.0 2024-03-15 18:16:03 +01:00