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

Match

PreviousContentNextNavigate

Verify linked record

post

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

Path parameters
txIdstringRequired

The transaction id of the record to query. Using a value other than a id returned by the LinkedRecords methods has undefined behavior.

Query parameters
encodestringRequired

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

prevTxIdstringOptional

The Id of previous linked record which the record referred to by txId updates or deletes. This parameter must be omitted when verifying create record.

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 content matches the published transaction - 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. 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 nChain Event data transaction
404
The transaction cannot be read from the blockchain. It could either still be in the process of publishing or the miner 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/linkedrecords/{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:44:55.750Z",
    "merkleProof": {
      "index": 1,
      "txOrId": "text",
      "target": "text",
      "nodes": [
        "text"
      ],
      "targetType": "text",
      "proofType": "text",
      "composite": true
    }
  }
}