nChain Event
Back to All
V.1.3.1
V.1.3.1
  • nChain Event User Guide
  • Overview
    • Introduction
      • Target Audience
    • Features and Benefits
      • Independent Operations
      • Web3 Development
    • Core Concepts
    • Encoded and Unencoded Records
  • Using nChain Event
    • Initial Set-Up
  • Independent Records
    • Introduction
    • Functional Description
      • Write Record
      • Read Record
      • Verify Record
    • Use Cases
      • Lucky Number Tickets
      • Internet of Things (IoT) Data
      • Intellectual Property Rights (IPR) Evidence
      • Car Dealership
    • Tutorials
      • Data Integrity
    • API Workflow
      • Write Record
      • Get Location Status
      • Read Record
      • Verify Record
  • Linked Records
    • Introduction
      • Concept - Link Locations
    • Functional Description
      • Create Link Record
      • Read Link Record
      • Update Link Record
      • Delete Link Record
      • Verify Link Record
    • Use Cases
      • Luxury Handbag Provenance
    • Tutorials
      • Collection Integrity
      • Provenance Integrity
    • API Workflow
      • Create Link Record
      • Get Link Location Status
      • Read Link Record
      • Update Link Record
      • Delete Link Record
      • Verify Link Record
  • API Documentation
    • nChain Event API
  • Bitcoin SV Blockchain
    • Features and Benefits
    • Writing to Blockchain
    • Reading from Blockchain
    • Transaction Format
    • Troubleshooting
    • Glossary
Powered by GitBook
On this page
  • Verify Encoded Link
  • Verify Unencoded Link
  • Example Responses
  1. Linked Records
  2. API Workflow

Verify Link Record

PreviousDelete Link RecordNextFeatures and Benefits
  1. Anyone with the original record and information can check whether the record exists at the location

  2. Any type of link record (create, update and delete) can be verified

  3. The result indicates whether there is a match, a mismatch, or unknown (retry later)

Verify Encoded Link

To verify the original record, the verifier will need any previous link location, the record, encoder, salt and the expected location.

Example code:

curl -X POST "$URL/api/v1/linkedrecords/$LOC/match?prevTxId=$LOC1&encode=SHA256(01-02T13.14.15)|Base64" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain" \
     -H "Content-Type: application/octet-stream" \
     --data-binary "hello"
const response = await fetch('${url}/api/v1/linkedrecords/${loc1}/match?
prevTxId=${loc}&encode=SHA256(01-02T13.14.15)|Base64', {
  method: 'POST',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain',
    'Content-Type': 'application/octet-stream'
  },
  body: 'hello'
});

Verify Unencoded Link

To verify the original record, the verifier will need any previous link location, the record and the expected location.

Example code:

curl -X POST "$URL/api/v1/linkedrecords/$LOC/match?prevTxId=$LOC1" \
     -H "x-api-key: $KEY" \
     -H "accept: text/plain" \
     -H "Content-Type: application/octet-stream" \
     --data-binary "hello"
const response = await fetch('${url}/api/v1/linkedrecords/${loc1}/match?
prevTxId=${loc}', {
  method: 'POST',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain',
    'Content-Type': 'application/octet-stream'
  },
  body: 'hello'
});

Example Responses

Example cURL matching response:

{
  "match": true,
  ....
}

Example cURL mismatching response:

{
  "match": false,
  ....
}

Example cURL unknown response:

{
  "title": "Content not found",
  "status": 404,
  ....
}