feat(sdk-coin-tao): add ClaimRootWithHotkey extrinsic builder - #9444
Closed
bitgo-ai-agent-dev[bot] wants to merge 4 commits into
Closed
Conversation
…and schema
Add the foundation types needed to build and validate the
SubtensorModule.claimRootWithHotkey Substrate extrinsic for TAO
root network reward claiming (SI-1171).
What changed:
- MethodNames: add ClaimRootWithHotkey: 'claimRootWithHotkey' constant
- iface.ts: add ClaimRootWithHotkeyArgs interface { hotkey: string }
- iface.ts: include ClaimRootWithHotkeyArgs in TxMethod.args union
- txnSchema.ts: add ClaimRootWithHotkeyTransactionSchema requiring
a valid hotkey address
Ticket: SI-1171
Session-Id: ab70e181-1628-4e73-9662-8ef3fe0426ba
Task-Id: 091af7ce-ed42-4177-9ee0-2231917f41fa
Add support for building SubtensorModule.claimRootWithHotkey(hotkey) Substrate extrinsic in sdk-coin-tao. This implements SI-1171, the P0 blocker for the TAO Root Reborn claim feature. Changes: - abstract-substrate: add ClaimRootWithHotkey to MethodNames, ClaimRootWithHotkeyArgs interface, and ClaimRootWithHotkeyTransactionSchema - sdk-coin-tao: add ClaimRootBuilder (builds the extrinsic via defineMethod against subtensorModule pallet), ClaimRootTransaction (toJson/loadInputsAndOutputs/explainTransaction), ClaimRootTxData interface - Register ClaimRootWithHotkey in TransactionBuilderFactory.getBuilder for round-trip decode support - Add testnetV2.ts with updated Bittensor testnet metadata (specVersion 443) that includes claim_root_with_hotkey; existing testnet.ts (specVersion 224) is unchanged to avoid breaking other fixtures - Unit tests covering unsigned build, signed build, round-trip from/build, validation, explanation, and rejection of wrong tx type Ticket: SI-1171 Session-Id: ab70e181-1628-4e73-9662-8ef3fe0426ba Task-Id: 091af7ce-ed42-4177-9ee0-2231917f41fa
…action After review agents flagged a CRITICAL issue: ClaimRootTransaction. loadInputsAndOutputs() called decode() on potentially-null _substrateTransaction after super.loadInputsAndOutputs() returns early — causing TypeError instead of clean no-op. Also add null guard per the same pattern as toJson() (line 10), and strengthen test coverage: - Assert explanation.outputs[0].address equals hotkey - Add factory.from() dispatch test (ClaimRootBuilder routing) - Add signed hex round-trip via from() - Add tx.outputs content assertion - Add loadInputsAndOutputs null-safety test - Add validateDecodedTransaction non-matching method test Ticket: SI-1171 Session-Id: ab70e181-1628-4e73-9662-8ef3fe0426ba Task-Id: 091af7ce-ed42-4177-9ee0-2231917f41fa
Contributor
ralph-bitgo
Bot
force-pushed
the
ashutosh/SI-1171-claim-root-with-hotkey-pt2
branch
from
August 7, 2026 02:03
8c68245 to
758b097
Compare
1 task
bitgo-ai-agent-dev
Bot
force-pushed
the
ashutosh/SI-1171-claim-root-with-hotkey-pt2
branch
from
August 7, 2026 02:03
758b097 to
e5e44da
Compare
Export ClaimRootTxData from the lib index so downstream consumers (wallet-platform) can type the claim transaction payload. Add a verifyTransaction override in Tao that short-circuits recipient validation when txParams.type is 'StakingClaim', mirroring the no-recipient bypass already used for enabletoken. Add unit tests covering both the StakingClaim bypass and the no-recipients path. ClaimRootBuilder, ClaimRootTransaction, TransactionBuilderFactory routing, and the ClaimRootWithHotkeyTransactionSchema were added in the previous commits; this commit completes the integration by: - exporting ClaimRootTxData for WP to reference - guarding verifyTransaction against unnecessary tx decoding for claim-type intents that carry no transfer recipient - exercising both paths in the Tao verifyTransaction test suite Ticket: SI-1171 Session-Id: ab70e181-1628-4e73-9662-8ef3fe0426ba Task-Id: 091af7ce-ed42-4177-9ee0-2231917f41fa
bitgo-ai-agent-dev
Bot
force-pushed
the
ashutosh/SI-1171-claim-root-with-hotkey-pt2
branch
from
August 7, 2026 05:55
d80b50d to
a658723
Compare
ralph-bitgo
Bot
force-pushed
the
ashutosh/SI-1171-claim-root-with-hotkey-pt2
branch
from
August 7, 2026 05:55
a658723 to
d93153f
Compare
Contributor
Author
|
Superseded by #9448 — all changes merged into a single PR as requested. |
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.
What
ClaimRootBuilder(sdk-coin-tao/src/lib/claimRootBuilder.ts): buildsSubtensorModule.claimRootWithHotkey(hotkey)viadefineMethod; implementshotkey()setter,buildTransaction(),fromImplementation(),validateTransaction(),validateDecodedTransaction()ClaimRootTransaction(claimRootTransaction.ts): overridestoJson()(addshotkeyfield),loadInputsAndOutputs()(populates_outputswith hotkey address),explainTransaction()(returns hotkey inoutputs[])ClaimRootTxDatainterface insdk-coin-tao/src/lib/iface.tsTransactionBuilderFactory: registerClaimRootWithHotkeymethod dispatch ingetBuilder()and exposegetClaimRootBuilder()ClaimRootBuilderandClaimRootTransactionfromsrc/lib/index.tssrc/resources/testnetV2.ts: updated Bittensor testnet metadata (specVersion 443, fetched fromtest.finney.opentensor.ai) that includesclaim_root_with_hotkey. The existingtestnet.ts(specVersion 224) is kept unchanged to avoid breaking existing transaction fixturesfrom()on unsigned hex, round-tripfrom()on signed hex, factory dispatch,tx.outputscontent,loadInputsAndOutputsnull-safety,explainTransaction.outputs[0].address, validation, error pathsWhy
sdk-coin-taoto acceptTaoClaimRootIntent { hotkey, netuid: 0 }and produce a signed, broadcastableSubtensorModule.claimRootWithHotkeyextrinsicCLAIM_REWARDSrequests through WalletPlatformTest plan
nix develop . --command bash -c "cd modules/sdk-coin-tao && ../../node_modules/.bin/mocha"— 93 passing, 2 pending, 1 pre-existing failure (requiresBITGOJS_TEST_PASSWORD)cd modules/sdk-coin-tao && ../../node_modules/.bin/tsc --build --incremental --verbose .— no errorsStack
This PR is part 2 of 2 in a stack. Review and merge in order:
master)Ticket: SI-1171