How it Works

This section for the XChain UTXO Providers package offers insight into the operational workflow and mechanisms involved in interacting with Unspent Transaction Output (UTXO) providers within blockchain networks.

A specification outlines a generalized interface for API providers, intended for use with XChainJS implementations.

These providers should refrain from generating keys themselves; instead, the xchain-crypto library should handle this task to ensure compatibility across different blockchains.

The providers are solely provided with a master BIP39 phrase, from which they decode a temporary key and address as needed.

Design

The UtxoOnlineDataProvider has the following signature:

import { Address, Asset } from '@xchainjs/xchain-util'

import { ExplorerProvider } from './explorer-provider'
import { Balance, Network, Tx, TxHash, TxHistoryParams, TxsPage } from './types'

export type Witness = {
  value: number
  script: Buffer
}
export type UTXO = {
  hash: string
  index: number
  value: number
  witnessUtxo: Witness
  txHex?: string
}
export interface OnlineDataProvider {
  getBalance(address: Address, assets?: Asset[]): Promise<Balance[]>
  getTransactions(params: TxHistoryParams): Promise<TxsPage>
  getTransactionData(txId: string, assetAddress?: Address): Promise<Tx>
}
export interface UtxoOnlineDataProvider extends OnlineDataProvider {
  getConfirmedUnspentTxs(address: Address): Promise<UTXO[]>
  getUnspentTxs(address: Address): Promise<UTXO[]>
  broadcastTx(txHex: string): Promise<TxHash>
}

Supported Providers

Sochain v3

Provider
Website
Status
FreeTier
Chains supported

sochain v3

Complete

No

BTC, BTC-Testnet, LTC,LTC-Testnet, DOGE, DOGE-Testnet

Blockcypher

Provider
Website
Status
FreeTier
Chains supported

blockcypher

Complete

Yes, rate limited 3 reqs/sec

BTC, BTC-Testnet, LTC, DOGE

Haskoin

Provider
Website
Status
FreeTier
Chains supported

haskoin

Complete

Yes, rate limit unknown

BTC, BTC-Testnet, BCH,BCH-Testnet

Last updated