Sign In with Bitcoin on ICP

Hi everyone, we have a new Sign-in solution for Bitcoin Wallet, so called “Sign-In with Bitcoin” aka ic-siwb.

The project is forked and modified from the project we love: is-siwe, thanks @kristofer . If you are familiar with ic-siwe, then you will find it very easy to configure and use the ic-siwb.

Features

  • Bitcoin Wallet Sign-In: Sign in with popular btc wallets (currently with Wizz Wallet and Unisat wallet ) to generate an IC identity and session.

----- forked from SIWE ----

  • 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 Bitcoin wallet consistently produces the same Principal, irrespective of the client used.
  • Direct Bitcoin Address to Principal Mapping: Creates a one-to-one correlation between Bitcoin 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.

TODOS:

  • Integrated Tests: we need test cases to make sure the code is running correctly.
  • **More wallet supports **: we need more wallet supports, for example: OKX Wallet, Xverse, Hiro and more. And customizable provider to support more.
  • Prebuild and Deployed Canister: we need a canister to generate global stable identity, it’s best to be governed, upgraded and run by NNS.
  • Documentation: we need documentation on everything, codes and examples.
  • Publishing: crates and npm packages.

Next steps:

  1. more developers use and fork, and maintain the code.
  2. more adoption by projects
  3. your ideas, :smiley:.

@domwoe @kristofer @bob11

12 Likes

Awesome!
bitcoinOS will adopt ic-siwb,thanks

Updates: To add support for Xverse and more bitcoin compatible wallets. We also need to support BIP-322-simple Signature Verification, see BIP-0322.

Since there is no existing BIP322 rust crates we can use directly. We have to build it our own and also need to support both Segwit v0 and v1.

After we implement this, the final API call will add another parameter to the login parameter.

pub enum SignMessageType{
    ECDSA,
    Bip322Simple
}

the siwb_login function signature will be

#[update]
fn siwb_login(
    signature: String,
    address: String,
    public_key: String,
    session_key: ByteBuf,
    sign_message_type: SignMessageType,
) -> Result<LoginDetails, String>

3 Likes

Hey @neeboo, are there any updates on this and expanding the list of Bitcoin compatible wallets?

BIP322 is supported.
Currently Xverse is supported.

For the list, I think I will add more by the weekend

3 Likes