Skip to main content

Blockchain certificates JSON-LD context and JSON schemas

Project description

Build Status PyPI version

cert-schema

Blockchain Certificate schemas implement those of Verifiable Credentials. As with Verifiable Credentials, we've provided both a JSON-LD context and JSON schema. The purpose of the JSON-LD context is to map types to Internationalized Resource Identifiers (IRIs), providing semantic context for data. The JSON Schema is used for syntactic validation.

This python package allows verification of a Blockchain Certificate against the JSON schemas as a convenience. This is not the same as verifying the contents of a certificate against what is stored on the blockchain. See the cert-verifier-js project.

Example

TODO update for V3 once cert-issuer issues one

The following is a Blockchain Certificate issued on the testnet Bitcoin network.

{
  "@context": [
    "https://www.w3.org/2018/credentials/v1",
    "https://www.blockcerts.org/schema/3.0-alpha/context.json",
    "https://www.w3.org/2018/credentials/examples/v1"
  ],
  "id": "urn:uuid:bbba8553-8ec1-445f-82c9-a57251dd731c",
  "type": [
    "VerifiableCredential"
  ],
  "issuer": "did:example:23adb1f712ebc6f1c276eba4dfa",
  "issuanceDate": "2010-01-01T19:73:24Z",
  "credentialSubject": {
    "id": "did:example:ebfeb1f712ebc6f1c276e12ec21",
    "alumniOf": {
      "id": "did:example:c276e12ec21ebfeb1f712ebc6f1"
    }
  },
  "signature": {
    "type": "MerkleProof2019",
    "created": "2020-01-21T12:32:11.693759",
    "proofValue": "z2LuLBVSfnVzaQtvzuA7EaPQsGEgYWeaMTH1p3uqAG3ESx9HYyFzFFrYsyPkZSbn1Ji5LN76jw6HBr3oiaa8KsQenCPqKk7dJvxEXsDnYvhuDHtsrSRbzHdJKd66jAowkzPxPFi3ivyAv7WRK1WV2VhegYVQEnCBTrGJWFUMFFXunTcus7ZyedQvS4sr61X2y8QuJ57ycB5JMEHvUgAVq3qh2g3ucehg2ERKLo98jmqTcsh9HThkECG3BTNYRD3QL7AHWPjxRbQNSA83QNYXcCNA7NaZnCWyjC17ZBj3xszp76XvqFRrLjQbRSbzjVTPtBSV8QjhxThT3KTfgwjRn5JeeXhYvebsTT9YGL3W4ufzFRDpH79n5KPiaj1BPbEUfUq7vf2dg26QWeZBi7ME56",
    "proofPurpose": "assertionMethod",
    "verificationMethod": "ecdsa-koblitz-pubkey:0x7e30a37763e6Ba1fFeDE1750bBeFB4c60b17a1B3"
  }
}

Publishing package to pypi

Unit tests

This project uses tox to validate against several python environments.

  1. Ensure you have an python environment. Recommendations

  2. Run tests

    ./run_tests.sh
    

Compile markdown from schema

Note that json-schema-to-markdown doesn't handle ref schemas well, so you will need to manually update any 'undefined' references.

scripts/generate_markdown.js builds the markdown-formatted schemas from json

Contact

Contact us at the Blockcerts community forum.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cert-schema-3.7.2.tar.gz (56.8 kB view details)

Uploaded Source

Built Distribution

cert_schema-3.7.2-py3-none-any.whl (85.4 kB view details)

Uploaded Python 3

File details

Details for the file cert-schema-3.7.2.tar.gz.

File metadata

  • Download URL: cert-schema-3.7.2.tar.gz
  • Upload date:
  • Size: 56.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for cert-schema-3.7.2.tar.gz
Algorithm Hash digest
SHA256 db8acba68f33512380069b26d77bf395f9becf3cad734c0881cfcb5069895203
MD5 2a07762137d610b9bb771c634ea59667
BLAKE2b-256 75b1e537684df3352287749c952721b28463c139243addbd3ed5c346417c5411

See more details on using hashes here.

File details

Details for the file cert_schema-3.7.2-py3-none-any.whl.

File metadata

  • Download URL: cert_schema-3.7.2-py3-none-any.whl
  • Upload date:
  • Size: 85.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.14

File hashes

Hashes for cert_schema-3.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c44bdaaf14c713a50c6e26aca3b101dcb04cd55feb871c70dc1b5419a1635ea3
MD5 22b6690b5dfb39919d474550c5fb436e
BLAKE2b-256 ef8c23b82ab143f65775350b1f49cff5fd82badc4f4f7300d704be5574e1d267

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page