Skip to content

feat: add WASM-based DOT transaction parsing via @bitgo/wasm-dot#8074

Open
lcovar wants to merge 1 commit intomasterfrom
BTC-0.dot-wasm
Open

feat: add WASM-based DOT transaction parsing via @bitgo/wasm-dot#8074
lcovar wants to merge 1 commit intomasterfrom
BTC-0.dot-wasm

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Feb 6, 2026

Integrates @bitgo/wasm-dot into sdk-coin-dot for WASM-based transaction
parsing using Rust/subxt, replacing the JS txwrapper-polkadot path for
tdot (testnet) signed transactions.

what changed

  • wasmParser.ts: new module with explainDotTransaction() and
    toJsonFromWasm() that parse DOT extrinsics via WASM and map to
    BitGoJS TransactionExplanation / TxData formats. handles transfers,
    staking (bond, unbond, withdraw, chill, payout), proxy (add/remove),
    batch (nested + atomic), and transferAll.

  • transaction.ts toJson(): signed tdot transactions now use the WASM
    path (toJsonFromWasm), which handles metadata-aware signed extension
    parsing (e.g. Westend's AuthorizeCall, StorageWeightReclaim). unsigned
    transactions still use the legacy txwrapper path.

  • webpack config: added ESM alias for @bitgo/wasm-dot so browser
    builds use the fetch-based WASM loader instead of fs.readFileSync.

  • tests: 72+ new test lines in dot.ts covering WASM explain for
    transfers and staking. 511-line byte comparison test suite validating
    WASM builder output matches legacy txwrapper output byte-for-byte
    across all transaction types (transfer, stake, unstake, withdraw,
    chill, proxy, batch).

  • withdrawUnstakedBuilder test fix: numSlashingSpans assertion
    updated from string to number to match actual type.

scope

WASM path is only active for tdot signed transactions, gated by
this._coinConfig.name === 'tdot' && this._signedTransaction. mainnet
dot remains on the legacy path until validation is complete.

TICKET: BTC-3068

@lcovar lcovar force-pushed the BTC-0.dot-wasm branch 2 times, most recently from 8f026fb to 93666ed Compare February 6, 2026 07:20
@lcovar lcovar force-pushed the BTC-0.dot-wasm branch 2 times, most recently from 25ff6c2 to 9573f45 Compare February 19, 2026 23:15
@lcovar lcovar changed the title temp: add WASM integration for DOT feat: add WASM-based DOT transaction parsing and explanation Feb 19, 2026
@lcovar lcovar force-pushed the BTC-0.dot-wasm branch 6 times, most recently from 158a9ee to 5a95281 Compare February 20, 2026 08:30
@lcovar lcovar force-pushed the BTC-0.dot-wasm branch 5 times, most recently from a6c6162 to 37c8882 Compare March 6, 2026 05:29
@lcovar lcovar force-pushed the BTC-0.dot-wasm branch 10 times, most recently from 5d82741 to 25b65b8 Compare March 6, 2026 23:05
Integrates @bitgo/wasm-dot into sdk-coin-dot for WASM-based transaction
parsing using Rust/subxt, replacing the JS txwrapper-polkadot path for
tdot (testnet) signed transactions.

## what changed

- **wasmParser.ts**: new module with `explainDotTransaction()` and
  `toJsonFromWasm()` that parse DOT extrinsics via WASM and map to
  BitGoJS TransactionExplanation / TxData formats. handles transfers,
  staking (bond, unbond, withdraw, chill, payout), proxy (add/remove),
  batch (nested + atomic), and transferAll.

- **transaction.ts toJson()**: signed tdot transactions now use the WASM
  path (`toJsonFromWasm`), which handles metadata-aware signed extension
  parsing (e.g. Westend's AuthorizeCall, StorageWeightReclaim). unsigned
  transactions still use the legacy txwrapper path.

- **webpack config**: added ESM alias for @bitgo/wasm-dot so browser
  builds use the fetch-based WASM loader instead of fs.readFileSync.

- **tests**: 72+ new test lines in dot.ts covering WASM explain for
  transfers and staking. 511-line byte comparison test suite validating
  WASM builder output matches legacy txwrapper output byte-for-byte
  across all transaction types (transfer, stake, unstake, withdraw,
  chill, proxy, batch).

- **withdrawUnstakedBuilder test fix**: numSlashingSpans assertion
  updated from string to number to match actual type.

## scope

WASM path is only active for tdot signed transactions, gated by
`this._coinConfig.name === 'tdot' && this._signedTransaction`. mainnet
dot remains on the legacy path until validation is complete.

BTC-0

TICKET: BTC-0
@lcovar lcovar changed the title feat: add WASM-based DOT transaction parsing and explanation feat: add WASM-based DOT transaction parsing via @bitgo/wasm-dot Mar 6, 2026
@lcovar lcovar marked this pull request as ready for review March 6, 2026 23:34
@lcovar lcovar requested review from a team as code owners March 6, 2026 23:34
@lcovar lcovar requested review from Marzooqa and alextse-bg March 6, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant