Reimplement Pirate Chain plugin over react-native-pirate-wallet#1055
Reimplement Pirate Chain plugin over react-native-pirate-wallet#1055j0ntz wants to merge 1 commit into
Conversation
9df27fb to
c26cdcb
Compare
c26cdcb to
c2a610d
Compare
c2a610d to
7049511
Compare
|
Simulator-tested update (force-pushed as part of the single commit):
Upstream blocker found while testing: block sync still cannot progress through this binding. |
The piratechain team's orchard upgrade replaces the zcash-cloned react-native-piratechain SDK with a wallet-registry based SDK (react-native-pirate-wallet) whose lightwalletd endpoint, checkpoints, and spending keys live inside the native core. Rebuild the engine, tools, and yaob io bridge on that API: wallets are restored into the SDK registry under the Edge walletId alias, sync progress comes from the SDK's polling synchronizer, transactions map from signed fee-inclusive amounts, and sends go through the registry wallet instead of passing the mnemonic per spend.
7049511 to
0481ded
Compare
|
End-to-end sync + send verified on the iOS simulator (with a locally rebuilt pirate core carrying the one-line persistent-runtime fix):
Two more findings, both addressed in the latest force-push:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0481ded. Configure here.

CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
none
Description
Asana: https://app.asana.com/0/1215088146871429/1214721783909451
The piratechain team released a new SDK family for their orchard upgrade (Pirate-Unified-Light-Wallet), including
react-native-pirate-wallet, which replaces thereact-native-piratechainwrapper Edge wrote. The new SDK is not a drop-in replacement, so this PR reimplements the piratechain plugin on top of it.Architecture changes driven by the new SDK:
sync_status/get_balance/list_transactionsnatively, so the io bridge forwards its snapshots as the existingupdate/statusChanged/erroryaob events. Block progress maps fromlocalHeight/targetHeight.list_transactionsreplaces block-range queries (theblockRangewindowing inotherDatais gone). Amounts are signed and fee-inclusive for sends, which matches Edge'snativeAmountsemantics directly. Recipient addresses are not exposed by the SDK, so sends are detected by sign.broadcastTxsends outputs (plus the explicit default fee) through the SDK instead of passing the mnemonic per spend.current_receive_address(still saplingzs1…— orchard is not active on mainnet).derivePublicKeyexports the sapling viewing key after registering the wallet. New-wallet birthday heights are probed via a throwawaycreate_wallet, whose null-birthday path resolves the live chain tip with a checkpoint fallback.rpcNodeinnetworkInfois no longer consumed (kept for info-server payload compatibility).The plugin compiles against local typings (
rnPirateWallet.d.ts) becausereact-native-pirate-walletis not published to npm; it only exists as a 473 MB zip asset on the PirateNetwork GitHub release (prebuilt xcframework + jniLibs). GUI integration is blocked on a packaging decision — npm/yarn cannot install zips, so the package needs to be hosted as a tgz (e.g. thezano-utils-jsEdgeApp-release pattern) or published beforeedge-react-guican swapreact-native-piratechainfor it. Mnemonic/seed derivation is BIP-39-compatible with the old SDK (same sapling addresses), so existing wallets restore in place; first launch re-restores into the registry from the stored mnemonic + birthday and rescans from the wallet's birthday height.Note
High Risk
Large rewrite of sync, balance, transaction mapping, and spend paths for a privacy coin; incorrect handling could affect funds display or broadcasts until GUI ships the new native dependency.
Overview
Reimplements the Pirate Chain (ARRR) plugin on
react-native-pirate-wallet, replacingreact-native-piratechain(peer dependency and lockfile updated; localrnPirateWallet.d.tsadded because the SDK is not on npm).piratechainIois rewritten around the unified SDK: lazy SDK init, fixed app passphrase + Direct tunnel (not Tor), serialized wallet registry restore keyed by the Edge wallet id alias, and a polling synchronizer that maps snapshots to existing yaobupdate/statusChanged/errorevents. Sends use rawbuild_tx→sign_tx→broadcast_txinvoke because the JSsendhelper mishandles field casing.PiratechainEnginedrops block-range paging andotherData.blockRange; history comes from fullgetTransactions()lists withprocessedTxHeightsdeduping. Balances usespendable/total; txs mapPirateTransactionfields (signed amounts, per-tx fees).broadcastTxno longer passes the mnemonic—outputs + fee only. Critical synchronizer errors no longer restart the engine.PiratechainToolsusespiratechainIofor validation, birthday height, and registry registration when deriving the sapling viewing key.Reviewed by Cursor Bugbot for commit 0481ded. Bugbot is set up for automated code reviews on this repo. Configure here.