
Most blockchain queries only return the present state. You check an account, and all you get is its current balance, its current token holdings, its current smart contract state.
But what if you need to look back in time?
- what was an account’s balance 1,000 blocks ago?
- how much did a user stake at a specific point?
- what was the state of a smart contract before an upgrade?
MultiversX Deep History Squad changes everything. It allows you to query any account at any block, just as easily as checking real-time data. Unlike standard observer nodes that track only the latest few blocks, Deep History Squad is a specialized observer node designed to store every single piece of historical data the MultiversX blockchain has ever produced.
This is a game-changer for:
- Developers building dashboards, analytics tools, and dApps.
- Auditors verifying past states for compliance and security.
- DeFi projects tracking staking rewards, vault performance, and liquidity shifts.
(!) This article explores the Deep History Squad’s core functionalities, practical applications, and 3 case studies:
- Total Staking of UTK in buidly guild from xMoney Guilds
- Total Staked BFY Over the Last 255 Epochs - Burnify
- Total delegated EGLD to buidly Staking
We will integrate code examples and data visualizations to demonstrate its analytical capabilities and by the end, you’ll understand why Deep History Squad is a powerful tool for precision data retrieval in the MultiversX ecosystem.
Introduction to MultiversX Deep History Squad
The Deep History Squad is an observer node designed to capture and maintain the complete historical state of the MultiversX blockchain. Unlike standard observers, which only track the latest state, it archives the entire trie data structure, making precise historical queries possible.
This enables
- Historical State Queries — Retrieve the state of an account at any specific block height.
- Comprehensive Data Retrieval — Access token balances, staking data, and smart contract states over time.
- Efficient Data Analysis — Analyze historical trends without reprocessing all past transactions.
Why this matters
By default, most blockchain nodes store only the current state of accounts and smart contracts. While historical transaction logs exist, reconstructing past states requires:
❌ Replaying every transaction up to the target block
❌ Manually parsing storage changes over time
❌ Handling smart contract upgrades & state modifications
This process is slow, expensive, and impractical at scale.
Instead of reconstructing past states manually, Deep History Squad stores the full historical trie data, allowing developers, auditors, and projects to:
✅ Instantly access historical states at any block height
✅ Directly query past balances, staking records, and smart contract storage
✅ Retrieve historical data without replaying transactions
At its core, Deep History Squad is not just an indexing tool, it is a full historical archive of the blockchain, continuously synchronizing with the network and maintaining complete account states and contract storage.
How Deep History Squad Works
Deep History Squad synchronizes continuously with the blockchain, recording all state transitions. To query historical data:
- Specify the Block Nonce (Height): Defines the historical snapshot.
- Provide the Account Address and Key: Retrieves account balances, staking data, or contract states.
- Extract Historical Data: Returns the precise account state as it existed at the specified block.
Standard Observers vs. Deep History Squad

Working with Storage Keys
When querying the state of an account or a smart contract on MultiversX, data is stored in key-value pairs, where both the keys and values are encoded in hexadecimal (hex) format. To interpret this data, it must be converted into readable formats such as strings or decimals.
Example: Discovering Smart Contract Storage Keys
The following JavaScript script helps developers identify all keys stored in a smart contract and decode them from hex to ASCII. This is crucial when trying to understand what data is available and how it is structured within the contract.
const axios = require('axios');
const ADDRESS = "erd1qqqqqqqqqqqqqpgqa0dn0alcymldqdhepluxs659r90qaszvhu4q489f0k"; // Smart Contract Address
const BASE_URL = `https://gateway.multiversx.com/address/${ADDRESS}/keys`;
async function fetchAndConvertPairs() {
try {
const response = await axios.get(BASE_URL);
if (response.data && response.data.data && response.data.data.pairs) {
const pairs = response.data.data.pairs;
console.log("Pairs:");
Object.entries(pairs).forEach(([hexKey, value]) => {
try {
const stringKey = Buffer.from(hexKey, 'hex').toString('ascii');
console.log(`Key (Hex): ${hexKey} | Key (String): ${stringKey}`);
} catch (error) {
console.warn(`⚠️ Could not convert key: ${hexKey}`);
}
});
} else {
console.error("Unexpected response format:", response.data);
}
} catch (error) {
console.error(`❌ Error fetching pairs: ${error.message}`);
}
}
fetchAndConvertPairs();
How This Script Works:
- Queries the Smart Contract: Fetches all key-value pairs stored in the contract’s storage.
- Decodes Hex Keys: Converts each key from hexadecimal to an ASCII string for readability.
- Identifies Useful Data: Helps developers discover meaningful storage variables (e.g., balances, counters, flags).
This approach allows developers to explore the internal structure of smart contract storage effectively. For advanced decoding (like nested or complex data structures), tools such as xConverters can be used to interpret the hex data into various formats.
Querying Historical Data by Block Nonce
Once you’ve identified the relevant keys in a smart contract, the next step is to query the historical state of the blockchain at a specific block. This is made possible through the Deep History Squad, which allows you to fetch the value of any key at any block nonce.
Query Format:
curl -X 'GET' \
'https://deephistoryaddr/address/{ADDRESS}/key/{KEY}?blockNonce={blockNonce}' \
-H 'accept: application/json'
- ADDRESS: The smart contract or account address you want to query.
- KEY: The specific key (in hex) that stores the data of interest.
- blockNonce: The block height representing the specific point in time you want to analyze.
Structure of ESDT Balance Storage in MultiversX
In MultiversX, ESDT (eStandard Digital Token) balances are stored in a key-value format where the value structure can vary depending on the number of decimals associated with the token. However, there is a consistent rule that applies to all ESDT storage data:
- The first 4 bytes of the storage value describe the properties of the ESDT, such as whether it is fungible, non-fungible (NFT), transferable, or freezable.
- The actual token balance starts immediately after these first 4 bytes, with the remaining bytes representing the balance in hexadecimal format.
Example: Decoding BFY Token Balance
Consider the BFY token at the current epoch with the following storage details:
Key (Hex): 454c524f4e44657364744246592d383334346666
Value (Hex): 120c00028e76f2edac27bba497e0
In this value:
The first 4 bytes 120c represent the ESDT properties.
The balance is stored in the remaining part: 00028e76f2edac27bba497e0.
To obtain the actual balance:
Remove the first 4 bytes: 00028e76f2edac27bba497e0
Convert the remaining hex to decimal: 3090621900434059007662048
Apply the denomination for decimals (in this case, 18): Divide the decimal value by 10¹⁸ to obtain the final human-readable balance which is 3090621.900434059007662048
Case Study 1: Total Staking of UTK in Buidly Guild (xMoney Guilds)
Objective: Analyze UTK staking growth within the Buidly Guild using Deep History Squad.
After interrogating the keys of the smart contract, we identified the specific key responsible for tracking UTK staking. For this case study, we worked with the following details:
Smart Contract Address: erd1qqqqqqqqqqqqqpgqa0dn0alcymldqdhepluxs659r90qaszvhu4q489f0k
Key (Hex): 454c524f4e446573647455544b2d326638306539
Decoded Key: ELRONDesdtUTK-2f80e9
This key represents the ESDT token balance for UTK within the Buidly Guild smart contract. The data extracted allowed us to analyze the growth and fluctuation of UTK staking over time.
Data Insights:

Observations: Periodic fluctuations indicating strategic reward withdrawals or restaking activities.
Case Study 2: Total Staked BFY Over the Last 255 Epochs
Objective: Evaluate BFY staking patterns over the last 255 epochs using data from MultiversX Explorer and Deep History Squad.
For this case study, we identified the key tracking the total staked BFY tokens. Through key interrogation, the following details were determined:
Smart Contract Address: erd1qqqqqqqqqqqqqpgqm2mkm02pam4tvtykfs7e8w508vzfvjqrp4ssfrts0f
Key (Hex): 454c524f4e44657364744246592d383334346666
Decoded Key: ELRONDesdtBFY-8344ff
This key provides the ESDT token balance for BFY, allowing us to track the staking trends over the last 255 epochs with precision.
Data Insights:

Observations: Volatility reflecting shifts in staking rewards or governance events.
Case Study 3: Total delegated egld to buidly Staking in last 800 epochs
Objective: Analyze the delegation patterns of EGLD to the Buidly staking provider over the past 800 epochs.
After examining the smart contract’s keys, we identified the key responsible for tracking delegated EGLD to the Buidly staking provider. Here are the details:
Smart Contract Address: erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj8llllspxw799
Key (Hex): 746f74616c416374697665
Decoded Key: totalActive
This key represents the total amount of actively delegated EGLD, which enabled us to analyze delegation patterns over time.
Data insight:

Advantages of Deep History Squad
- Comprehensive Historical Access: Query account states from any historical block.
- Versatile Applications: Applicable for DeFi analytics, security audits, staking platforms, and governance tracking.
- Optimized Efficiency: Rapid data retrieval without reprocessing past transactions.
Applications
- Governance Analysis: Track historical voting power and participation.
- DeFi Monitoring: Analyze liquidity, vault performance, and staking behaviors.
- Security Auditing: Verify historical account states efficiently.
- Storage Analysis: Decode on-chain storage data for detailed contract state reviews.
- Smart Contract Forensics: Retrieve stored contract data from any past block, allowing developers to debug, analyze, and optimize protocols with a granular historical perspective.
Conclusion
If you need a historical snapshot, an account’s balance from 1,000 blocks ago, the exact state of a smart contract at a given moment, or a detailed breakdown of past staking transactions, you’re often left with limited tools and incomplete data. Deep History Squad changes this by offering direct, block-specific access to historical states without requiring full transaction replays or inefficient recalculations. The MultiversX Deep History Squad is a robust tool for querying historical blockchain data with precision. Its capabilities are invaluable for staking analysis, governance tracking, and smart contract audits.
By providing access to complete historical data, it empowers developers, auditors, and analysts to make informed decisions based on comprehensive blockchain insights.
* For developers and organizations interested in leveraging the capabilities of the Deep History Squad, please reach out to us through our official Telegram communities (BeaconX or buidly), where dedicated support is available to assist with integration and technical inquiries.
* Special thanks to Iulian Pascalau for his contributions to the development of key infrastructure components, including mx-epoch-proxy-go, which have helped make this tool possible
* For more details, refer to the MultiversX Deep History Squad documentation.
Placeholder
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.