Hey! I have written about
ic_siwe before but now it is time to more formally announce the project and let you know it is ready to be tried and tested
ic-siwe is a project that enables Ethereum wallet-based authentication for applications on the Internet Computer (IC) platform. The goal of the project is to enhance the interoperability between Ethereum and the Internet Computer platform, enabling developers to build applications that leverage the strengths of both platforms.
Ethereum Wallet Sign-In: Enables Ethereum wallet sign-in for IC applications. Sign in with any eth wallet to generate an IC identity and session.
Session Identity Uniqueness: Ensures that session identities are specific to each application’s context, preventing cross-app identity misuse.
Consistent Principal Generation: Guarantees that logging in with an Ethereum wallet consistently produces the same Principal, irrespective of the client used.
Direct Ethereum Address to Principal Mapping: Creates a one-to-one correlation between Ethereum addresses and Principals within the scope of the current application.
Timebound Sessions: Allows developers to set expiration times for sessions, enhancing security and control.
Prebuilt Identity Provider: Provides a prebuilt canister that can be integrated into any Internet Computer application, independent of the application’s programming language.
Developers have two options to use SIWE in their IC applications:
Use the prebuilt ic_siwe_provider canister: This is the easiest way to integrate SIWE into an Internet Computer application. The pre-built canister is added to the project
dfx.jsonand then configured to meet the needs of the application.
ic_siwe_providercan be added to any Internet Computer application, independent of the application’s programming language.
Use the ic_siwe library: This allows developers full control over the SIWE integration. The
ic_siweRust library provides all the necessary tools for integrating SIWE into IC canisters.
The below diagram illustrates the high-level login flow when using the
An ICP application requests a SIWE message from the
ic_siwe_providercanister on behalf of the user.
The application displays the SIWE message to the user who signs it with their Ethereum wallet.
The application sends the signed SIWE message to the
ic_siwe_providercanister to login the user. The canister verifies the signature and creates an identity for the user.
The application retrieves the identity from the
The application can now use the identity to make authenticated calls to canisters.
ic-siwe consists of two main packages: the Rust support library and the prebuilt identity provider canister. The project also includes React demo applications and React hooks for easy frontend integration with SIWE enabled Internet Computer canisters.
Rust library that provides the necessary tools for integrating Sign-In with Ethereum (SIWE) into IC canisters, allowing users to sign in using their Ethereum wallets.
Prebuilt canister serving as a SIWE identity provider for Internet Computer canisters.
ic_siwe-provider packages the ic_siwe library and makes it available as a canister that can easily be integrated into any Internet Computer application, independent of the application’s programming language.
Try the deployed demo here: https://shtr2-2iaaa-aaaal-qckva-cai.icp0.io
Same demo as above but this time the backend canister is written in TypeScript using Azle.
Try the deployed demo here: https://zwsg3-myaaa-aaaal-qdf7q-cai.icp0.io/
React hook and context provider for easy frontend integration with SIWE enabled Internet Computer canisters.
React hook and context provider for managing Internet Computer (IC) actors with features like type safety and request/response interceptors.
ic-use-actor makes interacting with Internet Computer canisters more fun!
This project is licensed under the MIT License.
The project is still in active development. Before using
ic-siwe in production, I would like to do a more formal security audit.
Also, I want to integrate SIWE into more demo applications, ideally some wallet application.
Most likely, there are features missing in the current implementation. If you have any ideas or requests for features, please let me know by opening an issue on the GitHub repository.