feat(sdk-coin-tao): build claimRootWithHotkey extrinsic from intent - #9447
Closed
bitgo-ai-agent-dev[bot] wants to merge 4 commits into
Closed
feat(sdk-coin-tao): build claimRootWithHotkey extrinsic from intent#9447bitgo-ai-agent-dev[bot] wants to merge 4 commits into
bitgo-ai-agent-dev[bot] wants to merge 4 commits into
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
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
Contributor
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
|
Closing in favor of PR #9448 which consolidates all changes 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
ClaimRootWithHotkeymethod name, args interface, and Joi validation schema to@bitgo/abstract-substrateClaimRootBuilderinsdk-coin-taothat builds aSubtensorModule.claimRootWithHotkey(hotkey)Substrate extrinsicClaimRootTransactionwithtoJson(),loadInputsAndOutputs(), andexplainTransaction()ClaimRootBuilderintoTransactionBuilderFactory(dispatch viagetClaimRootBuilder()andfrom()routing)verifyTransactioninTaoto short-circuit recipient validation forStakingClaimtype (claim carries no transfer recipient)ClaimRootTxDatainterface from the lib index for downstream consumersClaimRootBuilder(validation, round-trip, factory dispatch, explanation)verifyTransactiontests covering theStakingClaimbypass pathWhy
TaoClaimRootIntent { hotkey, netuid: 0 }; WalletPlatform must callgetClaimRootBuilder()to build and sign the extrinsic before broadcastingtypestring'StakingClaim'aligns with the WalletPlatform enum and staking-service contract so the full TSS signing path works end-to-endTest plan
ClaimRootBuilderunit tests: setter validation, unsigned/signed build, round-trip, transaction explanation, factory dispatch, invalid type rejectionverifyTransactiontests:StakingClaimtype bypasses recipient check, transfer tx with no recipients passesTicket: SI-1171