Base Example

Overview

Provide has contributed a complete reference implementation of the core interfaces as specified in the v0.1.0 release of the Baseline Protocol. This reference implementation will inform the OASIS standard.
The reference implementation runs on the Ethereum Ropsten testnet and can be configured to run on many other public or permissioned EVM-based blockchains; a complete list of supported Ethereum clients will be curated over the coming months.

Setup

Clone the Baseline repository:
1
git clone https://github.com/eea-oasis/baseline.git
Copied!
Checkout the bri-1-privacy branch:
1
git checkout bri-1-privacy
Copied!
Once checked out, navigate to the /examples/bri-1/base-examples folder.

Running Locally

Run the following to install local packages and run the test suite against the Ropsten testnet:
1
npm install
2
npm test
Copied!
In a separate terminal window, run the following command to view all container logs while the tests are running:
1
make logs
Copied!

Alice & Bob

The reference implementation illustrates Alice & Bob, respective owners of Alice Corp and Bob Corp, establishing a workgroup and baselining an in-memory record (i.e., a JSON object) using the Provide stack.
The following high-level architecture diagram illustrates how the concepts discussed in previous sections (i.e., the Provide and Baseline Protocol architecture sections) fit together in the context of two organizations deploying the Baseline Protocol using Provide as a common technology stack and their own cloud infrastructure vendors (i.e., AWS and Azure). The reference implementation deploys these same two distinct stacks to your local machine using docker-compose when running the test suite
This reference implementation supports cloud-agnostic experiments out-of-the-box.
There are several assertion and checks that have to be carried out, in full and in a specific order to ensure that the base example can run and fully demonstrate the functionality and potential of the Baseline protocol, leveraged by the Provide stack. Subsequent sections illustrate the necessary components and their outputs as well as the rationale for their importance.
Workgroup assertions All on-chain artifacts existence and accessibility will be asserted, this includes the ERC1820 contract, the organization registry, workgroup shield, workflow circuit verifier contract, and the circuit identifier. We will also assert we have established a connection with NATS, and that there is an active subscription to the baseline.proxy subject.
Vault assertions The user will be able to register its corporation in the local registry and the on-chain registry using the default secp256k1 address. We will the ensure all vault related services are fully functional. We will assert a default vault for the organization has been created as well as a set of key pairs for the organization for babyJubJub, secp256k1, and finally ensure the secp256k1 key pair can resolve as the organization address.
Messaging assertions We will also assert we have established a connection with NATS, and that there is an active subscription to the baseline.proxy subject.
SNARK assertions TBD
Decoded workgroup Invitation The following JSON object represents the decoded invitation JWT signed by Bob Corp and delivered to Alice. The invitation has everything Alice needs to join Bob's new Baseline workgroup, register Alice Corp with the on-chain OrgRegistry contract and use the protocol to synchronize her local Provide stack.
1
{
2
"aud": "https://provide.services/api/v1",
3
"exp": 1598074664,
4
"iat": 1597988264,
5
"iss": "https://ident.provide.services",
6
"jti": "6341cb1b-823c-4308-a3c3-48e2d21a1f12",
7
"nats": {
8
"permissions": {
9
"subscribe": {
10
"allow": [
11
"network.*.connector.*",
12
"network.*.status",
13
"platform.>"
14
]
15
}
16
}
17
},
18
"prvd": {
19
"data": {
20
"application_id": "b9ad090b-8d3b-4840-a6cf-5e644b242510",
21
"email": "[email protected]",
22
"first_name": null,
23
"invitor_id": "33cec010-8950-4dc9-b1cc-b18550769d03",
24
"invitor_name": "Bob Baseline",
25
"last_name": null,
26
"organization_id": null,
27
"organization_name": null,
28
"params": {
29
"authorized_bearer_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYXRzIjp7InBlcm1pc3Npb25zIjp7InB1Ymxpc2giOnsiYWxsb3ciOlsiYmFzZWxpbmUuPiJdfSwic3Vic2NyaWJlIjp7ImFsbG93IjpbImJhc2VsaW5lLmluYm91bmQiXX19fSwiaWF0IjoxNTk4MjM0OTMyLCJleHAiOjE1OTgyMzk5MzIsImF1ZCI6Im5hdHM6Ly9sb2NhbGhvc3Q6NDIyNCIsImlzcyI6InRzLW5hdHN1dGlsIiwic3ViIjoiYmFzZWxpbmUuaW5ib3VuZCJ9.YSDr6avqwQ1xVsptZIsWK8XIGyU-vJxBed11wfmwzODlJSSxkEc66pVcwqOh8oWmQnb75e7kBKxO0_BK4VNb8Jivt3KMnJkiKWW2KhQ2hQXfIMnNIKi-aWblnFm1JzAizVfndnyQdz6HinLqN9ka8msLbyPpQk279i58fpdKOuwP7rRJBOmjrVhyztf5hdv7HdGrB49T3hzfbfX8lijzABtcnHnQmfvbXggdbVCzqAoiee6_x-uOHNHtVc2wXcqdUl_JvDh5uyyJ_wNEsRQ8_559PqXSujtKVKXt2t38rFXm1SigT7g2WiXiuJSHna8yICw98djJzba76v6AJUB-ltHDnyeTNqMZxOJS51dluKlUxVjFSwwR7zd_jFHu6dsdCRrs_2rWdU-PaG8GPppSgNVaBKpKT-YNieVV1xCl8clXVZ32LovawUryh-JlAGkbPtrqzBQmWY0AZRblSzz-yai7xMy4DTXK2PCw3gWmeR3dg3im476Qz5WupfGPBJ7BJh1Ya_juqnr6FquFGW60G6o6OJLHdeReCQNkgRXdU7-gA2qtaBACenEKECM5xufkesGgKIP426oLExBkMDQD_B4afO58seTT6Tc5gNlTV_Ev9j8boHfgBmTuqVoxfmdu5JIrj6Y9yktLOLiC25qHw9tFy6V5keZKDk_hokFCINA",
30
"erc1820_registry_contract_address": "0xd5e4EA677FcBb9961c7338570b8cBb6AfE36C0d6",
31
"invitor_organization_address": "0xa3AC1eC4609a38B9789860DCfB46063b80B7bb7a",
32
"organization_registry_contract_address": "0x6a0A2E71381649879eF99acA31c14220cFa7EA60",
33
"shield_contract_address": "0xf2e246bb76df876cef8b38ae84130f4f55de395b",
34
"verifier_contract_address": "0xdc35F1CD0427D06Ab7e6ebDfC604ef12eFC1f06b",
35
"workflow_identifier": "3b773331-cd38-4ee3-8cbb-74960d0268d1"
36
},
37
"user_id": null
38
},
39
"permissions": 0
40
},
41
"sub": "invite:[email protected]"
42
}
Copied!
Last modified 1mo ago
Export as PDF
Copy link