Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@0xcert/certification

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@0xcert/certification

Ethereum certification for 0xcert protocol.

  • 0.0.0-alpha1
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source
// VERIFICATION EXAMPLE
// I share an evidence file that proofs certain JSON paths (e.g. public JSON)
// I have an object with just some data.
// The function recreates a recipe for this partial data object and assignes is to the evidence file.
// At this stage we modified evidence file with data we know.
// We then calculate the imprint which must match the one stored in the token.
// NOTE: Custom fields always pass.

// WORDING
// evidence -> consists of proofs -> forms an imprint
// data object -> consists of properties (props)

// USAGE
// Define arbitrary data object.
const data = { ... };
// Define certificate with JSON schema definition.
const cert = new Cert({ schema: { ...} });
// Notarize data object (returns all proofs for whole data object).
const proofs = await cert.notarize(data);
// Expose selected data keys (returns proofs and exposed values from which an imprint can be calculated).
const proofs = await cert.disclose(exampleData, [ ...paths... ]);
// Verify data object against proofs generated with function `disclose` (if object is valid, an imprint is the right root hash).
const imprint = await cert.calculate(data, proofs);
// Generate root hash from complete data object.
const imprint = await cert.imprint(data);

FAQs

Package last updated on 22 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc