nChain Event API Reference
V.1.4.3 API
V.1.4.3 API
  • About
  • Version History
  • API reference
    • Records
      • Status
      • Content
      • Match
    • Linkedrecords
      • Update
      • Delete
      • Status
      • Content
      • Match
      • Navigate
  • Specification
Powered by GitBook
On this page
  1. API reference
  2. Records

Match

PreviousContentNextLinkedrecords

Verify record

post

Verify whether the supplied record matches the published record. The response indicates whether the records match, mismatch or there is an error.

Path parameters
txIdstringRequired

The transaction id of the record to verify. Using an id other than one returned by write record produces undefined behavior.

Query parameters
encodestringRequired

The same encode parameters as used to create the record. In the case of encoders used without a "salt" parameter, this can be omitted.

Header parameters
x-api-keystringRequired

{your-API-key}

Body
string ยท byteOptional
Responses
200
The transaction has been published. The Response is a JSON structure containing: - match: boolean indicating whether the supplied record matches the published record - confirmation: set if transaction has been included in a valid block (same as with get status endpoint) - confirmedBlocks: Number of confirmations (blocks) at the time of request - blockHash: block hash if transaction has been included in a block - blockTimestamp: block header timestamp (field is set on best-effort basis) - merkleProof: A JSON object as defined in TSC Merkle Proof (https://tsc.bsvblockchain.org/standards/merkle-proof-standardised-format/#JSONform)
400
Invalid request. The response is a JSON structure conforming to https://tools.ietf.org/html/rfc7807. It contains an error code and description of the error. - errorCode can be one of: - TX_ID_PARAM_INVALID: Provided transaction id parameter is not a valid blockchain transaction id - TX_NOT_AN_EVENT_TRANSACTION: Provided transaction hash is not an nChain Event record transaction
404
The transaction cannot be read from the blockchain. It could either still be in the process of publishing or the blockchain has rejected it.
500
An internal error occurred. Retry later. The Response is a JSON structure conforming to https://tools.ietf.org/html/rfc7807
post
POST /api/v1/records/{txId}/match?encode=text HTTP/1.1
Host: {your-URL}
x-api-key: text
Content-Type: application/octet-stream
Accept: */*
Content-Length: 10

"Ynl0ZXM="
{
  "match": true,
  "confirmation": {
    "confirmedBlocks": 1,
    "blockHash": "text",
    "blockTimestamp": "2025-05-09T11:41:15.164Z",
    "merkleProof": {
      "index": 1,
      "txOrId": "text",
      "target": "text",
      "nodes": [
        "text"
      ],
      "targetType": "text",
      "proofType": "text",
      "composite": true
    }
  }
}