Skip to main content

vetKeys API demo

Advanced
Tutorial

Overview

This demo provides a canister (src/system_api) that offers the proposed vetKD system API, implemented demonstration, testing, and initial development purposes. We stress that it does not offer security yet as no threshold cryptography is used yet to secure the key.

This demo uses files found in this repository.

Prerequisites

  • Download and install the IC SDK package as described in the installing the IC SDK page.
  • Download and install npm.
  • Download and install git.

Step 1: Begin by cloning the Github repository containing this project:

git clone https://github.com/dfinity/examples/
cd examples/motoko/vetkd

Step 2: Then, start a local instance of the Internet Computer:

dfx start --clean --background

Step 3: Ensure the dfx uses the canister IDs that are hard-coded in the source code:

dfx canister create system_api --specified-id s55qq-oqaaa-aaaaa-aaakq-cai

Without this, the dfx may use different canister IDs for the system_api and app_backend canisters.

Step 4: Ensure that the required node modules are available in your project directory:

npm install

Step 5: Register, build and deploy the project:

dfx deploy

This command should finish successfully with output similar to the following one:

Deployed canisters.
URLs:
Frontend canister via browser
app_frontend_js: http://127.0.0.1:4943/?canisterId=by6od-j4aaa-aaaaa-qaadq-cai
Backend canister via Candid interface:
app_backend: http://127.0.0.1:4943/?canisterId=avqkn-guaaa-aaaaa-qaaea-cai&id=tcvdh-niaaa-aaaaa-aaaoa-cai
app_frontend: http://127.0.0.1:4943/?canisterId=avqkn-guaaa-aaaaa-qaaea-cai&id=b77ix-eeaaa-aaaaa-qaada-cai
system_api: http://127.0.0.1:4943/?canisterId=avqkn-guaaa-aaaaa-qaaea-cai&id=s55qq-oqaaa-aaaaa-aaakq-cai

Step 6: Open the printed URL for the app_frontend_js in your browser.