WIP feat(rgbx): add BTC Merkle proof verification to native asset confirm#1299
Open
bysomeone wants to merge 7 commits into
Open
WIP feat(rgbx): add BTC Merkle proof verification to native asset confirm#1299bysomeone wants to merge 7 commits into
bysomeone wants to merge 7 commits into
Conversation
- Simplify UtxoSpendingProof proto, remove redundant spendingTx and OpRetOutputPkScript - Add validateBtcTxProof call in checkConfirm non-withdraw path - Migrate Exec_Confirm to use BtcTxProof.txData for spendHash calculation - Add blockHash field to utxoSpendInfo in off-chain neutrino module - Add buildNativeConfirmBtcTxProof method on neutrinoClient for Merkle proof construction - Update createConfirmPayload to construct and include BtcTxProof Co-Authored-By: Claude <noreply@anthropic.com>
… tests - Add scenario_native_asset_mint docker integration test - Add run_native_tests / run_all_tests_wrapper entry points - Add native/all actions to case dispatch - Supplement checktx_test.go with BtcTxProof validation test cases - Fix duplicate import in checktx_test.go
- Add btcMintSpend Go command for building/signing/broadcasting BTC mint spending tx with OP_RETURN, replacing fragile raw tx hex parsing - Fix native case routing to run_native_tests, bypassing chain33 solo consensus post-restart block production failure - Add -k GENESIS_KEY to mint command so stdout captures tx hash - Add 101 BTC block mining prerequisite before native asset mint - Add platform: linux/amd64 to docker-compose.yml for Apple Silicon - Add restart: unless-stopped to para2-4 for reliability Co-Authored-By: Claude <noreply@anthropic.com>
… matching commitment - In createConfirmPayload, scan all OP_RETURN outputs and prefer the one matching the expected commitment from pending tx hash - Fall back to first OP_RETURN if no match found - Add unit test for the matching behavior - Fix docker-compose.sh case pattern missing 'all' action
df551f2 to
809983d
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1299 +/- ##
===========================================
- Coverage 48.37% 28.85% -19.53%
===========================================
Files 223 378 +155
Lines 42519 73207 +30688
===========================================
+ Hits 20568 21122 +554
- Misses 20058 50113 +30055
- Partials 1893 1972 +79 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…it, add mint send error handling
6a42f75 to
98ecd9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add BTC Merkle proof (BtcTxProof) verification to RGBx native asset Confirm transactions (Mint/Transfer confirm). Previously only cross-chain deposit/withdraw had Merkle proof validation; native asset confirms only checked UtxoSpendingProof without proving the spending tx existed in a BTC block.
Changes
Proto
UtxoSpendingProof: remove redundantspendingTxandopRetOutputPkScriptfields (spending tx now sourced fromBtcTxProof.txData)On-chain validation (
executor/)checkConfirmnon-withdraw path: addvalidateBtcTxProofcall for Merkle proof verificationExec_Confirm:spendHashcomputed fromBtcTxProof.TxDataOff-chain proof construction (
neutrino/)utxoSpendInfo: addblockHashfieldrescanUtxo: fetch block hash from neutrino header when UTXO spend detectedcreateConfirmPayload: constructBtcTxProofviabuildNativeConfirmBtcTxProofbuildNativeConfirmBtcTxProofmethod reuses existingbuildTxExistenceProofCLI
btcMintSpendcommand for constructing BTC spending tx with OP_RETURN (used by CI)Testing
scenario_native_asset_mint+native/allentry pointsVerification
./docker-compose.sh nativepasses (mint native asset → BTC spend → neutrino auto-confirm → verify asset created)make docker-compose dapp=rgbxincludes native asset scenarioCommits
🤖 Generated with Claude Code
Co-authored-by: Claude noreply@anthropic.com