Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Blockchain certificates JSON-LD context and JSON schemas

Project Description
[![Build Status](https://travis-ci.org/blockchain-certificates/cert-schema.svg?branch=master)](https://travis-ci.org/blockchain-certificates/cert-schema)
[![PyPI version](https://badge.fury.io/py/cert-schema.svg)](https://badge.fury.io/py/cert-schema)

# cert-schema

Blockchain Certificate schemas extend those of [Open Badges](https://openbadgespec.org/). As with Open Badges, 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](https://github.com/blockchain-certificates/cert-verifier-js) project.

* [Blockcerts JSON Schema](docs/schema-2.md)

## Example

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

```json
{
"@context": [
"https://w3id.org/openbadges/v2",
"https://w3id.org/blockcerts/v2"
],
"type": "Assertion",
"id": "urn:uuid:bbba8553-8ec1-445f-82c9-a57251dd731c",
"badge": {
"id": "urn:uuid:82a4c9f2-3588-457b-80ea-da695571b8fc",
"type": "BadgeClass",
"name": "Certificate of Accomplishment",
"image": "data:image/png;base64,...",
"description": "Lorem ipsum dolor sit amet, mei docendi concludaturque ad, cu nec partem graece. Est aperiam consetetur cu, expetenda moderatius neglegentur ei nam, suas dolor laudem eam an.",
"criteria": {
"narrative": "Nibh iriure ei nam, modo ridens neglegentur mel eu. At his cibo mucius."
},
"issuer": {
"id": "https://www.blockcerts.org/samples/2.0/issuer-testnet.json",
"type": "Profile",
"name": "University of Learning",
"url": "https://www.issuer.org",
"email": "contact@issuer.org",
"revocationList": "https://www.blockcerts.org/samples/2.0/revocation-list-testnet.json",
"image": "data:image/png;..."
}
},
"recipient": {
"hashed": false,
"identity": "eularia@landroth.org",
"type": "email"
},
"recipientProfile": {
"type": [
"RecipientProfile",
"Extension"
],
"publicKey": "ecdsa-koblitz-pubkey:mtr98kany9G1XYNU74pRnfBQmaCg2FZLmc",
"name": "Eularia Landroth"
},
"issuedOn": "2017-06-29T14:58:57.461422+00:00",
"verification": {
"publicKey": "ecdsa-koblitz-pubkey:msBCHdwaQ7N2ypBYupkp6uNxtr9Pg76imj",
"type": [
"MerkleProofVerification2017",
"Extension"
]
},
"signature": {
"type": [
"MerkleProof2017",
"Extension"
],
"targetHash": "637ec732fa4b7b56f4c15a6a12680519a17a9e9eade09f5b424a48eb0e6f5ad0",
"merkleRoot": "f029b45bb1a7b1f0b970f6de35344b73cccd16177b4c037acbc2541c7fc27078",
"anchors": [
{
"sourceId": "d75b7a5bdb3d5244b753e6b84e987267cfa4ffa7a532a2ed49ad3848be1d82f8",
"type": "BTCOpReturn"
}
],
"proof": [
{
"right": "11174e220fe74de907d1107e2a357e41434123f2948fc6b946fbfd7e3e3eecd1"
}
]
}
}

```

## Open Badge Extensions

Details on [Blockcerts extensions to Open Badges](docs/open_badge_v2_extensions.md)

## Publishing package to pypi

- [First time info](http://peterdowns.com/posts/first-time-with-pypi.html)
- Publish script: `./release_package.sh`


## Unit tests

This project uses tox to validate against several python environments.

1. Ensure you have an python environment. [Recommendations](https://github.com/blockchain-certificates/developer-common-docs/blob/master/virtualenv.md)

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 [info@blockcerts.org](mailto:info@blockcerts.org) with questions

Release History

Release History

This version
History Node

2.1.2

History Node

2.1.1

History Node

2.1.0

History Node

2.0.9

History Node

2.0.8

History Node

2.0.7

History Node

2.0.6

History Node

2.0.5

History Node

2.0.4

History Node

2.0.3

History Node

2.0.2

History Node

2.0.1

History Node

2.0

History Node

2.0b20

History Node

2.0b19

History Node

2.0b18

History Node

2.0b17

History Node

2.0b16

History Node

2.0b15

History Node

2.0b14

History Node

2.0b13

History Node

2.0b12

History Node

2.0b11

History Node

2.0b9

History Node

2.0b8

History Node

2.0b7

History Node

2.0b6

History Node

2.0b5

History Node

2.0b4

History Node

2.0b3

History Node

2.0b2

History Node

2.0b1

History Node

2.0a4

History Node

2.0a3

History Node

2.0a2

History Node

2.0a1

History Node

1.2.21

History Node

1.2.20

History Node

1.2.19

History Node

1.2.18

History Node

1.2.17

History Node

1.2.16

History Node

1.2.15

History Node

1.2.14

History Node

1.2.13

History Node

1.2.12

History Node

1.2.11

History Node

1.2.10

History Node

1.2.9

History Node

1.2.8

History Node

1.2.7

History Node

1.2.6

History Node

1.2.5

History Node

1.2.4

History Node

1.2.3

History Node

1.2.2

History Node

1.2.1

History Node

1.2.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
cert-schema-2.1.2.tar.gz (20.1 kB) Copy SHA256 Checksum SHA256 Source Oct 15, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting