There are two separate files for both the on- and off-chain examples dealing with the complete issuance and verification process for either a single or a combined proof: exampleSingle.ts
/ exampleSingle.chain.ts
and exampleCombined.ts
/ exampleCombined.chain.ts
. These should give you a good idea how to the library can be used with and without the chain.
We split both types of examples into the following three processes:
- actorProcess - Creation of claimer, attester(s) and accumulator(s)
- issuanceProcess - Issuance of the credential (claimer and attester)
- verificationProcessSingle / 3_verificationProcessCombined - Verification of the credential w/ and w/o revocation (claimer and verifier)
You are required to have an active substrate blockchain implementing the portablegabi-pallet
. You could clone and set up this portablegabi-node
basic substrate template implementing the portablegabi-pallet.
- actorProcess - Creation of claimer, attester(s) and accumulator retrieval of chain or storage if missing
- issuanceProcess - See off-chain (nothing on-chain happens here)
- verificationProcessSingle / 3_verificationProcessCombined - Verification of the credential w/ and w/o revocation (claimer and verifier)
Note that we are using Alice
and Bob
nodes in the examples to retrieve and store accumulators on the chain. Depending on your chain, you might have to swap the URI to nodes with balance in the example config, otherwise you can only retrieve them.
It is also possible to use the Portablegabi API in the browser, see here for more details.
Please note, that the examples displayed here are mainly positive. For negative ones please have a look at the following tests. Most notably are the ones within GabiVerifier.spec.ts
- Accumulator
'Negative tests'
- GabiClaimer
'Negative tests'
- GabiAttester
'Test attester functionality'
- GabiVerifier
'Negative tests'
- GabiVerifierChain
'Negative tests'
- CombinedRequestBuilder
'If one credential is revoked, it...'
- Blockchain
'Negative tests
We are aware that the key generation GabiAttester.create()
takes about more than 10 monutes due to finding huge prime numbers in a single threat being very slow in WASM. Therefore, all examples and tests use pre-generated keys in Go. We are currently working on this issue.