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
  • Next Event Registration
  • Nth Event Verification
  • Benefits
  1. πŸ”—Linked Records Β§
  2. Tutorials

Provenance Integrity

PreviousCollection IntegrityNextAPI Workflow

A business wants to be assured about the data integrity (accuracy and authenticity) of the provenance (or history of events) of their publicly linked company documents. To achieve that, the business wants to easily verify the provenance of a company document.

This use case is an extension of the Data Integrity use case (described here) and is similar to the Collection Integrity use case (described in the previous section). The solution includes these steps for each company document event:

  • Next event registration – the company document is kept hidden but registered and linked on the blockchain

  • Nth event verification – the company document and links are compared with the blockchain to determine validity

Please be aware that verification always requires the original company document.

We will use the Linked Record REST API class wrapper as described in the previous section.

Next Event Registration

Whenever the company document is updated in the application database, this procedure is performed to register a fingerprint of the new company document on the blockchain, and record all provenance:

  aRecord = "get the latest company document for the documentId"

  aSalt = time.now()

  oldLocation = either 0 or provenance[count-1].location for the documentId

  newLocation = event.upsert(aRecord, aSalt, oldLocation) // Register a fingerprint

  // persist aRecord, aSalt, newLocation in provenance[count] for the documentId

  // increment and persist count for the documentId

Nth Event Verification

At any arbitrary time later, the business can verify the Nth previous version (0 for the latest) of the company document with this procedure:

  nthRecord = provenance[count-1-Nth].record for the documentId

  nthSalt = provenance[count-1-Nth].salt for the documentId

  previousLoc = either 0 or collection[count-1-Nth - 1].location for the documentId

  nthLocation = provenance[count-1-Nth].location for the documentId

  nextLoc = either 0 or collection[count-1-Nth] + 1].location for the documentId

  result = event.verify(nthRecord, nthSalt, previousLoc, nthLocation, nextLoc)

  if result = match // nthRecord and links are verified as valid
  if result = mismatch // nthRecord or links are verified as invalid
  if result = error // try again later

"nthRecord" must contain identical fields to those that were originally registered to the blockchain.

Handling the different possible responses is described in detail in the Data Integrity use case here.

The actual syntax is shown in Verify Link Record below.

The business can employ iteration to verify a range of versions of the company document.

This example ignores issues like the data retention policy of the business.

Benefits

  • Provides high confidence of the validity of verified company documents for the business

  • Provides high confidence to auditors/users who verify the original company document of its validity.