nChain Event
Back to All
V.1.4.3
V.1.4.3
  • nChain Event User Guide
  • 📔Overview
    • Introduction
    • Configuration Symbols
    • Features and Benefits
    • Core Concepts
    • Encoded and Unencoded ‡ Records
  • 🤔Using nChain Event
    • How to Use 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
      • Blockchain Unique Identifiers
    • API Workflow
      • Configure API
      • Write Record
      • Get Location Status
      • Read Record
      • Verify Record †
  • 🔗Linked Records §
    • Introduction
    • Functional Description
      • Create Link Record §
      • Read Link Record §
      • Update Link Record §
      • Delete Link Record §
      • Verify Link Record § †
      • Navigate Linked Record § ¶
    • Use Cases
      • Luxury Handbag Provenance
      • Random Prize Draw
    • Tutorials
      • Collection Integrity
      • Provenance Integrity
    • API Workflow
      • Configure API
      • Create Link Record §
      • Get Link Location Status §
      • Read Link Record §
      • Update Link Record §
      • Delete Link Record §
      • Verify Link Record § †
      • Navigate Link Record § ¶
  • ⚙️API Documentation
    • nChain Event API
  • ⛓️Bitcoin SV Blockchain
    • Features and Benefits
    • Writing to Blockchain
    • Reading from Blockchain
    • Transaction Format
  • ⁉️Troubleshooting
    • Troubleshooting
    • Error Codes
    • Glossary
    • Contact Us
Powered by GitBook
On this page
  • Verify Encoded Record
  • Verify Unencoded Record ‡
  • Example Responses
  1. 🔏Independent Records
  2. API Workflow

Verify Record †

PreviousRead RecordNextIntroduction

Last updated 6 months ago

  1. Anyone with the original record and information can check whether record exists at the location

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

Verify Encoded Record

To verify the original record, the verifier will need the record, encoder, salt and the location.

Example code:

curl -X POST "$URL/api/v1/records/$LOC/match?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/records/${loc}/match?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 Record ‡

To verify the original record, the verifier will need the record and the location.

Example code:

curl -X POST $URL/api/v1/records/$LOC/match \
     -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/records/${loc}/match', {
  method: 'POST',
  headers: {
    'x-api-key': '${key}',
    'accept': 'text/plain',
    'Content-Type': 'application/octet-stream'
  },
  body: 'hello'
});

Example Responses

Example matching cURL response:

{
  "match": true,
  "confirmation": {
    "confirmedBlocks": 2,
    "blockHash": "279062b6c3b09774ce665....0413ea9bdc6c1603819b11b",
    "blockTimestamp": "2024-01-02T13:20:05Z",
    "merkleProof": {
      "index": 1,
      "txOrId": "7d2aef40841f0109....c31c83a5505a4c147e",
      ....
    }
  }
}

Example mismatching cURL response:

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

Example unknown cURL response:

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