This repository is a Svelte + Vite application and template that demonstrates how to authenticate users with Sign‑In‑With‑Solana (SIWS) to an Internet Computer (IC) canister. By combining:
you get a fully authenticated cross‑chain dapp where a Solana wallet maps one‑to‑one to an IC identity.
[!NOTE] In addition to this Svelte demo of ic-siws, there are versions for Vue, React, and more in the main ic-siws repository.
Try it live: https://ghe6p-faaaa-aaaal-qsm3q-cai.icp0.io
If you are new to IC, please read the Internet Computer Basics before proceeding.
This app consists of two main components:
The frontend is a Svelte application served by an ICP asset canister. In a real world scenario, this frontend application would make authenticated calls to one or more application canisters. Such application canisters are not included with this demo.
The pre-built IC SIWS Provider is used to create an identity for the user. It is a Rust based canister that implements the SIWS login flow. The flow starts with a SIWS message being generated and ends with a Delegate Identity being created for the user. The Delegate Identity gives the user access to the backend canister.
This is the high-level flow between the app components when a user logs in:
ic_siws_provider
canister on behalf of the user.ic_siws_provider
canister to login the user. The canister verifies the signature and creates an identity for the user.ic_siws_provider
canister.dfx start --clean --background
make deploy-all
For more details on how to use SIWS with your ICP project, see https://github.com/kristoferlund/ic-siws/tree/main/packages/ic_siws_js
See the CHANGELOG for details on updates.
Contributions are welcome. Please submit your pull requests or open issues to propose changes or report bugs.
This project is licensed under the MIT License. See the LICENSE file for more details.