Add support for W3C Verifiable Credentials issuance#6
Open
wyc wants to merge 1 commit intoUniswap:masterfrom
Open
Add support for W3C Verifiable Credentials issuance#6wyc wants to merge 1 commit intoUniswap:masterfrom
wyc wants to merge 1 commit intoUniswap:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
TL;DR: Verify Twitter once on Uniswap Sybil, use anywhere.
Thank you to @krhoda for the implementation and instructions.
High Level Changes:
/api/verifiable-credentialroute causing the worker to generate and cryptographically sign a verifiable credential attesting to the link in identities, only if the provided address exists in the sybil-list repository’sverified.json.jsdirectory, along with a new filejs/handlers/verifiableCredential.js, webpack configuration now exposed -- rather than handled by wrangler)Updating Instructions
Complete, from-scratch instructions have been added to the README.md, but assuming an existing worker, the following actions will need to be taken:
The Rust codebase depends on two libraries,
didkitandssi. Currently, the only way to require them is through thepathkey in the Cargo.toml. Cloning these two projects to the same directory as the Sybil Verifier is required.From the directory containing the Sybil Verifier repo:
Though it should be compatible with the
mainbranches going forward, the following revisions have been tested and verified to work with this repository:ssi:140639eb185b5e978c116cd0de5f808663ac2b14didkit:0742c085a132f452bd17750dd9f849c2832b7122Back to the
sybil-verifier-workerrepo, thetypekey ofwrangler.tomlneeds to change from”webpack”to”rust”.A kv storage set up using wrangler to create KV namespace called
VERIFIABLE_CREDENTIAL_STORE:$ wrangler kv:namespace create "VERIFIABLE_CREDENTIAL_STORE"If desired, create a preview KV space
$ wrangler kv:namespace create "VERIFIABLE_CREDENTIAL_STORE" --previewThen add the output of the above commands to the
wrangler.toml:The wrangler-example.toml shows a good example of the final results of these two steps. NOTE: the output of those two commands will need to be combined. Repeated
bindings will give trouble.Finally, three new secrets have been added,
ISSUER_ADDRESSThe public key of an Ethereum address used to sign verifiable credentials (in hex, ex. 0xDA320a...38A9a9d)SIGNING_KEYThe corresponding private key of the ISSUER_ADDRESS (in hex, ex. 0xa85b047...c202ef)REPO_OWNERThe github username which hosts the corresponding sybil-list repo, so in this case “Uniswap”.All secrets are now laid out in the README.md
Build, Preview, Test and Publish
Once wrangler is properly set up, before previewing or publishing run the following from the root of the repo
This is now required because wrangler handles the compilation of the WASM. The only difference is now the webpack configuration is explicit.
Then run
Or
Verify Request:
Verifiable Credential:
(e.g., https://sybil-verifier.rebase-verifier.workers.dev/api/verifiable-credential?account=0x66Aa8Bee5366b6b48811AE0Dac9Fe5e1EEfE1621)