Skip to content

Instantly share code, notes, and snippets.

@xpepermint
Last active April 3, 2018 07:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xpepermint/b746bf88b78b7a924af53d72b61d57e5 to your computer and use it in GitHub Desktop.
Save xpepermint/b746bf88b78b7a924af53d72b61d57e5 to your computer and use it in GitHub Desktop.
0xcert protocol specification

Whitepaper: https://0xcert.org/whitepaper.pdf

Non-fungible Token

  • A unique, one-of-a-kind asset.
  • A digital asset like a collectible, a document or a thing.
  • Follows ERC721 specification.

Xcert

  • Non-fungible token in 0xcert protocol.
  • Used for storing a proof of a digital asset.
  • Xcert implements ERC721 specification.
  • Xcert implements ERC721Metadata specification.
  • Xcert implements ERC165.
  • Xcert extends the non-fungible token standard and enables storing a digital asset proof.
  • Xcert supports proof revisions (history chain).

Digital Asset

  • A JSON data object representing assets from the real-world as digital assets.
  • Described by JSON Schema.
  • Following vocabulary of schema.org for easy translation into JSON-LD.
  • Uses DID URI for dependent assets formatted as did:xcert:{contract-address}/{token-id}/{revision}.

Example:

{ 
  "expires": "2020-01-01",
  "name": "Web developer",
  "issuer": "did:xcert:0xff0asdjd38d8s8a8g73n2n5n12m3n1n5b2/100/0",
  "owner": "did:xcert:0xba0adddd91d8s8a8g73n2n5n12m5h1n5b3/200/latest" 
}

Digital Asset Proof

  • A cryptographic hash string.
  • Created from digital asset data object.
  • Supports any algorithm.
  • Provable by creating the hash locally and then compare it with the one stored in token.
  • Will support 0-proof-knowledge verification in the future.

Digital Asset Metadata

  • A JSON data object representing digital asset from the real-world.
  • Includes ERC721Metadata JSON fields.
  • Includes cursor for paginating asset revisions.
  • Includes data for disclosing asset data fields.
  • Served publically through HTTP where the URL should be formatted as {protocol}://{domain}/dids/did:xcert:{contract-address}/{token-id}/{revision}.
  • HTTP response includes a Link header pointing to JSON Schema definition where the URI should be formatted as {protocol}://{domain}/schemas/{asset-name}/{version}-metadata.

Example:

GET https://0xcert.org/dids/did:xcert:0xff0asdjd38d8s8a8g73n2n5n12m3n1n5b2/100/latest HTTP/1.1

200 OK
Content-Type: application/json
Link: <https://0xcert.org/schemas/diploma/1.0.0-metadata> rel=describedBy
{
  "description": "A document used to prove education of a person.",
  "cursor": {
    "current": "https://...",
    "next": "https://...",
    "prev": "https://..."
  },
  "data": {
    "expires": "2020-01-01"
  },
  "image": "https://myimage.com/me.jpg",
  "meta": {
    "digestAlgorithm": "sha256",
    "dateCreated": "2017-12-01",
    "expires": "2020-01-01"
  },
  "name": "Diploma"
}

Identity card is a digital asset which holds information about user's identity.

Digital asset data object example:

{ // https://0xcert.org/schemas/identity-card/1.0.0-asset
  photo: 'https://avatars.org/kristijansedlak.jpg', // required
  additionalName: 'Tarmon', // optional
  addressCountry: 'US', // required
  addressLocality: 'Mountain View', // optional
  addressRegion: 'CA', // optional
  birthDate: '1981-19-05', // required
  birthPlace: 'Ljubljana', // optional
  dateCreated: '2017-12-01', // required
  dateIssued: '2002-01-01', // required
  documentID: '2178012', // required
  expires: '2022-01-01', // required
  familyName: 'Sedlak', // required
  gender: 'M', // required
  givenName: 'Kristijan', // required
  identificationNumber: '1905981500999', // optional
  nationality: 'SI', // required
  postalCode: '94043', // required
}

Digital asset metadata example:

GET https://0xcert.org/dids/did:xcert:0xff0asdjd38d8s8a8g73n2n5n12m3n1n5b2/100/latest HTTP/1.1

200 OK
Content-Type: application/json
Link: <https://0xcert.org/schemas/identity-card/1.0.0-metadata> rel=describedBy
{
  "description": "A document used to prove identity of a person.",
  "cursor": {
    "current": "https://...",
    "next": "https://...",
    "prev": "https://..."
  },
  "data": {
    "expires": "2020-01-01"
  },
  "image": "https://myimage.com/me.jpg",
  "meta": {
    "digestAlgorithm": "sha256",
    "dateCreated": "2017-12-01",
    "expires": "2020-01-01"
  },
  "name": "IdentityCard"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment