focustree / starknet.dart

Mobile SDK for StarkNet ✨
https://starknetdart.dev
MIT License
30 stars 28 forks source link

Account address is different while use same Mnemonic by starknet.dart BraavosAccountDerivation and braavos wallet #393

Open gtmickey opened 3 months ago

gtmickey commented 3 months ago

Describe the bug Account address is different while use same Mnemonic by starknet.dart and braavos wallet

To Reproduce Steps to reproduce the behavior:

  1. import Mnemonic to braavos wallet: smoke clock senior verb tube steak wealth cram absorb robust long mutual
  2. wallet show account address: 0x002b945db72c8bb7361ca7457fc3dd3b35831d359c99ee03fddc24f847326d6d
  3. create account by same Mnemonic with Account.fromMnemonic,
    final account = Account.fromMnemonic(
      mnemonic: mnemonic,
      provider: provider, // mainnet
      chainId: chainId, // mainnet chainId
      index: index, // 0
      accountDerivation: accountDerivation, // default to  BraavosAccountDerivation
    );
  4. address is 0x17524b0b247a01969d21d626175d449fc0fb7d3b5fc467a9d22c16f58abc4fd

Expected behavior same Mnemonic should have same address with Braavos wallet and BraavosAccountDerivation on starknet.dart

devnet0x commented 1 month ago

Hi, this is caused because braavos change their class_hash a few months ago. Also, their calldata only needs public key. I sent PR #407 to fix this issue. Please check...thanks.