feat(statics): add Pearl to statics - #9347
Conversation
d507bc6 to
0f546d8
Compare
e940684 to
563cbd8
Compare
96342d0 to
8317443
Compare
|
@claude review |
|
Claude finished @manojkumar138's task —— View job Code Review - Pearl (PEARL) Integration✅ Completed Reviews1. Base Configuration (
2. Network Classes (
3. UTXO Coin Definitions (
4. UTXO-lib Network Configuration (
5. Test Fixtures and Validation ✅
🎯 Key Validation Points ✅
📊 Review SummaryStatus: ✅ APPROVED The Pearl (PEARL) cryptocurrency integration is well-implemented and complete. The implementation properly follows BitGo's established patterns and includes:
The integration correctly implements Pearl as a Taproot-enabled UTXO coin with bech32m addressing (prl/tprl prefixes) and includes all necessary features for BitGo wallet functionality. No issues identified. Ready for merge. |
There was a problem hiding this comment.
Pull request overview
This PR introduces Pearl (pearl / tpearl) as a recognized UTXO network across BitGoJS’ statics + UTXO stack (statics, utxo-lib, utxo-core, utxo-bin, abstract-utxo tests), including Taproot-only wallet script-type enforcement to match @bitgo/wasm-utxo behavior.
Changes:
- Adds Pearl network definitions (mainnet/testnet) and detection helpers in
@bitgo/utxo-lib, including Taproot-only script-type gating inoutputScripts.isSupportedScriptType. - Registers Pearl coin metadata in
@bitgo/statics(family/asset/network/utxo coin entries + expectedColdFeatures). - Updates dust threshold logic, CLI network parsing order, tests, and extensive address/PSBT fixtures; bumps
@bitgo/wasm-utxoto^4.27.0across affected modules.
Reviewed changes
Copilot reviewed 92 out of 93 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Bumps @bitgo/wasm-utxo and updates transitive lock entries. |
| modules/utxo-staking/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/utxo-ord/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/utxo-descriptors/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/utxo-core/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/utxo-bin/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/abstract-utxo/package.json | Bumps @bitgo/wasm-utxo to ^4.27.0. |
| modules/statics/src/base.ts | Adds CoinFamily.PEARL and UnderlyingAsset.PEARL. |
| modules/statics/src/networks.ts | Adds Pearl mainnet/testnet network objects to Networks. |
| modules/statics/src/utxo.ts | Adds pearl/tpearl UTXO coin entries and feature set. |
| modules/statics/test/unit/fixtures/expectedColdFeatures.ts | Adds pearl/tpearl to expected cold-feature fixtures. |
| modules/utxo-lib/src/networks.ts | Adds pearl/tpearl networks, NetworkName union updates, and helpers (isPearl, segwit/taproot support). |
| modules/utxo-lib/src/bitgo/outputScripts.ts | Enforces Taproot-only script type support for Pearl via isSupportedScriptType. |
| modules/utxo-lib/src/bitgo/transaction.ts | Enables transaction/PSBT factory support for networks.pearl. |
| modules/utxo-core/src/dustThreshold.ts | Treats Pearl like BTC-group for dust relay limit and spend size. |
| modules/utxo-core/test/dustThreshold.ts | Adds Pearl expected dust-threshold test vectors. |
| modules/utxo-bin/src/args/parseNetwork.ts | Adds Pearl to the CLI network ordering (mainnet group). |
| modules/utxo-lib/test/networks.ts | Extends network property-sharing groups and feature expectation table for Pearl. |
| modules/utxo-lib/test/bitgo/outputScripts.ts | Adds expected script types for Pearl (p2tr, p2trMusig2). |
| modules/utxo-lib/test/integration_local_rpc/parse.ts | Skips Pearl in regtest fixture suite until generator supports it. |
| modules/utxo-lib/test/fixtures_thirdparty/parse.ts | Excludes Pearl from third-party fixture parsing. |
| modules/utxo-lib/test/fixtures_thirdparty/download.ts | Excludes Pearl from third-party fixture downloads. |
| modules/utxo-lib/test/bitgo/psbt/Psbt.ts | Skips a p2ms-only extraction suite for Pearl. |
| modules/utxo-lib/test/bitgo/psbt/SignVerifyLegacy.ts | Skips legacy PSBT signing suite for taproot-only Pearl. |
| modules/utxo-lib/test/address/fixtures/pearl.json | Adds Pearl address vectors. |
| modules/utxo-lib/test/address/fixtures/tpearl.json | Adds Pearl testnet address vectors. |
| modules/utxo-lib/test/bitgo/fixtures/psbt/psbt.pearl.unsigned.json | Adds Pearl PSBT fixture (unsigned). |
| modules/utxo-lib/test/bitgo/fixtures/psbt/psbt.pearl.halfsigned.json | Adds Pearl PSBT fixture (half-signed). |
| modules/utxo-lib/test/bitgo/fixtures/psbt/psbt-lite.pearl.unsigned.json | Adds Pearl “lite” PSBT fixture (unsigned). |
| modules/utxo-lib/test/bitgo/fixtures/psbt/psbt-lite.pearl.halfsigned.json | Adds Pearl “lite” PSBT fixture (half-signed). |
| modules/abstract-utxo/test/unit/coins.ts | Documents Pearl networks as lacking coin classes yet (undefined). |
| modules/abstract-utxo/test/unit/util/utxoCoins.ts | Adds hasUtxoCoinForNetwork predicate for tests. |
| modules/abstract-utxo/test/unit/transaction/fixedScript/parsePsbt.ts | Filters AcidTest suite by hasUtxoCoinForNetwork. |
| modules/utxo-bin/test/fixtures/formatAddress/pearl_p2pkh_default_1LCVrCgbT26Ui1QyrhaGvvhrkVdDRAXxtt.txt | Adds Pearl formatAddress fixture (p2pkh). |
| modules/utxo-bin/test/fixtures/formatAddress/pearl_p2wkh_default_prl1q62tshlryz9lrjlw9edaf4l5l3v3deg03gw29k2.txt | Adds Pearl formatAddress fixture (p2wkh). |
| modules/utxo-bin/test/fixtures/formatAddress/pearl_p2tr_default_prl1p8gv9m64s539mycj4m29wu8thy5n3y6u36xs58wq3yezrmqygwfns2yff0j.txt | Adds Pearl formatAddress fixture (p2tr). |
| modules/utxo-bin/test/fixtures/formatAddress/pearl_p2trMusig2_default_prl1p5xqvqger0zdpcq6s3jznfz352exhk356p9hml6c69matmggrve9sq7apju.txt | Adds Pearl formatAddress fixture (p2trMusig2). |
| modules/utxo-bin/test/fixtures/formatAddress/tpearl_p2pkh_default_mziT9FmaG3XjV7tbaGYekqvBcVDvGnY3EZ.txt | Adds tpearl formatAddress fixture (p2pkh). |
| modules/utxo-bin/test/fixtures/formatAddress/tpearl_p2wkh_default_tprl1q62tshlryz9lrjlw9edaf4l5l3v3deg03lufv9q.txt | Adds tpearl formatAddress fixture (p2wkh). |
| modules/utxo-bin/test/fixtures/formatAddress/tpearl_p2tr_default_tprl1p8gv9m64s539mycj4m29wu8thy5n3y6u36xs58wq3yezrmqygwfnsptdhs8.txt | Adds tpearl formatAddress fixture (p2tr). |
| modules/utxo-bin/test/fixtures/formatAddress/tpearl_p2trMusig2_default_tprl1p5xqvqger0zdpcq6s3jznfz352exhk356p9hml6c69matmggrve9st3eldf.txt | Adds tpearl formatAddress fixture (p2trMusig2). |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2pkh_default_1LCVrCgbT26Ui1QyrhaGvvhrkVdDRAXxtt.txt | Updates network candidate list to include Pearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2pkh_default_1LCVrCgbT26Ui1QyrhaGvvhrkVdDRAXxtt.all.txt | Updates converted network list to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2sh_default_361UWADXqgPsdf8L5Jga6GNPauMuBtT1eW.txt | Updates network candidate list to include Pearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2sh_default_361UWADXqgPsdf8L5Jga6GNPauMuBtT1eW.all.txt | Updates converted network list to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2shP2wsh_default_33qtbAwm4ooBtMQenssbqDE1J4gSMMBRnb.txt | Updates network candidate list to include Pearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2shP2wsh_default_33qtbAwm4ooBtMQenssbqDE1J4gSMMBRnb.all.txt | Updates converted network list to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2tr_default_bc1p8gv9m64s539mycj4m29wu8thy5n3y6u36xs58wq3yezrmqygwfnsjhucex.all.txt | Adds Pearl/tpearl conversions for taproot addresses. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2trMusig2_default_bc1p5xqvqger0zdpcq6s3jznfz352exhk356p9hml6c69matmggrve9scdgsyg.all.txt | Adds Pearl/tpearl conversions for taproot-musig2 addresses. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2wkh_default_bc1q62tshlryz9lrjlw9edaf4l5l3v3deg034uw28c.all.txt | Adds Pearl/tpearl conversions for segwit v0 addresses. |
| modules/utxo-bin/test/fixtures/formatAddress/bitcoin_p2wsh_default_bc1qeu6xmet5wqslj2w0wac0hx5gj6dupmp869cajrkt3kw6ud3kkecsdzf7hn.all.txt | Adds Pearl/tpearl conversions for segwit v0 scripts. |
| modules/utxo-bin/test/fixtures/formatAddress/testnet_p2pkh_default_mziT9FmaG3XjV7tbaGYekqvBcVDvGnY3EZ.txt | Updates candidate network lists to include tpearl where prefixes collide. |
| modules/utxo-bin/test/fixtures/formatAddress/testnet_p2sh*_default_2M*.txt | Updates candidate network lists to include tpearl where prefixes collide. |
| modules/utxo-bin/test/fixtures/formatAddress/cash_*.all.txt | Updates converted network list to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/sv_* | Updates network candidate lists to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/bch_* | Updates network candidate lists to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/btg_* | Updates network candidate lists to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/doge_* | Updates network candidate lists to include tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/ecash_* | Updates network candidate lists to include Pearl/tpearl. |
| modules/utxo-bin/test/fixtures/formatAddress/litecoinTest_* | Updates network candidate lists to include tpearl. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
OttoAllmendinger
left a comment
There was a problem hiding this comment.
remove utxo-lib changes
8a68ca6 to
6651eb1
Compare
|
@OttoAllmendinger that all matches what's here now — this PR touches
So nothing to undo. The Scoping the follow-up to your last point — basic fixed-script wallet surface in
No descriptors, no ordinals, no I'll hold off until this one merges so the statics entry exists first — shout if you'd rather I stack it on this branch now. |
|
Claude finished @manojkumar138's task —— View job Code Review - Pearl (PEARL) IntegrationTodo List:
✅ Review Complete - Pearl Integration AnalysisStatus: This statics-only PR properly implements Pearl cryptocurrency integration with 4 files and 48 insertions. The implementation follows BitGo patterns correctly, but there's one code quality issue to address: 🐛 Code Quality Issue
const PEARL_FEATURES = [
...UtxoCoin.DEFAULT_FEATURES, // Already includes CoinFeature.MULTISIG (line 27)
CoinFeature.MULTISIG, // ❌ Duplicate - should be removed
CoinFeature.BULK_TRANSACTION,
CoinFeature.DISTRIBUTED_CUSTODY,
];
Fix: Remove the duplicate ✅ What Works Well1. Base Configuration (
2. Network Classes (
3. UTXO Coin Definitions (
4. Test Fixtures (
🎯 Validation Against Requirements✅ Taproot-only focus: Confirmed by PR description and wasm-utxo integration 📋 Minor Observations
🚀 RecommendationAPPROVED after fixing the duplicate |
6651eb1 to
3733692
Compare
|
Both review points addressed in 1. Duplicate I checked the sibling arrays ( 2. On your minor observations: agreed on both. statics builds clean, 32180 passing, prettier clean. Still 4 files. |
|
@claude re-review |
|
Claude finished @manojkumar138's task —— View job Code Review - Pearl (PEARL) Integration Re-reviewTodo List:
✅ Re-Review Complete - All Issues ResolvedStatus: ✅ APPROVED This re-review confirms that all previously identified issues have been properly addressed in the latest commits. The Pearl cryptocurrency integration is now clean and ready for merge. 🎯 Verified Fixes1. Duplicate MULTISIG Feature Fixed ✅
2. Documentation Improvements Added ✅
✅ Code Quality AssessmentOverall Implementation: The Pearl integration is well-structured and follows BitGo patterns correctly:
📊 PR Statistics Confirmed
🚀 Final Recommendation✅ APPROVED - Ready for Merge The Pearl integration is now complete, clean, and properly documented. All review feedback has been thoroughly addressed:
This PR successfully adds Pearl (PEARL) cryptocurrency support to BitGoJS statics without any remaining code quality issues. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
modules/statics/src/utxo.ts:345
- Same as the mainnet entry: the explicit
''prefix andTPEARLsuffix are redundant becauseutxo()already defaults toprefix=''andsuffix=name.toUpperCase()(sotpearl->TPEARL). Relying on defaults keeps these entries consistent with the rest of the file.
PEARL_FEATURES,
'',
'TPEARL'
),
3733692 to
fe50da8
Compare
|
@claude re-review |
|
Claude finished @manojkumar138's task —— View job Code Review - Pearl (PEARL) Integration Re-reviewTodo List:
✅ Re-Review Complete - All Issues ResolvedStatus: ✅ APPROVED This re-review confirms that all previously identified issues have been properly addressed in the latest commits. The Pearl cryptocurrency integration is now clean and ready for merge. 🎯 Verified Fixes1. Duplicate MULTISIG Feature Fixed ✅
2. Documentation Improvements Added ✅
✅ Code Quality AssessmentOverall Implementation: The Pearl integration is well-structured and follows BitGo patterns correctly:
📊 PR Statistics Confirmed
🚀 Final Recommendation✅ APPROVED - Ready for Merge The Pearl integration is now complete, clean, and properly documented. All review feedback has been thoroughly addressed:
This PR successfully adds Pearl (PEARL) cryptocurrency support to BitGoJS statics without any remaining code quality issues. |
Define Pearl (PEARL/TPEARL) coin identity in @bitgo/statics: CoinFamily, UnderlyingAsset, the Pearl/PearlTestnet network classes and the pearl and tpearl coin entries. Pearl is a taproot-only UTXO chain (btcd fork) using BIP-340 Schnorr signatures and BIP-341 script-path spending. It is backed by @bitgo/wasm-utxo, which has carried pearl and tpearl in CoinName since 4.27.0. No @bitgo/utxo-lib network is registered. Pearl is intended to be served through the wasm-utxo path, matching the wasm-only profile already used by ims-utxo, so utxolibName names the wasm CoinName rather than a utxo-lib network entry. TICKET: CECHO-1780 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
fe50da8 to
22a12fc
Compare
|
@claude re-review |
|
Claude finished @manojkumar138's task —— View job Code Review - Pearl (PEARL) Integration Re-reviewTodo List:
✅ Re-Review Complete - All Issues ResolvedStatus: ✅ APPROVED This re-review confirms that all previously identified issues have been properly addressed in the latest commits. The Pearl cryptocurrency integration is now clean and ready for merge. 🎯 Verified Fixes1. Duplicate MULTISIG Feature Fixed ✅
2. Documentation Improvements Added ✅
✅ Code Quality AssessmentOverall Implementation: The Pearl integration is well-structured and follows BitGo patterns correctly:
📊 PR Statistics Confirmed
🚀 Final Recommendation✅ APPROVED - Ready for Merge The Pearl integration is now complete, clean, and properly documented. All review feedback has been thoroughly addressed:
This PR successfully adds Pearl (PEARL) cryptocurrency support to BitGoJS statics without any remaining code quality issues. |
Wire the Pearl (Duplex) coin classes from @bitgo/sdk-coin-pearl into the
bitgo module so `bitgo.coin('pearl')` and `bitgo.coin('tpearl')` resolve.
Completes the BitGoJS onboarding started in #9347 (statics) and #9360
(abstract-utxo + sdk-coin-pearl).
Registers in both mechanisms: registerCoinConstructors for eager
registration and getCoinConstructor for the lazy lookup.
Pearl and Tpearl are imported directly from @bitgo/sdk-coin-pearl rather
than through the ./coins barrel. Routing them through the barrel makes
coinFactory observe a partially initialised module and leaves unrelated
constructors such as TethLikeCoin undefined at registration time. Several
other coins in this file are imported directly for the same reason. The
barrel still re-exports Pearl/Tpearl so `import { Pearl } from 'bitgo'`
keeps working like every other coin.
Regenerate the Dockerfile with `yarn update-dockerfile` so the new module
is copied and linked for bitgo-express. This is generated content and the
dockerfile-check CI job diffs it, so it must be committed rather than
hand-edited.
TICKET: CECHO-1792
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
Defines Pearl's coin identity in
@bitgo/statics. Noutxo-libchanges — Pearl is intended to be served through the@bitgo/wasm-utxopath, matching the wasm-only profile already used by ims-utxo.5 files, 58 insertions.
Chain Type
UTXO — Taproot-only (BIP-340 Schnorr, BIP-341 script-path with a NUMS internal key). Pearl is a btcd fork.
@bitgo/wasm-utxois authoritative on script-type support and restricts Pearl to Taproot:Coin Codes & Tickers
pearlPEARLtpearlTPEARLNames match
@bitgo/wasm-utxo(coinNames: [..., "pearl", "tpearl"]) and indexer-utxo (CoinSymbol.pearl/CoinSymbol.tpearl).Network Parameters
prltprlm/86'/808276'/0'm/86'/1'/0'Changes
src/base.tsCoinFamily.PEARL,UnderlyingAsset.PEARLsrc/networks.tsPearl/PearlTestnetclasses +Networks.main/Networks.testentriessrc/utxo.tspearl/tpearlcoin entries withPEARL_FEATUREStest/unit/fixtures/expectedColdFeatures.tsjustMultiSigtest/unit/coins.tspearl/tpearlcase in the Distributed Custody Features suiteCoin features
PEARL_FEATURESisUtxoCoin.DEFAULT_FEATURESplusBULK_TRANSACTIONandDISTRIBUTED_CUSTODY, matching the onboarding TDD (§9, Phase 6 PR 1).MULTISIGcomes fromDEFAULT_FEATURESrather than being listed again.DISTRIBUTED_CUSTODYis deliberate, not copied from BTC by accident. Pearl is currently the only non-BTC chain carrying it — the existing holders arebtcand its testnet/OFC variants — which is consistent with the TDD's premise (§4, "Why BTC is the Template"): P2TR, BIP-340 Schnorr and BIP-341 script-path are implemented for BTC only, so Pearl is modelled on BTC rather than on the other UTXO forks.test/unit/coins.tsnow pins the flag for both names so it cannot regress silently.Both names share one
PEARL_FEATURESarray. The TDD listsBULK_TRANSACTIONfor mainnet only, but sharing matches howbch/tbch,ltc/tltcanddoge/tdogeare defined here, and keeping testnet at parity avoids a weaker test surface than mainnet.On
utxolibNameUtxoNetworkrequires autxolibName: string, so the classes set'pearl'/'tpearl'— the wasmCoinNames. With no utxo-lib network registered, these do not resolve to autxolib.networksentry. That is intentional under the wasm-only approach, and the one structural consequence is noted below.Verification
staticsutxo-libutxo-coreabstract-utxoutxo-binAll build clean (
statics,utxo-lib,utxo-core,abstract-utxo,utxo-bin,sdk-core); prettier clean. Rebased onto current master.Known consequence of the wasm-only approach
Nothing in this PR is blocked, but for the record:
sdk-core'sabstractUtxoCoinUtil.tsresolves statics'utxolibNameinto a utxo-lib network —— in both
getUtxoCoinScriptTypes2Of3()andgetUtxoCoinScriptTypesForWalletType(). For Pearl that yieldsundefinedand then throwsTypeError: invalid network.Not reachable today: no SDK coin class exists for Pearl, and the sdk-core tests covering those functions use a hardcoded coin list (
btc,ltc,doge) rather than enumerating statics. It becomes reachable when the coin class lands, so those two functions need a wasm-backed path (or a Pearl guard) before Pearl is wired into wallet/address flows.The good news for that follow-up:
abstract-utxois already almost entirely wasm-backed — 37 files import@bitgo/wasm-utxo, and the only 3 mentioningutxolibare a deprecation comment inabstractUtxoCoin.ts("will be removed when we drop support for utxolib"), a comment inunspent.ts, and BTC-specificinscriptionBuilder.ts. Coin classes carry aname, not aNetwork, so a wasm-only Pearl coin class looks feasible without reintroducing utxo-lib.Dependencies
Already merged upstream:
Follow Up tickets :
https://linear.app/bitgo/issue/CECHO-1791/duplex-bitgojs-pr2
https://linear.app/bitgo/issue/CECHO-1792/duplex-bitgojs-pr3
Related
🤖 Generated with Claude Code