hd-wallet-derive icon indicating copy to clipboard operation
hd-wallet-derive copied to clipboard

how to get addresses for LocalCryptos chain addresses ?

Open danyhm opened this issue 4 years ago • 12 comments

Hello, in LocalCryptos (formerly LocalEthereum) the wallet backup is a json format which includes Coins with the following format {"token":"BTC","export":{"wallet_version":"1.0","timestamp":1589471278},"first_address":{"address":"3A1mws7jvLBbXVH..........","wallet_address_n":0},"chain_private_key":"db99....."}

how can i get the chain addresses and chain private keys?

danyhm avatar May 14 '20 17:05 danyhm

I would think you would use the chain_private_key value, except the prefix "db99..." looks funny to me, so it may not be an extended private key. Anyway, you could try:

$ ./hd-wallet-derive.php --coin=eth --key=<chain_private_key> -g

If that generates addresses, then check if the first one matches the value of first_address. If it doesn't match, then you may need to try a different bip39 path. afaik, ethereum uses the path: m/44'/60'/0'/0.

If it doesn't generate addresses, or you get completely lost, you could possibly try creating an empty/dummy account on localcryptos, back it up, and post json here, for me to try. Just never, ever add any funds to the dummy account though.

dan-da avatar May 14 '20 18:05 dan-da

@dan-da thanks for the reply here is the content of the dummy JSON backup file

[{"token":"ETH","export":{"wallet_version":"1.0","timestamp":1589481143},"first_address":{"address":"0x938e58c131d35e0a491bee31c27b90424d999c02","wallet_address_n":0},"chain_private_key":"081083b120f7aba8523c7caa7c6d297d2742dc3d99f5345f3427c3b0b519f6a2"},{"token":"BTC","export":{"wallet_version":"1.0","timestamp":1589481143},"first_address":{"address":"3DVRjDxP8es5SzK72jiMXoXQ7KzxDtqocb","wallet_address_n":0},"chain_private_key":"1628e4588a8c5d570aac603c8f9104d21d2680bdf52f77a926bea91985d6123c"}]

danyhm avatar May 14 '20 18:05 danyhm

Well, I tried, but no luck yet. First of all, the chain_private_key is a raw seed value, which hd-wallet-derive doesn't support yet.

So instead I went to iancoleman's bip39 tool, chose ethereum, and pasted the chain_private_key value in the Bip39 Seed field. This generates keys and addresses according to bip44. Unfortunately, the first address did not match the first_address in the json, ie 0x938e58c131d35e0a491bee31c27b90424d999c02.

So then I switched to the bip32 tab, which allows entering custom paths, and tried altering the bip44 path a couple ways, but still no match.

So basically, I think you need to contact localcryptos support and ask them what bip32 path they use for their wallet. Once you have it, you should be able to plug it into iancoleman's tool as outlined above.

Anyway, I'm going to leave this issue open as a reminder to implement raw seed support.

dan-da avatar May 14 '20 18:05 dan-da

thanks a lot, I already contacted them and will update this as soon as i get a reply

danyhm avatar May 14 '20 18:05 danyhm

ok, yeah seems a big oversight to me that the backup file does not include the bip32 path.

dan-da avatar May 14 '20 19:05 dan-da

Just to update, LocalCryptos staff said their format is non standard and I have to use their own tool available @ https://github.com/LocalCryptos/LocalCryptosWalletBackupExplorer/releases

danyhm avatar May 16 '20 17:05 danyhm

LocalCryptos staff said their format is non standard and I have to use their own tool

that's a big red flag. If it were me, I would run, not walk to get my assets out of there.

At least their code is on github, but even still, why not use a standard that enables users to restore to another wallet if they wish? That kind of lockin seems borderline malicious.

I took a quick look at their code in https://github.com/LocalCryptos/LocalCryptosWalletBackupExplorer/blob/master/src/components/StepThree/Explore/index.js

At first glance, I don't see see use of a bip32 path, so I'm really not sure what they are doing. It would require some study.

dan-da avatar May 16 '20 18:05 dan-da

Hello.

LocalCryptos doesn't have a HD/BIP32 wallet. We use a simple deterministic method of ratcheting keys instead. The algorithm we use isn't complex. You can read about it here if you like.

If you would like to export the private keys for your address to import to another wallet, you have two options:

(a) If you only need the private key for one address, use the LocalCryptos webapp. You can go to your wallet and click "Export private key" next to the address.

(b) You can put your wallet backup into this tool (follow the steps under "How do I use this?") and then export a list of all your addresses and keys.

Note that for Bitcoin wallets, you will need to use a SegWit-compatible Bitcoin wallet. Addresses in LocalCryptos use P2SH-wrapped P2WPKH addresses (in Electrum you can add the prefix p2wpkh-p2sh: to the WIF private key).

localcryptosMichael avatar May 21 '20 05:05 localcryptosMichael

Localcryptos has a bug in its withdrawal process. Three day ago I tried to withdraw all my BTC and the transaction still remains as "Pending". The transaction was never broadcasted because it never reached the Mempool. Now I have no access to my BTC and the support team of Localcryptos never answer. Option (a) is now unavailable to me in the platform. I have 36 addresses with BTC in Localcryptos, 34 out of 36 are marked as "UTxOs". Using option (b) I can find only the other 2 addresses but not the remaining 34 UTxOs. Please your help.

Rayo2010x avatar Jan 14 '22 14:01 Rayo2010x

@localcryptosMichael localcryptosMichael,pleae your help

Rayo2010x avatar Jan 14 '22 14:01 Rayo2010x

@localcryptosMichael localcryptosMichael,pleae your help

Hey Rayo2010x, I'm sure our customer support team can provide you guidance here and figure out why your transaction is stuck. Please write to us here. This GitHub issue isn't the place for LocalCryptos support. If you already have a support ticket number, let me know, privately, and I'll take a look at it immediately.

localcryptosMichael avatar Jan 15 '22 00:01 localcryptosMichael

Thank you @localcryptosMichael, I have just resolved the problem by myself. Localcryptos support never answered to me. Nevertheless, I would like to know why Option (b) doesn't work for addresses marked as UTxOs

Rayo2010x avatar Jan 15 '22 00:01 Rayo2010x