---
title: "Haskoin"
description: "Bitcoin Cash through Haskoin Store at api.haskoin.com. Balances, history, unspent outputs, transactions and blocks. Satoshis, no key."
canonical_url: "https://explorers.agntn.dev/providers/haskoin"
---
# Haskoin

> Bitcoin Cash through Haskoin Store at api.haskoin.com. Balances, history, unspent outputs, transactions and blocks. Satoshis, no key.

<provider-facts provider="haskoin">



</provider-facts>

## Address it

```ts
import { Haskoin } from "@agntn/explorers/providers/haskoin";

const bch = new Haskoin(); // or create("haskoin")
await bch.getBalance("bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez", "bitcoincash");
await bch.getTxHistory("bitcoincash:qz3yjg59ypg6jqpwhaxgvjj44jm4hdx0w5wsxw2qez", "bitcoincash", {
  limit: 10,
});
```

One chain, no key. Haskoin Store is an indexer written in Haskell, and api.haskoin.com runs a public instance of it for Bitcoin Cash. `baseUrl` is the network root, `https://api.haskoin.com/bch` by default. Before it, Bitcoin Cash had Blockchair and nothing else, and keyless Blockchair blocks an IP after a handful of reads. Now automatic selection starts on Haskoin, and with `BLOCKCHAIR_API_KEY` set it starts on Blockchair and falls back here. Any other chain is an `UnsupportedChainError`.

## What it reads

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Route
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      balance
    </td>
    
    <td>
      <code>
        /address/{address}/balance
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      history
    </td>
    
    <td>
      <code>
        /address/{address}/transactions/full
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      one transaction
    </td>
    
    <td>
      <code>
        /transaction/{txid}
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      unspent outputs
    </td>
    
    <td>
      <code>
        /address/{address}/unspent
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      block
    </td>
    
    <td>
      <code>
        /block/height/{height}
      </code>
    </td>
  </tr>
</tbody>
</table>

No gas and no tokens. Haskoin keeps no fee estimates at all.

## Gotchas

- CashAddr or legacy, the `bitcoincash:` prefix optional. `@agntn/chains` won't vouch for a bare `1...` as Bitcoin Cash, because the very same string is a Bitcoin address. Fair enough. But you already said `bitcoincash`, so why convert by hand? The provider turns a legacy `1...` or `3...` into its CashAddr twin. Same hash, new spelling. Anything else fails before a request goes out.
- Every input comes with the address and the amount it spends. So the sender and the fee arrive with the transaction itself, no parent lookups like on WhatsOnChain.
- Seen from an address, a transaction is a send when one of its inputs spent from that address. Then `value` is what went to everyone else and `to` is the first of them. Otherwise it's a receive and `value` is what landed on the address.
- History comes newest first and only that way, so `sort: "asc"` throws. Haskoin bounds a listing from above only: `endBlock` goes out as `height`, and `startBlock` throws instead of being ignored.
- `limit` up to 100, and `page` turns into an `offset`. The public instance refuses an offset above 50000, so a page that deep throws before the request.
- Balance splits differently from Mempool. `balance` is Haskoin's `confirmed`: confirmed outputs that nothing spends yet, and a spend still in the mempool already counts. `unconfirmed` is the unspent outputs still waiting in the mempool, never negative. The two add up to what the address holds once the mempool confirms. `funded` is everything ever received, `spent` is the rest.
- No block height on a balance, the endpoint doesn't send one, so `blockNumber` stays null.
- A transaction still in the mempool reads as `pending` at block 0. One Haskoin marks as deleted, pushed out by a double spend or a reorg, reads as `failed`.
- Unspent outputs come in pages of 1000, ten pages at most. The height comes along, the block hash doesn't, so `blockHash` stays null.
- `/block/height/{height}` lists every block seen at that height, orphans too. The provider takes the main chain one. Past the tip the list is empty and that's a `NotFoundError`. The request skips `notx`, because without the list of transactions there's nothing to count.
- A missing transaction or address is a 404, so `NotFoundError`. A 400 carries its reason in `message`, and that reason travels in a plain `ExplorerError`.
- OP_RETURN outputs have no address and never become the recipient. Their pushes land in `opReturn`, read from `pkscript`.
- A block has an empty `miner` and gas fields of `"0"`, like every other chain without gas.

## Where it lives

`src/providers/haskoin.ts`.


## Sitemap

See the full [sitemap](https://explorers.agntn.dev/sitemap.md) for all pages.
