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

PropertyValue
Network NameBitcoin Mainnet
Native CurrencyBTC (1 BTC = 100,000,000 satoshis)
ConsensusProof of Work (SHA-256)
Address Formatbech32m (Taproot), bech32 (SegWit), legacy Base58
ModelUTXO
Node SoftwareBitcoin Core

Base URL

bashhttps://shared.eu-central-1.getblock.io/<ACCESS_TOKEN>

Supported Networks

NetworkJSON RPCRESTBlockbook (REST)Blockbook (WebSocket)
Mainnet✅✅✅✅
Testnet✅✅✅❌

Quickstart

In this section, you will learn how to make your first call with either:

  • Javascript(Axios)
  • Python
  1. Setup project

    Create and initialize a new project:

    bashmkdir btc-api-quickstart
    cd btc-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create file

    Create a new file named index.js. This is where you will make your first call.

  4. Set ES module type

    Set the ES module "type": "module" in your package.json.

  5. Add code

    Add the following code to index.js:

    index.js

    javascriptconst 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.

  6. Run the script

    bashnode index.js

    Expected output (example):

    bashCurrent Block Number: 830000
  1. Set up the project directory

    bashmkdir btc-api-quickstart
    cd btc-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create script

    Create a file called main.py with the following content:

    main.py

    pythonimport 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.

  5. Run the script

    bashpython main.py

Support

For technical support and questions:

See Also