Public docs
WebsiteTAAL PlatformWhatsOnChain
  • Welcome
  • Introduction
    • Get an API Key
  • Core Products
    • WhatsOnChain
      • Health
      • Chain Info
      • Block
      • Transaction
      • Mempool
      • (Un)Spent Transaction Outputs
      • Address
      • Script
      • Exchange Rate
      • Search
      • WoC Widgets
      • WoC Plugins
      • On-Chain Data
      • Output Tags
      • Stats
      • WebSockets
        • WoC Sockets V1 (Deprecated)
        • WoC Sockets V2 (Beta)
      • Tokens
        • 1Sat Ordinals (Beta)
        • BSV-21 (Beta)
        • STAS Tokens (Beta)
      • Change Log
      • Community Libraries
    • Transaction Processing
      • ARC Endpoints
      • Transaction format and fee rate
    • TAAL Wallet
      • Introduction
      • Architecture
      • Terminology
      • UI Elements
      • Tutorial
    • 1Sat Ordinals tokens API
      • Introduction
      • Terminology
      • Flow Diagram
      • Basic Tutorial - Node
      • Basic Tutorial - Postman
      • API
  • Resources
    • FAQ
    • Support
    • Glossary
    • Acronyms and Abbreviations
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Core Products
  2. Transaction Processing

TAAL Transaction Endpoints

The simplest way to broadcast transactions to BSV is to use the broadcast and the batchBroadcast endpoints. /api/v1/broadcast expects a single transaction whilst /api/v1/batchBroadcast expects a batch of them.

With both of these it is possible to send your request as text with the application/json mimetype or binary with the application/octet-stream mimetype (discussed below).

The binary format has 2 advantages:

  1. The size of the request payload is half of the text equivalent.

  2. Unlike with JSON, the 1st transaction in the binary stream can be processed before the entire payload has been received.

The endpoints are:

curl -X POST https://api.taal.com/api/v1/broadcast
curl -X POST https://api.taal.com/api/v1/batchBroadcast

Please note that these endpoints require a Taal APIKey that can be obtained for free by registering at https://platform.taal.com

/api/v1/broadcast (application/json)

Request body

{
  "rawTx": "bitcoin transaction in hex..."
}

Response, if successful:

201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>

Response, if not successful

400 Bad request
application/json
{
  "status": number,
  "code": number,
  "error": "string"
}

These are the exact responses returned by the bitcoin node.

/api/v1/broadcast (application/octet-stream)

Request body

bitcoin transaction as a stream of bytes (binary) 

Response, if successful:

201 Created
text/plain
<32 byte TXID in 64 hexadecimal characters>

/api/v1/batchBroadcast (application/json)

Request body

[
  {
    "rawTx": "bitcoin transaction in hex..."
  },
  {
    "rawTx": "bitcoin transaction in hex..."
  },
  ....
]

/api/v1/batchBroadcast (application/octet-stream)

Request body

one or more bitcoin transactions as a stream of bytes (binary) 

Response for both text and binary requests:

200 OK
application/json
{
  "txs": [
    {
      "txid": "<32 byte TXID in 64 hexadecimal characters>",
      "returnResult": "success or failure",
      "resultDescription": "string"
    }
  ],
  "failureCount": number
}

The resultDescription contains the exact responses returned by the bitcoin node for each transaction.


Last updated 1 year ago

Was this helpful?