Bitcoin (BTC)
Bitcoin is the first decentralized cryptocurrency, launched in 2009 by the pseudonymous Satoshi Nakamoto as a peer-to-peer electronic cash system. It is a Layer 1 proof-of-work blockchain secured by SHA-256 mining, with a fixed supply of 21 million BTC and an average block time of ten minutes. The network is maintained by independent node implementations, principally Bitcoin Core, and uses the UTXO model with a widely adopted JSON-RPC interface.
Key Features
- UTXO Model: Balances are derived from unspent transaction outputs rather than account states
- Proof of Work: Secured by SHA-256 mining with a difficulty adjustment every 2016 blocks
- 21 Million Supply Cap: A fixed maximum supply enforced by consensus
- ~10-Minute Block Time: Blocks are found roughly every ten minutes on average
- SegWit and Taproot: Modern upgrades enabling witness data, lower fees, and Schnorr signatures
- PSBT Support: Partially Signed Bitcoin Transactions for multi-party and hardware-wallet signing
- Address Formats: Legacy Base58 (P2PKH, P2SH), native SegWit (bech32), and Taproot (bech32m)
- Bitcoin Core RPC: Exposes a JSON-RPC interface familiar to Bitcoin developers
TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.
GetBlock's RPC API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The canonical and normative specification of Bitcoin Core RPC methods is maintained and published solely in the official Bitcoin Core documentation. This resource is the sole authoritative reference implementation of the JSON-RPC 2.0 protocol for Bitcoin node clients.
Network Information
| Property | Value |
|---|---|
| Network Name | Bitcoin Mainnet |
| Native Currency | BTC (1 BTC = 100,000,000 satoshis) |
| Consensus | Proof of Work (SHA-256) |
| Address Format | bech32m (Taproot), bech32 (SegWit), legacy Base58 |
| Model | UTXO |
| Node Software | Bitcoin Core |
Base URL
bashhttps://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>Supported Networks
| Network | JSON RPC | REST | Blockbook (REST) | Blockbook (WebSocket) |
|---|---|---|---|---|
| Mainnet | ✅ | ✅ | ✅ | ✅ |
| Testnet | ✅ | ✅ | ✅ | ❌ |
Quickstart
In this section, you will learn how to make your first call with either:
- Javascript(Axios)
- Python
Setup project
Create and initialize a new project:
bash
mkdir btc-api-quickstart cd btc-api-quickstart npm init --yesInstall Axios
bash
npm install axiosCreate file
Create a new file named
index.js. This is where you will make your first call.Set ES module type
Set the ES module
"type": "module"in yourpackage.json.Add code
Add the following code to
index.js:index.js
javascript
const axios = require('axios'); const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'; const payload = { jsonrpc: '2.0', method: 'getblockcount', params: [], id: 'getblock.io' }; axios.post(url, payload, { headers: { 'Content-Type': 'application/json' } }) .then(response => { console.log('Current Block Number:', response.data.result); }) .catch(error => console.error(error));Replace
<ACCESS-TOKEN>with your actual GetBlock access token.Run the script
bash
node index.jsExpected output (example):
bash
Current Block Number: 830000
Set up the project directory
bash
mkdir btc-api-quickstart cd btc-api-quickstartCreate and activate a virtual environment
bash
python -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activateInstall requests
bash
pip install requestsCreate script
Create a file called
main.pywith the following content:main.py
python
import requests import json url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/" payload = json.dumps({ "jsonrpc": "2.0", "method": "getblockcount", "params": [], "id": "getblock.io" }) headers = { 'Content-Type': 'application/json' } response = requests.post(url, headers=headers, data=payload) print(response.text)Replace
<ACCESS-TOKEN>with your actual access token from GetBlock.Run the script
bash
python main.py
Support
For technical support and questions:
- Support: support@getblock.io