Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 39 additions & 8 deletions .github/workflows/examples-basic-bls-signing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,65 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
examples-basic-bls-signing-darwin:
examples-basic-bls-signing-rust-darwin:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Provision Darwin
run: |
bash .github/workflows/provision-darwin.sh
- name: Deploy Basic BLS Signing Darwin
- name: Deploy Basic BLS Signing Rust Darwin
run: |
set -eExuo pipefail
cargo install candid-extractor
npm i
pushd examples/basic_bls_signing
./deploy_locally.sh
pushd examples/basic_bls_signing/rust
dfx start --background && dfx deploy
cd frontend
npm run lint
Comment thread
altkdf marked this conversation as resolved.
examples-basic-bls-signing-linux:
examples-basic-bls-signing-rust-linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Deploy Basic BLS Signing Linux
- name: Deploy Basic BLS Signing Rust Linux
run: |
set -eExuo pipefail
cargo install candid-extractor
npm i
pushd examples/basic_bls_signing
./deploy_locally.sh
pushd examples/basic_bls_signing/rust
dfx start --background && dfx deploy
cd frontend
npm run lint
examples-basic-bls-signing-motoko-darwin:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Provision Darwin
run: |
bash .github/workflows/provision-darwin.sh
- name: Deploy Basic BLS Signing Motoko Darwin
run: |
set -eExuo pipefail
cargo install candid-extractor
npm i
pushd examples/basic_bls_signing/motoko
dfx start --background && dfx deploy
cd frontend
npm run lint
examples-basic-bls-signing-motoko-linux:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Provision Linux
run: bash .github/workflows/provision-linux.sh
- name: Deploy Basic BLS Signing Motoko Linux
run: |
set -eExuo pipefail
cargo install candid-extractor
npm i
pushd examples/basic_bls_signing/motoko
dfx start --background && dfx deploy
cd frontend
npm run lint
14 changes: 0 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
"backend/rs/canisters/ic_vetkeys_encrypted_maps_canister",
"backend/rs/canisters/ic_vetkeys_manager_canister",
"backend/rs/canisters/tests",
"examples/basic_bls_signing/backend",
]
resolver = "2"

Expand Down
19 changes: 10 additions & 9 deletions examples/basic_bls_signing/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Basic BLS Signing

| Motoko backend | [![](https://icp.ninja/assets/open.svg)](http://icp.ninja/editor?g=https://github.com/dfinity/vetkeys/tree/main/examples/basic_bls_signing/motoko)|
| --- | --- |
| Rust backend | [![](https://icp.ninja/assets/open.svg)](http://icp.ninja/editor?g=https://github.com/dfinity/vetkeys/tree/main/examples/basic_bls_signing/rust) |

The **Basic BLS signing** example demonstrates how to use **[vetKeys](https://internetcomputer.org/docs/building-apps/network-features/vetkeys/introduction)** to implement secure BLS signing on the **Internet Computer (IC)**, where every authenticated user can ask the canister (IC smart contract) to produce signatures, where the **Internet Identity Principal** identifies the signer. This canister ensures that users can only produce signature for their own principal and not for someone else's principal. Furthermore, the vetKeys in this dapp can only be produced upon a user request, as specified in the canister code, meaning that the canister cannot produce signatures for arbitrary users or messages.

For confirming that the canister can only produce signatures in the intended way, users need to inspect the code installed in the canister. For this, it is crucial that canisters using VetKeys have their code public.
Expand All @@ -18,18 +22,15 @@ For confirming that the canister can only produce signatures in the intended way
- [Internet Computer software development kit](https://internetcomputer.org/docs/building-apps/getting-started/install)
- [npm](https://www.npmjs.com/package/npm)

### Install Dependencies
### Deploy the Canisters Locally

If you want to deploy this project locally with a Motoko backend, then run:
```bash
npm install
dfx start --background && dfx deploy
```
from the `motoko` folder.

### Deploy the Canisters

Run the local deployment script, which starts the local development environment (`dfx`) if necessary, builds both backend and frontend (asset) canisters, and installs them locally.
```bash
bash deploy_locally.sh
```
To use the Rust backend instead of Motoko, run the same command in the `rust` folder.

## Example Components

Expand All @@ -44,7 +45,7 @@ The backend consists of a canister that:

The frontend is a vanilla typescript application providing a simple interface for signing, showing the signatures stored in the canister, and publishing a signature.

To run the frontend in development mode with hot reloading (after running `deploy_locally.sh`):
To run the frontend in development mode with hot reloading (after running `dfx deploy`):

```bash
npm run dev
Expand Down
22 changes: 0 additions & 22 deletions examples/basic_bls_signing/backend/Cargo.toml

This file was deleted.

18 changes: 0 additions & 18 deletions examples/basic_bls_signing/deploy_locally.sh

This file was deleted.

36 changes: 0 additions & 36 deletions examples/basic_bls_signing/dfx.json

This file was deleted.

Loading