Skip to main content

eth_getStorageAt

Examines storage contents from smart contracts deployed on the Bittensor network. This method provides direct access to contract state variables, enabling inspection of AI subnet configurations, validator registrations, and network parameters.

Parameters​

ParameterTypeRequiredDescription
addressstringYesSmart contract address (20 bytes) to inspect
positionstringYesStorage slot position as hex string (32 bytes, 0x-prefixed)
blockNumberstringYesBlock number in hex or block tag ("latest", "earliest", "pending")

Bittensor Storage Patterns​

  • Registry contracts: Subnet IDs, validator keys, and network parameters
  • Token contracts: TAO balances, staking amounts, and delegation mappings
  • AI model state: Training progress, consensus data, and performance metrics
  • Governance: Proposal states, voting records, and parameter updates

Returns​

A 32-byte hex string containing the storage value. Data smaller than 32 bytes is left-padded with zeros for consistent formatting.

Implementation Examples​

# Read storage from Bittensor registry contract
curl -X POST https://api-bittensor-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getStorageAt",
"params": [
"0x0000000000000000000000000000000000000800",
"0x0",
"latest"
],
"id": 1
}'

Response Example​

{
"jsonrpc": "2.0",
"id": 1,
"result": "0x0000000000000000000000000000000000000000000000000000000000000010"
}

Bittensor-Specific Use Cases​

  • Subnet Analysis: Monitor subnet registration, validator counts, and network topology
  • Validator Monitoring: Track validator stakes, performance metrics, and consensus participation
  • TAO Token Tracking: Analyze token distribution, staking patterns, and delegation flows
  • AI Model State: Inspect model training progress and consensus mechanisms
  • Network Governance: Monitor proposal voting and parameter changes

Storage Layout for AI Networks​

Validator Registry​

// Common validator storage pattern
const validatorSlots = {
totalValidators: '0x0', // Total count at slot 0
validatorKeys: 1, // Mapping: validatorId => key
validatorStakes: 2, // Mapping: validator => stake
subnetAssignments: 3, // Mapping: validator => subnet
lastActive: 4 // Mapping: validator => timestamp
};

Subnet Configuration​

// Subnet state storage
const subnetSlots = {
subnetCount: '0x5', // Total active subnets
subnetConfigs: 6, // Mapping: subnetId => config
validatorCounts: 7, // Mapping: subnetId => count
consensusParams: 8, // Mapping: subnetId => params
rewards: 9 // Mapping: subnetId => rewards
};

TAO Token and Staking​

// Token and staking storage
const stakingSlots = {
totalStaked: '0xa', // Total TAO staked
userStakes: 11, // Mapping: user => amount
delegations: 12, // Mapping: delegator => validator
stakingRewards: 13, // Mapping: staker => rewards
lockPeriods: 14 // Mapping: stake => unlock_time
};

AI Network Considerations​

  • TAO amounts use 9 decimal places (1 TAO = 1e9 units)
  • Validator keys are often stored as addresses in the rightmost 20 bytes
  • Subnet IDs are typically small integers stored in 32-byte slots
  • Consensus data may be packed efficiently to minimize storage costs
  • Historical validator performance may be stored in array structures

Need help? Contact our support team or check the Bittensor documentation.