Intro
A blockchain is a chain of snapshots. Between each block, people make transactions. Balances change and UTXOs (unspent transaction outputs) move from one address to another. When each block is created, these transactions are confirmed and immortalized in that block. You can’t undo a transaction once it’s been confirmed on the chain. Public blockchains allow us to explore all history and activity on the chain.
Because the actual history is saved in the blocks, we explore them with a block explorer. Block explorers allow anyone to verify the history of transactions and addresses. To use one, you don’t need any additional disk space and you don’t need to install anything. The only requirements are a browser and an internet connection. Anyone with a smartphone can use a block explorer to analyze transaction and address history in the blocks.
Why Are Block Explorers Important?
Block explorers are essentially the backbone of all blockchain related apps. Not only are they used for viewing and verifying transactions, they are also used for in-depth chain analysis and retrieving live blockchain information without running a full node. If a lightwallet can build and sign transactions offline, it can fetch live balances and submit these transactions to the chain using a block explorer. Wallets often interact with these block explorers using an API (Application Programming Interface).
Their websites are useful, but API integration is where a block explorer’s real power comes from. Block explorer APIs are the glue holding together SDKs, wallets, analytics tools, and exchanges. When you engage in a crypto transaction, your wallet usually sees its status by talking to a block explorer. If the transaction hasn’t been confirmed, the explorer will return its status as pending. Once the transaction has included in a block, the explorer returns its status as confirmed.
As mentioned earlier, block explorers are ideal for analysis as well. You can look up any public address on the chain and see its entire transaction history. There are many reasons to track the history of an address. In my own experience, this has been to fetch wallet balances, confirm payments and auditing token presales that are often grossly exaggerated. Shielded addresses are different however. Since they are fully encrypted, the only way to view their full history is with the wallet keys.
How To Use A Block Explorer
Now, let’s learn how to actually use a block explorer. As you can see in the image below, we can search a block, transaction, address, or xpub (public key). Follow along, and you’ll know how to use it in no time!
Analyzing a Block
The image below shows detailed information about the Ycash/Zcash fork at block 570,000. As you can see, it includes the transaction count, height (block number), timestamp, block size (in bytes), and several other things including the mining difficulty.
Analyzing an Address
This is the Ycash Foundation’s transparent donation address: s1P6ZAeyvokGh3MSxN3bLRk9r5EWdSd34Az
. You can view its full history here. You can see the most recent transaction (as of the date this article was published) in the image below. It received a donation of 3000 YEC
from No Inputs
. There is one reason for this: the payment came from a shielded address. A Ycash shielded address allows the donor to remain completely anonymous. The explorer gives us a great summary of activity as well. In total, this address has received 20273.20020708 YEC
and sent (spent) 17273.19820708 YEC
. This leaves it with a current balance of 3000.002 YEC
. As you can see, the entire history of this address is completely public for anyone to audit and analyze.
Analyzing a Transaction
Take a look at the transaction below. The txid
(transaction id) is 0032a7d0570db5a7274608708d2510cf643319939d4185896bb727b552ce9e97
. You can view it yourself here. If you look at the summary, we have a total input of 7.421885 YEC
. The total output here is more interesting, 0 YEC
. Look at the details, multiple inputs of 1.484375 YEC
were all combined into a transaction with no outputs. At first glance, it might seem like these coins are being burned. However, this is not the case. These are likely mining rewards getting sent to a shielded address.
API Access
Using Trezor’s BlockBook API, we’ll fetch the current status of the Ycash blockchain. You can view information on their API here.
Python
import requests
import json
def get_current_block(explorer_url):
response = requests.get(f"{explorer_url}")
data = response.json()
return data
if __name__ == "__main__":
#url of the block explorer
explorer_url = "https://explorer.ycash.xyz/api/status"
current_block = get_current_block(explorer_url)
#print the current block
print(f"Current Block: {current_block}")
Here is an example JSON response from the server. As you can see, it contains pretty much all of the information that populates the status page.
Current Block: {'blockbook': {'coin': 'Ycash', 'host': 'ip-10-0-193-64', 'version': 'unknown', 'gitCommit': 'unknown', 'buildTime': 'unknown', 'syncMode': True, 'initialSync': False, 'inSync': True, 'bestHeight': 2343417, 'lastBlockTime': '2025-01-20T19:41:10.692971787-08:00', 'inSyncMempool': True, 'lastMempoolTime': '2025-01-20T19:42:10.708034993-08:00', 'mempoolSize': 0, 'decimals': 8, 'dbSize': 18880981458, 'about': 'Blockbook - blockchain indexer for Trezor wallet https://trezor.io/. Do not use for any other purpose.'}, 'backend': {'chain': 'main', 'blocks': 2343418, 'headers': 2343418, 'bestBlockHash': '000005ac742e4e420b92dc79382da0673ee822483e07917ae64ea81636d26bd2', 'difficulty': '253.5189056662222', 'sizeOnDisk': 24920635485, 'version': '4040450', 'subversion': '/YcashCpp:4.4.4/', 'protocolVersion': '270013', 'consensus': {'chaintip': '19bd2d2f', 'nextblock': '19bd2d2f'}}}
JavaScript
const axios = require("axios");
const explorerUrl = "https://explorer.ycash.xyz/api/status";
(async () => {
const response = await axios.get(explorerUrl);
console.log(`Current Block: ${JSON.stringify(response.data, null, 4)}`);
})();
Here is the output.
Current Block: {
"blockbook": {
"coin": "Ycash",
"host": "ip-10-0-193-64",
"version": "unknown",
"gitCommit": "unknown",
"buildTime": "unknown",
"syncMode": true,
"initialSync": false,
"inSync": true,
"bestHeight": 2343430,
"lastBlockTime": "2025-01-20T20:01:26.511088539-08:00",
"inSyncMempool": true,
"lastMempoolTime": "2025-01-20T20:01:26.687990693-08:00",
"mempoolSize": 0,
"decimals": 8,
"dbSize": 18890467871,
"about": "Blockbook - blockchain indexer for Trezor wallet https://trezor.io/. Do not use for any other purpose."
},
"backend": {
"chain": "main",
"blocks": 2343430,
"headers": 2343430,
"bestBlockHash": "000005f8fa03da84e88168dbf8137c78a0b26dfe816397f0fa2b4bfe963e96b8",
"difficulty": "262.4715894868586",
"sizeOnDisk": 24920645375,
"version": "4040450",
"subversion": "/YcashCpp:4.4.4/",
"protocolVersion": "270013",
"consensus": {
"chaintip": "19bd2d2f",
"nextblock": "19bd2d2f"
}
}
}
Here are just a few of the many things you can fetch using a block explorer API:
Status
Get block hash
Get transaction
Get address
Get UTXO
Get block
Send transaction
Balance history
Where Does All This Data Come From?
Nodes are the actual backbone to all blockchain networks. Under the hood, block explorers are either running actual blockchain nodes or talking to them. When we send getblock
to a block explorer it performs a remote procedure call to an actual network node, likely getblockchaininfo
. The node sends a response to the explorer, and the explorer then updates based on the response from the node.
Nodes come pre-equipped with some explorer functionality built in. If you open up your ycash.conf file, you can add a couple of very important flags. Combined, these give you the ability to index any transaction on the chain. This is the very foundation of how a block explorer works.
insightexplorer=1
: Turns on the Insight API. This is the original block explorer API. It’s been a public standard for over a decade.txindex=1
: Tells the node to save all transaction data to the chain. Without this flag, there is no data to “explore.”
Most modern block explorers use APIs like Insight and Blockbook, both of which are recognized standards in the industry. These APIs streamline the interaction between explorers and nodes, enabling wallets, developers, and applications to fetch blockchain data quickly and efficiently.
Types of Block Explorers
Throughout this article, we’ve been using https://explorer.ycash.xyz/. This is a single chain explorer. A single chain explorer is used to explore only one blockchain. Some services offer multichain explorers. Blockchair supports just about every big name chain you can imagine. In total, they provide support for 47 separate blockchains. Bitquery supports even more chains! Currently, Ycash isn’t supported by either company but feel free to submit a ticket to either of them using the links below.
Etherscan is one of the best known block explorers and standards for Ethereum-based block explorers. Almost all Ethereum based chains have an explorer based on Etherscan such as Optimism, Arbitrum, and Base. If you wish to track smart contracts or any other Defi activity, these explorers are excellent.
Limitations of Block Explorers
As you might have noticed when we analyzed the Ycash Donation address, there was a donation of 3,000 YEC from a shielded address. This address couldn’t be found by the block explorer. Shielded addresses are impossible to find using a block explorer because their entire history is encrypted. You need the private viewkeys to a shielded address in order to view its transaction history.
Conclusion
A block explorer is an excellent tool for anyone looking to get more acquainted with how blockchains work and where the money goes. They support all sorts of infrastructure like wallets and exchanges. However, the support they provide can also become a central point of failure, so they are not a full replacement for running your own node. Go ahead and check out our newest explorer. Inspect addresses, transactions, and new blocks. If you’d like to learn more about Ycash specifically, take a look at the links below.