You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build a basilisk canister that stores versioned cpython_canister_template.wasm files on-chain and can deploy new basilisk canisters from them. This serves as a proof-of-concept for decentralized deployment before extending the pattern to Realms.
Motivation
Currently, basilisk template WASMs are distributed via GitHub releases and downloaded by build_wasm_binary_or_exit.py. Deployment requires off-chain tooling (dfx deploy). Moving the WASM storage and deployment on-chain enables:
Decentralized deployment: Users can deploy new basilisk canisters directly from the repository canister, without needing local tooling
Version catalog: All released versions available on-chain with metadata
Upgrade path: Existing canisters can be upgraded to newer versions via the deployer
Proof-of-concept: Validates the pattern before applying it to the more complex multi-canister Realms deployment (see realms#166)
Prior Art
SNS-W (qaa6y-5yaaa-aaaaa-aaafa-cai): DFINITY's NNS canister that stores versioned SNS WASM modules and deploys new SNS DAOs. Source: dfinity/ic/rs/nns/sns-wasm
Juno CDN: A satellite canister storing pre-built versioned WASMs for Satellites, Mission Controls, and Orbiters. The Console canister orchestrates deployment from the CDN.
CosmWasm (Cosmos): Protocol-level store/instantiate pattern where WASM bytecode is stored once with a code_id, then instantiated many times with different configs.
Summary
Build a basilisk canister that stores versioned
cpython_canister_template.wasmfiles on-chain and can deploy new basilisk canisters from them. This serves as a proof-of-concept for decentralized deployment before extending the pattern to Realms.Motivation
Currently, basilisk template WASMs are distributed via GitHub releases and downloaded by
build_wasm_binary_or_exit.py. Deployment requires off-chain tooling (dfx deploy). Moving the WASM storage and deployment on-chain enables:Prior Art
qaa6y-5yaaa-aaaaa-aaafa-cai): DFINITY's NNS canister that stores versioned SNS WASM modules and deploys new SNS DAOs. Source:dfinity/ic/rs/nns/sns-wasmcode_id, then instantiated many times with different configs.Architecture
Location:
basilisk/deployer/in this repoLanguage: Basilisk (Python) — dogfooding
Canister API:
Admin endpoints (controller-only)
upload_chunk(version: str, chunk_index: int, data: bytes)— upload WASM in ≤2MB chunks (IC message limit)finalize_version(version: str, description: str)— mark version complete, verify integrityremove_version(version: str)— remove a version from the catalogPublic endpoints
list_versions()— return version catalog with metadata (size, hash, upload date)get_version_info(version: str)— detailed info for a specific versiondeploy(version: str)— create a new canister + install selected WASM, return canister IDget_deployment_status(deployment_id: str)— check async deployment progressTechnical Details
Storage
ic_python_dbentities or stable structuresDeployment flow
deploy(version)management_canister.create_canister()(needs cycles)management_canister.upload_chunk()in 2MB chunks to target canistermanagement_canister.install_chunked_code()to install from chunksCycles management
Version upload (CI/CD)
dfx canister callImplementation Steps
dfx.json,main.py, directory structure)deploy—create_canister+upload_chunk+install_chunked_codeFuture extensions