Skip to content

tao: add subnet alpha token transfers and balance queries#230

Open
conorpp wants to merge 1 commit intomainfrom
feat/tao-alpha-tokens
Open

tao: add subnet alpha token transfers and balance queries#230
conorpp wants to merge 1 commit intomainfrom
feat/tao-alpha-tokens

Conversation

@conorpp
Copy link
Copy Markdown
Contributor

@conorpp conorpp commented Mar 27, 2026

Summary

  • Add support for Bittensor Dynamic TAO (dTAO) subnet alpha tokens
  • Alpha balances are queried by enumerating all hotkeys via StakingHotkeys storage and summing Alpha balances per subnet
  • Transfers use UTXO-style position selection across hotkey positions, automatically batched with Utility.batch_all when spanning multiple hotkeys
  • Contract address is simply the subnet netuid (e.g. "64" for subnet 64) — hotkeys are resolved dynamically
  • Adds SubtensorModule.StakeTransferred event parsing for transfer_stake results

Test plan

  • Unit tests for ParseAlphaContract parsing (valid netuids, edge cases, errors)
  • Unit tests for alpha builder: single position, multi-position batch, exact amount, insufficient balance, no positions, invalid contract, non-TAO rejection
  • Integration test: query alpha balance for a known coldkey/subnet
  • Integration test: build and submit a transfer_stake transaction
  • Verify event parsing for StakeTransferred events

🤖 Generated with Claude Code

Support Bittensor Dynamic TAO subnet alpha tokens. Alpha balances are
queried by summing across all hotkeys (via StakingHotkeys storage) for
a given coldkey and subnet. Transfers use UTXO-style position selection
across hotkey positions, batched with Utility.batch_all when multiple
positions are needed. Contract address is the subnet netuid (e.g. "64").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

2 participants