πŸ”‘Wallet

At present, the wallet supports linking and signature operations with the MetaMask wallet in BitBolt's demo interface. Support for additional wallets will be added in the future.

Why is a new address generated when linking to the MetaMask wallet, and how is this address created and managed?

When a user transfers Bitcoin from the Bitcoin network to the BitBolt network, these Bitcoin are held on the BitBolt blockchain. In order to control their Bitcoin on the BitBolt network, users need to transfer their BTC from the Bitcoin network to the BitBolt network. They will use the MetaMask wallet to sign and control their Bitcoin on BitBolt.

Key Derivation

The address that the user controls on the BitBolt network is generated based on the public key of their MetaMask wallet. The algorithm used to generate this address is as follows:

/// Returns a valid extended BIP-32 derivation path from a PublicKey Hash
pub fn derive_public_key(ecdsa_public_key: &ECDSAPublicKey, hash: &Vec<u8>) -> ECDSAPublicKey {
    let bip32DerivationOutput {
        public_key,
        chain_code,
    } = DerivationPath::new(
        derivation_path(hash)
            .into_iter()
            .map(DerivationIndex)
            .collect(),
    )
    .key_derivation(&ecdsa_public_key.public_key, &ecdsa_public_key.chain_code)
    .unwrap();
    ECDSAPublicKey {
        public_key: public_key,
        chain_code: chain_code,
    }
}

Bitcoin held at this address can only be controlled by the user.

Account Abstraction & Threshold ECDSA

Last updated