|
| 1 | +--- |
| 2 | +id: quick-start |
| 3 | +title: Quick Start (V3 Beta) |
| 4 | +sidebar_label: Quick Start |
| 5 | +--- |
| 6 | + |
| 7 | +In this guide, we will attempt to issue an driving license in the OpenAttestation Version 3 format. We will be using the document store to issue this document with `DNS-TXT` as the method to identify the issuer using DNS. |
| 8 | + |
| 9 | +_The document will not be rendered yet as we have yet to create demo renderer_ |
| 10 | + |
| 11 | +> For a full range of documents (beside document store + DNS-TXT), you may look at the different types of document supported [here](/docs/advanced/v3/different-files) |
| 12 | +
|
| 13 | +## Document Store Setup |
| 14 | + |
| 15 | +If you have not already deployed a document store, you may do so by following the guides listed below: |
| 16 | + |
| 17 | +1. [Creating a wallet](/docs/verifiable-document/wallet) |
| 18 | +1. [Deploying Document Store](/docs/verifiable-document/document-store) |
| 19 | +1. [Configuring DNS](/docs/verifiable-document/dns-proof) |
| 20 | + |
| 21 | +## Creating Raw Document |
| 22 | + |
| 23 | +We will now create the data for the driving license. Create a file `licence.json` with the following data: |
| 24 | + |
| 25 | +```json |
| 26 | +{ |
| 27 | + "@context": [ |
| 28 | + "https://www.w3.org/2018/credentials/v1", |
| 29 | + "https://schemata.openattestation.com/com/openattestation/1.0/DrivingLicenceCredential.json", |
| 30 | + "https://schemata.openattestation.com/com/openattestation/1.0/OpenAttestation.v3.json" |
| 31 | + ], |
| 32 | + "issuer": { |
| 33 | + "id": "https://example.com", |
| 34 | + "name": "DEMO STORE" |
| 35 | + }, |
| 36 | + "issuanceDate": "2010-01-01T19:23:24Z", |
| 37 | + "type": ["VerifiableCredential", "DrivingLicenceCredential"], |
| 38 | + "credentialSubject": { |
| 39 | + "id": "did:example:SERIAL_NUMBER_123", |
| 40 | + "class": [ |
| 41 | + { |
| 42 | + "type": "3", |
| 43 | + "effectiveDate": "2010-01-01T19:23:24Z" |
| 44 | + }, |
| 45 | + { |
| 46 | + "type": "3A", |
| 47 | + "effectiveDate": "2010-01-01T19:23:24Z" |
| 48 | + } |
| 49 | + ] |
| 50 | + }, |
| 51 | + "openAttestationMetadata": { |
| 52 | + "template": { |
| 53 | + "name": "CUSTOM_TEMPLATE", |
| 54 | + "type": "EMBEDDED_RENDERER", |
| 55 | + "url": "https://localhost:3000/renderer" |
| 56 | + }, |
| 57 | + "proof": { |
| 58 | + "type": "OpenAttestationProofMethod", |
| 59 | + "method": "DOCUMENT_STORE", |
| 60 | + "value": "0x8bA63EAB43342AAc3AdBB4B827b68Cf4aAE5Caca" |
| 61 | + }, |
| 62 | + "identityProof": { |
| 63 | + "type": "DNS-TXT", |
| 64 | + "identifier": "example.tradetrust.io" |
| 65 | + } |
| 66 | + } |
| 67 | +} |
| 68 | +``` |
| 69 | + |
| 70 | +You will need to replace the following values: |
| 71 | + |
| 72 | +### `openAttestationMetadata.proof.value` |
| 73 | + |
| 74 | +Replace this with the address of the document store deployed in the step [Deploying Document Store](/docs/verifiable-document/document-store) |
| 75 | + |
| 76 | +### `openAttestationMetadata.identityProof.identifier` |
| 77 | + |
| 78 | +Replace this with the domain where the TXT record has been inserted in the step [Configuring DNS](/docs/verifiable-document/dns-proof) |
| 79 | + |
| 80 | +## Wrapping the Document |
| 81 | + |
| 82 | +With `licence.json` saved, run the following command after the [CLI is installed](/docs/component/open-attestation-cli): |
| 83 | + |
| 84 | +```sh |
| 85 | +open-attestation wrap licence.json --of wrapped.json --oav3 |
| 86 | +``` |
| 87 | + |
| 88 | +The will wrap the original document and append additional data required by OpenAttestation to the `proof` key at the root of the document. |
| 89 | + |
| 90 | +> Take note of the value `proof.merkleRoot`. This is the merkle root to be issued on the document store later. |
| 91 | +
|
| 92 | +## Issuing document |
| 93 | + |
| 94 | +With the merkle root in `proof.merkleRoot`, you may following the [Issuing Document](/docs/verifiable-document/issuing-document) guide to issued the document on Ethereum. |
| 95 | + |
| 96 | +## Verify document |
| 97 | + |
| 98 | +TBD (after oa-cli is updated for `verify`) |
| 99 | + |
| 100 | +If you are reading this now, you may programmatically verify the document with [`oa-verify`](http://localhost:3000/docs/component/oa-verify) |
0 commit comments