|
| 1 | +# WebVH Tutorial |
| 2 | + |
| 3 | +## Task 1: Set Up Your Environment |
| 4 | + |
| 5 | +### GH Page & Repository |
| 6 | + |
| 7 | +Create a new repo from this [template](https://github.com/new?template_name=didwebvh-tutorial&template_owner=OpSecId) |
| 8 | +Enable GH pages Settings -> Pages |
| 9 | +Set the source to Deploy from a branch |
| 10 | +Deploy from the main branch `/(root)` directory |
| 11 | + |
| 12 | +### Docker & CLI |
| 13 | + |
| 14 | +```bash |
| 15 | +# Clone tutorial repo and cd into root directory |
| 16 | +git clone https://github.com/opsecid/didwebvh-tutorial |
| 17 | +cd didwebvh-tutorial |
| 18 | + |
| 19 | +# Ensure docker is properly configured |
| 20 | +docker compose version |
| 21 | + |
| 22 | +# Build and start the tutorial containers |
| 23 | +docker compose up -d --build |
| 24 | + |
| 25 | +# To clear the agent wallet and restart |
| 26 | +docker compose up -d --build --force-recreate |
| 27 | + |
| 28 | +# Confirm cli container is functional |
| 29 | +docker exec webvh-tutorial-cli webvh |
| 30 | + |
| 31 | +# Create cli alias |
| 32 | +alias webvh-cli="docker exec webvh-tutorial-cli webvh" |
| 33 | + |
| 34 | +# Confirm alias is registered |
| 35 | +webvh-cli --help |
| 36 | + |
| 37 | +``` |
| 38 | + |
| 39 | +## Task 2: Create the first log entry |
| 40 | + |
| 41 | +```bash |
| 42 | +# Run the new-did command, using the gh-page url as the origin value |
| 43 | +webvh-cli new-did --origin https://example.com |
| 44 | + |
| 45 | +# Create the authorization key pair |
| 46 | +webvh-cli new-key |
| 47 | + |
| 48 | +# Define the DID parameters |
| 49 | +webvh-cli did-params --update-key <multikey> --method 0.5 |
| 50 | + |
| 51 | +# Generate the SCID input file with a current timestamp |
| 52 | +webvh-cli gen-scid-input --version-time <datetime> |
| 53 | + |
| 54 | +``` |
| 55 | + |
| 56 | +## Task 3: Generate the SCID (Self-Certifying Identifier) |
| 57 | + |
| 58 | +```bash |
| 59 | +# Run the following command to generate the scid value and add an alsoKnownAs reference to our DID document: |
| 60 | +webvh-cli gen-scid-value |
| 61 | + |
| 62 | +``` |
| 63 | + |
| 64 | +## Task 4: Generate the Version ID (Entry Hash) |
| 65 | + |
| 66 | +Run the following command to generate the version ID: |
| 67 | +`webvh-cli gen-version-id` |
| 68 | + |
| 69 | +## Task 5: Generate the Data Integrity Proof |
| 70 | + |
| 71 | +Run the following command to sign the log entry with the update key, and add the line to our log file: |
| 72 | +`webvh-cli add-proof --update-key <>` |
| 73 | + |
| 74 | +## Task 6: Publish the DID Log Entry |
| 75 | + |
| 76 | +Use the new-line command to add the current line to the log file |
| 77 | +`webvh-cli new-line` |
| 78 | + |
| 79 | +Commit the `did.json` and `did.jsonl` files and their content at the root of the repository you created at step one. |
| 80 | + |
| 81 | +## Task 7: Resolve the DID |
| 82 | + |
| 83 | +Resolve your DID with the tutorial agent |
| 84 | +http://agent.webvh-tutorial.localhost/api/doc#/resolver/get_resolver_resolve__did_ |
| 85 | + |
| 86 | +You can also visit https://uniresolver.io |
| 87 | + |
| 88 | +You can resolve both the webvh and web did. |
| 89 | + |
| 90 | +## Task 8: Update the DID |
| 91 | + |
| 92 | +```bash |
| 93 | +# Create a keypair and add a verification method |
| 94 | +webvh-cli new-key |
| 95 | +webvh-cli add-vm --multikey <> |
| 96 | + |
| 97 | +# Generate the new version ID and sign the log entry |
| 98 | +webvh-cli gen-version-id |
| 99 | +webvh-cli add-proof --update-key <> |
| 100 | + |
| 101 | +# Add to the log file |
| 102 | +webvh-cli new-line |
| 103 | + |
| 104 | +``` |
| 105 | + |
| 106 | +Resolve your DID again. |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | +## Commands |
| 111 | +```bash |
| 112 | +_________________________________________________________________ |
| 113 | +Usage: webvh [OPTIONS] COMMAND [ARGS]... |
| 114 | + |
| 115 | + WebVH Tutorial |
| 116 | + |
| 117 | +Options: |
| 118 | + --help Show this message and exit. |
| 119 | + |
| 120 | +Commands: |
| 121 | + add-proof Add a Data Integrity Proof to the log entry with a... |
| 122 | + add-vm Add a verification method to the did document. |
| 123 | + did-params Set the DID parameters and update key. |
| 124 | + gen-scid-input Generate the scid input. |
| 125 | + gen-scid-value Generate the SCID value from the input. |
| 126 | + gen-version-id Generate the version ID. |
| 127 | + new-did Configure the base did document from a DID location URL. |
| 128 | + new-key Create new key pair. |
| 129 | + new-line Append line to log file and add alsoKnownAs reference... |
| 130 | +_________________________________________________________________ |
| 131 | +Usage: webvh new-did [OPTIONS] |
| 132 | + |
| 133 | + Configure the base did document from a DID location URL. |
| 134 | + |
| 135 | +Options: |
| 136 | + --auto Automate creation. |
| 137 | + --origin TEXT The DID location URL. |
| 138 | +_________________________________________________________________ |
| 139 | +Usage: webvh did-params [OPTIONS] |
| 140 | + |
| 141 | + Set the DID parameters and update key. |
| 142 | + |
| 143 | +Options: |
| 144 | + --method TEXT Method to use. |
| 145 | + --update-key TEXT Provided update key value to use. |
| 146 | +_________________________________________________________________ |
| 147 | +Usage: webvh gen-scid-input [OPTIONS] |
| 148 | + |
| 149 | + Generate the scid input. |
| 150 | + |
| 151 | +Options: |
| 152 | + --version-time TEXT The version time. |
| 153 | +_________________________________________________________________ |
| 154 | +Usage: webvh add-proof [OPTIONS] |
| 155 | + |
| 156 | + Add a Data Integrity Proof to the log entry with a provided update key. |
| 157 | + |
| 158 | +Options: |
| 159 | + --update-key TEXT The update key to use. |
| 160 | +_________________________________________________________________ |
| 161 | +``` |
0 commit comments