ExtraProof for developers
You can verify Creation Records in your own application. The verifier is available as an npm package for Node.js. Source code, documentation and tests are on GitHub.
- Published version
- 0.1.0
- Runtime
- Node.js 24 or later
- Record format
extraproof/1- Verifier licence
- Apache-2.0
You may use, modify and redistribute the verifier free of charge, including in commercial products. The licence applies only to the verifier, not to the ExtraProof apps.
Quick start
You need Node.js 24 or later with npm. Install the package in your project directory. No npm account or API key is required.
npm install --save-exact @extraara/[email protected]The package includes a signed test record and a matching text file. Try them with:
npx --no-install extraara-verify record \
node_modules/@extraara/verifier/fixtures/extraproof-certificate.json \
--document node_modules/@extraara/verifier/fixtures/extraproof-document.txt \
--jsonTo check your own files, replace the two paths. record checks the JSON file. --document provides the corresponding document. --json returns the result as JSON. Verification runs locally and works offline after installation. --no-install prevents the command from downloading a missing package.
{
"format": "extraproof/1",
"recordIntegrity": "valid",
"documentBinding": "matched",
"signerTrust": "unknown",
"synthetic": true,
"requestedChecksPassed": true,
"errors": []
}The signature and event chain are valid, and the document matches. signerTrust: "unknown" is expected here: no trusted key was supplied for this test. synthetic: true identifies the supplied test data.
Check the npm package's provenance
Version 0.1.0 was published through GitHub Actions. npm links the package to its source code and the workflow run that produced it. Run this in your project directory to check that provenance and the registry signature:
npm audit signaturesThis verifies where the package came from. It does not assess code quality or authorship.
JavaScript
verifyCertificate(recordBytes, options) checks a record. The function is synchronous and does not access files or the network itself. fileBytes contains the document bytes, and trustedKeyIDs contains independently confirmed key fingerprints.
After installing the npm package, save the example as verify-example.mjs and run it in the same project directory. It reads the supplied test files:
import { readFileSync } from 'node:fs';
import { verifyCertificate } from '@extraara/verifier';
const fixtures = './node_modules/@extraara/verifier/fixtures/';
const report = verifyCertificate(
readFileSync(fixtures + 'extraproof-certificate.json'),
{ fileBytes: readFileSync(fixtures + 'extraproof-document.txt') },
);
console.log(JSON.stringify(report, null, 2));
process.exitCode = report.isValid ? 0 : 1;
node verify-example.mjsThis example is for the local test files. For uploads, limit file size before reading and prevent changes to the files during verification. The CLI performs these file checks.
When API arguments are invalid, verifyCertificate throws a TypeError. A malformed record returns a result with entries in errors.
Python, PHP and other backends
You can run the CLI as a subprocess. Pass arguments as a list, read JSON from stdout and check the exit code. Operational errors are written to stderr. For upload services, limit file size and concurrent checks. Do not insert upload filenames into shell commands.
Verification result
The CLI summarises the result and includes the full API report under report. A direct JavaScript call returns that report itself.
| CLI | API report | Meaning |
|---|---|---|
recordIntegrity | integrityValid | Signature and event chain: valid/invalid in the CLI, a boolean in the API. |
documentBinding | fileStatus | matched: identical bytes. mismatched: a different file. notChecked: no comparison performed. notBound: no file binding. |
signerTrust | signerTrusted | pinned-key/unknown in the CLI, a boolean in the API. Confirms only the match with a separately supplied key. |
requestedChecksPassed | isValid | Integrity, the requested file comparison and supported claims are valid. The CLI also accounts for an explicitly requested key match. When using the API, check signerTrusted separately. |
synthetic | synthetic | The record is marked as test data. |
errors | errors, warnings | Errors and limits of verification. A valid signature alone is not enough for a successful overall result. |
Trusting a key
A record contains its public key. You need to establish separately whether that key belongs to a particular person or organisation. Store the confirmed SHA-256 fingerprint in your own configuration and pass it with --trusted-key:
npx --no-install extraara-verify record record.json \
--document document.docx \
--trusted-key "$TRUSTED_KEY_SHA256" --jsonTRUSTED_KEY_SHA256 is the confirmed fingerprint: 64 lowercase hexadecimal characters. Do not take this value from the record you are checking. Without a pinned key, verification can succeed while the signer remains unknown.
File format
An extraproof/1 record is a JSON file. The document is supplied separately. These are the parts needed for an implementation:
- Envelope
schemaVersion,algorithm,keyID,publicKey,payloadandsignature.- Payload
- Base64-encoded original bytes: session header, events, final hash and closing data.
- Event chain
- Each event has a sequential index, the previous event's hash and its own hash.
- File binding
- Optional SHA-256 hash and byte count of the document selected when the session was closed.
The signature covers the stored payload bytes. Do not serialise decoded JSON again: even different whitespace changes the signed data. The exact byte sequences are defined in the format specification.
Verifier limits: 16 MiB per record, 64 MiB per document and 100,000 events. Parser rules and further limits are documented in the API reference.
Supported profiles and limits
The verifier checks extraproof/1 with localObservation and manifests in the extraara-package/0.1 format. Additional signed assurance or environment claims that it does not support cause verification to fail. It does not assign L1–L5 ratings.
PDF attachments and ZIP archives are not extracted. A PDF can be hashed as the original document, but its PDF signature is not checked. Verification does not establish human authorship, absence of AI use, trusted time or current revocation status.
Build an integration
Accept documents and records
- Let users upload the document and record together and associate them with one submission.
- Verify the unchanged files. Load trusted keys from your own configuration.
- Store the verification result, verifier version and applied rules with the submission.
- Show file mismatches, unknown keys and unsupported profiles separately.
For packages containing creation-manifest.json use verifyBundle() or the CLI command package. These also check the manifest signature and record association. Details and an example command are in the package specification and the README.
Build a recorder
A recorder captures events as work happens. At a minimum, define session start, event order, gaps in recording, session end and key management. The specification defines the hash chain and signature. A finished file cannot provide a record of how it was created in the past.
Learning platforms and editor integrations
See Integrations for existing integrations. For a custom integration, the data format, authentication, roles and feedback must fit the target system.
No general REST API is offered here. To discuss an integration, send the target system, its version and the workflow you need.
Technical enquiryError codes
| Exit code | Meaning |
|---|---|
| 0 | The requested checks passed. |
| 1 | Verification failed, for example because of an invalid signature or a file mismatch. |
| 2 | The signer does not match the supplied fingerprint; the other checks passed. |
| 64 | Invalid or missing arguments. |
| 66 | The file cannot be read, changed while being read, exceeds the size limit or is not a regular file. |
Test your integration
- The original record and document must pass verification together.
- Adding one byte to a copy of the test document must produce
mismatchedand exit code 1. The record itself remains intact. - A modified signature must fail the integrity check.
- Without
--document, the file comparison must remainnotChecked. - An incorrect pinned key must fail the key match.
- Unsupported formats and signed profiles must not produce a successful result.
The test suite is in the GitHub repository. Run it there with npm test. Keep original files unchanged and use copies for negative tests. Verification reports are unsigned results of a single verification run.
Downloads and reference
- @extraara/verifier on npmPublished package · version 0.1.0.
- GitHub repositorySource code, tests and version history.
- JavaScript exampleRun with the installed npm package.
- API referenceFunctions, options, results and limits.
- Record specificationEnvelope, signature and event chain.
- package specificationManifest, record and document association.
- JSON SchemaRecord structure.
- Trust modelKeys, local observations and limits.
The verifier is licensed under Apache-2.0. You may use, modify and redistribute it free of charge, including in commercial products. When redistributing it, include the licence text and required copyright notices, and mark changes. The licence covers only the verifier's code, documentation and test data. It does not cover the ExtraProof apps or the account and licensing service.