dart-bitcoin / bitcoin_flutter

A dart Bitcoin library for Flutter.
MIT License
165 stars 123 forks source link

invalid #53

Open HosseinAsadi opened 3 years ago

HosseinAsadi commented 3 years ago

The package does not generate the private key and address correctly at all

check your example into https://iancoleman.io/bip39/ on bitcoin network

i5hi commented 3 years ago

We just tested the key generation and derivation yesterday as part of our project and it works correctly. We tested it against Bitcoin-Core and BDK.

Can you provide a specific test case ?

nycm1989 commented 3 years ago

You must to create the address with an a derivation path like "m/44'/1'/0'/0/0"

pablonlr commented 2 years ago

I have the same problem, it doesn't generate the same private keys/addresses as

https://iancoleman.io/bip39/

I have also tried the seed in other HD wallets and it is still not the same keys.

i5hi commented 2 years ago

I would only use this library to EXPERIMENT. It's been dead for a while now.

Look into bdk. They have a bdk-ffi for direct native bindings to Kotlin and Swift.

If you want direct compatibility with dart, check out https://github.com/StackmateNetwork/the-stackmate

It currently only supports android but we are in the process of extended it to iOS too.

Just copy/packages/libstackmate/* & /lib/api/interface/libstackmate.dart & /lib/api/libstackmate.dart into your project and add libstackmate to your pubspec.yaml

You can use packages/libstackmate/update-core.sh to get the latest binaries from https://github.com/StackmateNetwork/stackmate-core or build it yourself. This will give you a really powerful descriptor wallet that leverages the awesome bdk wallet api.

Feel free to create issues if on our projects if you need any help. We are actively updating and looking for support.

libstackmate is also being used in a production application: Stackmate Wallet Play Store

pablonlr commented 2 years ago

Thanks, I'm already keeping an eye on it. Is it safe to send the seed or root key via rust bidings?

i5hi commented 2 years ago

Thanks, I'm already keeping an eye on it. Is it safe to send the seed or root key via rust bidings?

yes, afaik.

rust cleans up after itself. the point of vulnerability is then the C pointer that dart is left with, which im pretty sure gets handled properly by the dart FFI library.