Pages:
Author

Topic: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP] - page 2. (Read 1818 times)

newbie
Activity: 15
Merit: 0
Seems like a bad quote there... Huh

Did the explorer not allow you to broadcast the transaction? So you had to download BitcoinGold Core? If so, that sucks...

Sorry for the bad quote, I'm downloading the BitcoinGold Core right now, but I'd rather not to.
How can I make this work without downloading it? I don't know how to create a transaction, I did everything till "We are almost finished, now open Bitcoin Gold Core wallet."
HCP
legendary
Activity: 2086
Merit: 4314
Seems like a bad quote there... Huh

Did the explorer not allow you to broadcast the transaction? So you had to download BitcoinGold Core? If so, that sucks...
newbie
Activity: 15
Merit: 0
Quote
Also, do I have have to download the full core wallet (150GB)??
Just spent like 3 hours on this..idk if it's worth the 0.27 bcg that I have there  Huh
Apparently not... one of the explorers has a transaction broadcast feature now! https://btgexplorer.com/tx/send

After you create your raw transaction, try broadcasting using that. NOTE: I've not personally tested this


Fuck..I'm downloading it now. 150GB and slowwww, it will probably take me at least 7 days.
HCP
legendary
Activity: 2086
Merit: 4314
I don't think you got me right. I did not use anything from different address for another address, I did everything by the guide. However, please, take a look at what I initially had:
The address I can't handle is this: 3JuPB27nMEHvXuu9dmHQVrwHh5Wym8CJso
And if you run it through https://btgexplorer.com you will see that it has the same transaction ID (dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c) as my other address from Electrum Change section: 3JuwWAhRRqa8EQsp5DnoRP8rkBxCjuyZcv

Thus we have two different addresses that share the same transaction ID. And that is where it gets tricky - when you run the first one (3JuPB27nMEHvXuu9dmHQVrwHh5Wym8CJso) with "deserialize" it has 2 outputs but NONE of them have the "address" field that matches the address in question.
It seems you might be a little confused as to which address(es) your coins are/were in. The transaction you are looking at (dc799...), was sending FROM the 3JuPB address TO the 3JuwW address... so the only address of yours that had a UTXO from that transaction was 3JuwW (ps. this UTXO has already been spent on BTG chain)

So 3JuwW address is now EMPTY on BTG chain: Final Balance = 0.00 BTG

Your address: 3JuPB27nMEHvXuu9dmHQVrwHh5Wym8CJso
currently has TWO unspent BTG outputs... from two other transactions:
UTXO1 - 0.35977155 BTG
TXID1: https://btgexplorer.com/tx/28341395c82cfeb645eaa0ad2741b4b22b3df1ba2475153da8d43e7fe78049dd

UTXO2 - 0.33523 BTG
TXID2: https://btgexplorer.com/tx/9925465a2eeb0adbc2d5e21ada0900f32951ad72394afb73710f5cda8ee345ea


So, if you want to claim those BTG, you need to get the all the relevant information for those two transactions:
Code:
       {
            "address": "3JuPB27nMEHvXuu9dmHQVrwHh5Wym8CJso",
            "prevout_n": 9,
            "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187",
            "type": 0,
            "value": 35977155
        }
and
Code:
       {
            "address": "3JuPB27nMEHvXuu9dmHQVrwHh5Wym8CJso",
            "prevout_n": 8,
            "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187",
            "type": 0,
            "value": 33523000
        }

And then use that info to create your raw transaction: (NOTE: 5000 sat fee)
Code:
createrawtransaction '[{"txid": "28341395c82cfeb645eaa0ad2741b4b22b3df1ba2475153da8d43e7fe78049dd", "vout": 9 },{"txid": "9925465a2eeb0adbc2d5e21ada0900f32951ad72394afb73710f5cda8ee345ea", "vout": 8 }]' '{"YOUR_BTG_ADDRESS":  0.69495155}'

That will spit out the big long hex string (RAW_TRANSACTION_HASH)... you then sign it with the two private keys that you should have got from your "X1" and "X2" wallets that matches the "1" addresses that should have been found from the redeemscript for the 3JuPB address (ie. 2 of these 3 addresses: 1BQtSp5FGMMUKxSGMHWE7YRARDBA5vLYu5, 15F8E7e2faxDeB6F19ZX2UTS65BmassJT4 or 1XsXYJJxEaVN3m4P9ZRmPRgXseWwjP267).

Code:
signrawtransaction "RAW_TRANSACTION_HASH" '[{"txid": "28341395c82cfeb645eaa0ad2741b4b22b3df1ba2475153da8d43e7fe78049dd", "vout": 9, "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187", "redeemScript": "522102b12e4dbbfc4690630efd2d5b7e4843945ada831dc15dc1dbb5b9d577dd8e76b421032ef6597db919e099d42c248f616477a5cae78fcfce64a2b12760d4dd68ce3bfb21037cb10abf43adc77e9da2879320357daaf002a68c06b2ade4e2e6ca4685bfdf8753ae", "amount": "0.35977155"},{"txid": "9925465a2eeb0adbc2d5e21ada0900f32951ad72394afb73710f5cda8ee345ea", "vout": 8, "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187", "redeemScript": "522102b12e4dbbfc4690630efd2d5b7e4843945ada831dc15dc1dbb5b9d577dd8e76b421032ef6597db919e099d42c248f616477a5cae78fcfce64a2b12760d4dd68ce3bfb21037cb10abf43adc77e9da2879320357daaf002a68c06b2ade4e2e6ca4685bfdf8753ae", "amount": "0.33523000"}]' '["X1_PRIVKEY-3JuPB","X2_PRIVKEY-3JuPB"]'

That *should* spit out the hex string and say that it is complete (I'm fairly sure that you don't actually have to do two signrawtransactions, you can just do it once and provide all the required keys).

You should then be able to sendrawtransaction.





Things get a little more complicated when you are attempting to send multiple UTXOs from multiple addresses and multiple transactions. You need to make sure that you get all the transactionIDs, redeemscripts, scriptpubkeys etc sorted out... and just step through it logically.

The number of private keys required will change based on how many 2FA addresses you are claiming from. Each 2FA address involved requires TWO private keys. So, for the transaction I've outlined above where you have 2 UTXOs, but only 1 address... you need TWO private keys.

If you had 2 UTXOs and they were from 2 addresses, you would need FOUR private keys.


For instance... lets assume that the output from transaction (dc799...) had not yet been spent... and you wanted to include that as well... Now we have THREE UTXOs... and TWO addresses...

3rd UTXO:
Code:
       {
            "address": "3JuwWAhRRqa8EQsp5DnoRP8rkBxCjuyZcv",
            "prevout_n": 0,
            "scriptPubKey": "a914bcebdb20e40d359009993dae5ea9b273c49ab34287",
            "type": 0,
            "value": 262924200
        },

So, the createrawtransaction would have been something like:
Code:
createrawtransaction '[{"txid": "28341395c82cfeb645eaa0ad2741b4b22b3df1ba2475153da8d43e7fe78049dd", "vout": 9 },{"txid": "9925465a2eeb0adbc2d5e21ada0900f32951ad72394afb73710f5cda8ee345ea", "vout": 8 },{"txid": "dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c", "vout": 0 }]' '{"YOUR_BTG_ADDRESS":  3.32419355}'


and the signrawtransaction would have been something like:
Code:
signrawtransaction "RAW_TRANSACTION_HASH" '[{"txid": "28341395c82cfeb645eaa0ad2741b4b22b3df1ba2475153da8d43e7fe78049dd", "vout": 9, "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187", "redeemScript": "522102b12e4dbbfc4690630efd2d5b7e4843945ada831dc15dc1dbb5b9d577dd8e76b421032ef6597db919e099d42c248f616477a5cae78fcfce64a2b12760d4dd68ce3bfb21037cb10abf43adc77e9da2879320357daaf002a68c06b2ade4e2e6ca4685bfdf8753ae", "amount": "0.35977155"},{"txid": "9925465a2eeb0adbc2d5e21ada0900f32951ad72394afb73710f5cda8ee345ea", "vout": 8, "scriptPubKey": "a914bcd0de3ddeeaba6c3f9dd4fab6882d19cded030187", "redeemScript": "522102b12e4dbbfc4690630efd2d5b7e4843945ada831dc15dc1dbb5b9d577dd8e76b421032ef6597db919e099d42c248f616477a5cae78fcfce64a2b12760d4dd68ce3bfb21037cb10abf43adc77e9da2879320357daaf002a68c06b2ade4e2e6ca4685bfdf8753ae", "amount": "0.33523000"},{"txid": "dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c", "vout": 0, "scriptPubKey": "a914bcebdb20e40d359009993dae5ea9b273c49ab34287", "redeemScript": "5221038256ab0ff75ec35e8d8796da1f3c4740daffd3b20a3a0ddf4e9ad2d232e7eaff2103b2972991bf628c8dc80f9921241371fed1181f5f6dab0cdacbc72e531cc539892103f7637f9b89436d14455f1771d10e6f539606b5e650b1ac828aada72ad0f1503d53ae", "amount": "2.629242"}]' '["X1_PRIVKEY-3JuPB","X2_PRIVKEY-3JuPB","X1-PRIVKEY-3JuwW","X2-PRIVKEY-3JuwW"]'

See how the 3rd "TX" block has a different scriptpubkey and redeemscript? Also, note the four private keys required... 2 privkeys for 3JuPB address... and 2 privkeys for 3JuwW

Again, the privkeys for 3JuwW should have come from two of the addresses from the 3JuwW redeemscript (15rhdRoyuM9XA3wEpJpwx3w6EDCPhjjz25, 1PZQJMxvVWzjd8agCCgDVDD87SEFej85h3 and 14r64vr5MxHE7wfrBZcrZMjnNr3edpx3Wr) and would have been in your X1 and x2 wallets.
newbie
Activity: 6
Merit: 0
This is realy a great tutorial, but for me me it is to complicated to
create for all forks a wallet and download the blockchain.
I used the following service for a lot of coins BCH, BCH, BCD ...
for my electrum 2fa wallet
https://dig.walleting.services/#/aff/g0NlUXlciy4gwkabmMnd
OK it cost a 10% fee but worked great for me and saved a lot of time.
But it's your choice
legendary
Activity: 2758
Merit: 6830
i'm sorry if i up this thread, but it seems now clear to me that will never be a electrum wallet make for electrum gold, like electron cash for BCC. Is this correct? or they are still developing a btg version?
I don't think so. Bitcoin Gold has no community and it's not like their dev really want the coin to succeed. Soemone would need to care enough to make and support a fork (which I think is unlikely to happens)
hero member
Activity: 1666
Merit: 565
i'm sorry if i up this thread, but it seems now clear to me that will never be a electrum wallet make for electrum gold, like electron cash for BCC. Is this correct? or they are still developing a btg version?
HCP
legendary
Activity: 2086
Merit: 4314
     "error": "Operation not valid with the current stack size"

This same error is present in the first signrawtransaction output as well. I am not sure why it happens.
The "error" generally occurs for a MultiSig transaction when it has not been signed with the minimum required number of private keys (for Electrum 2FA, this is 2-of-3)... Obviously, after the first "signrawtransaction", it's only been signed with one key... However, if you are getting that on the second "signrawtransaction" then one of two things had occurred:

1. You have used the wrong private key (or keys) to sign the transaction... So the redeemscript is not evaluating correctly
Or
2. You didn't use the output from the first signrawtransaction as the TX_HASH for the second signrawtransaction, so you've still only signed it with one key


Quote
In your guide, you do not specify anything for AMOUNT_TO_SEND in the createrawtransaction for wallets with more than 1 input. So I decided to add together all the 'value' amounts from 4 transaction IDs, minus fee (100000 satoshi) and converted it to BTC. If I did it wrong, please, correct me.
Just a note, it's not "my" guide Wink

But yes, same rules apply... Simply tally up the values from the inputs, subtract the fee you wish to pay (100,000 seems like a LOT!!?! Shocked) and put the value in BTC!

You can easily use 10sats/byte fee on BTG... So unless your transaction is HUGE with more than 50 inputs you shouldn't need more than around (10*148*number of inputs)+44 sats as a fee

Ie. 5 inputs = (10*148*5) + 44 = 7444 sats.

Quote
However, there was one VERY interesting and also confusing moment along the way, at the very beginning. When I ran the deserialize(gettransaction("dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c")) I got two outputs and none of them matched the address I was considering (even though in your guide you say it has to). However, the very first output actually matched my other address from the 'Change' section. And this transaction ID(dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c) is also related to that other wallet.  So this particular moment was agains the plan and I simply decided to take the data from this first output, even though it did not match they address I considered.
If you used an input from a different (change) address, then you obviously also need to use the private keys for THAT address... They will be different.

Also, if you are using inputs from multiple addresses in one transaction (ie. Your address "that you considered" and your change address) them you need to sign the transaction with keys from BOTH addresses like so:

Code:
signrawtransaction "RAW_TRANSACTION_HASH" '[{"txid": "INPUT_TRX_ID_AddressA", "vout": PREVOUT_AddressA, "scriptPubKey": "INPUT_SCRIPT_PUB_KEY_AddressA", "redeemScript": "REDEEM_SCRIPT_AddressA", "amount": "INPUT_VALUE_FIELD_Trans1"},{"txid": "INPUT_TRX_ID_AddressB", "vout": PREVOUT_AddressB, "scriptPubKey": "INPUT_SCRIPT_PUB_KEY_AddressB", "redeemScript": "REDEEM_SCRIPT_AddressB", "amount": "INPUT_VALUE_FIELD_Trans2"}]' '["FIRST_PRIVATE_KEY_FOR_SIGNING_AddressA","FIRST_PRIVATE_KEY_FOR_SIGNING_AddressB"]'


You then feed the output of this to the second signrawtransaction and use the 2nd key for each address (note that everything else stays the same, ONLY the private keys and the input hash will be different:
Code:
signrawtransaction "HASH_OUTPUT_FROM_FIRST_SIGNRAWTX" '[{"txid": "INPUT_TRX_ID_AddressA", "vout": PREVOUT_AddressA, "scriptPubKey": "INPUT_SCRIPT_PUB_KEY_AddressA", "redeemScript": "REDEEM_SCRIPT_AddressA", "amount": "INPUT_VALUE_FIELD_Trans1"},{"txid": "INPUT_TRX_ID_AddressB", "vout": PREVOUT_AddressB, "scriptPubKey": "INPUT_SCRIPT_PUB_KEY_AddressB", "redeemScript": "REDEEM_SCRIPT_AddressB", "amount": "INPUT_VALUE_FIELD_Trans2"}]' '["SECOND_PRIVATE_KEY_FOR_SIGNING_AddressA","SECOND_PRIVATE_KEY_FOR_SIGNING_AddressB"]'


Quote
I have digged further and tried excluding the txid mentioned above from the 'createrawtransaction' and use the remaining 3 txid's and a sum of their balances for AMOUNT_TO_SEND. Just pretending this txid does not exist. Eventually I do get "complete":true in the end. However, when I try to send this transaction I get Missing inputs (code -25). So I have tried various combinations and still cannot figure it out.
"Missing inputs" means the inputs you are attempting to spend don't exist in the current UTXO set. This is generally because either:

1. The parent transaction never confirmed and has been dropped (so the input doesn't exist)
Or
2. The input has already been spent (so that input doesn't exist anymore)


Also, one thing that has tripped people up previously... You ONLY subtract the fee in the "createrawtransaction" when calculating AMOUNT_TO_SPEND. When putting the amounts in "signrawtransaction" commands, these need to match the original amount!
HCP
legendary
Activity: 2086
Merit: 4314
Did you type that "17" into the command? or did you copy/paste that? Just wondering what the weird symbol after the 17 is? Also, did you remember to use the ' marks?

Highlighted for emphasis Wink
Quote
createrawtransaction '[{"txid": "INPUT_TRX_ID", "vout": PREVOUT }]' '{"YOUR_BTG_ADDRESS":  AMOUNT_TO_SEND}'
newbie
Activity: 19
Merit: 0
Finally after two weeks my BTG wallet got synced. Now i get this error while trying to run createrawtransaction:


Error: Error parsing JSON:[{"txid": "ff8d8bec90611603b8aa9d19772aa7aa6d0991de4e8bc6c8c1a3436a1340bc11", "vout": 17◄ }]
 

Huh Huh
newbie
Activity: 37
Merit: 0
I figured it out. I had to minus fee only on createrawtransaction command and leave signtransaction values without fee. Now all BTG claimed Grin
HCP
legendary
Activity: 2086
Merit: 4314
When i'm signing first time i get this

Looks good.... that error is "normal"... basically telling you it is only partially signed.


Still crashing, I guess I'm gonna hodl that for life
that must be some huge trnasaction... if you put the TXID into blockchain.info, how big (in bytes) is that transaction?

Also, you can also get the raw transaction by using blockchain.info:
https://blockchain.info/tx/TXID_HERE?format=hex

like this: https://blockchain.info/tx/d3648194d94cbf3501e57b4a5f81d0759cc40ef213262e15cf6915bfb0f01d94?format=hex
newbie
Activity: 15
Merit: 0
When I type deserialize(gettransaction("TXID_HERE"))
into the Electroum's wallet, it crashes..I updated to the latest version and it still crash
Weird... I would not have expected that... what happens if you just use: gettransaction("TXID_HERE")

Does it still crash? or do you get the raw transaction hex? if you get the hex... put it into: https://coinb.in/#verify (it will give you the same info as derserialize(), txid, address, amount, scriptpubkey, and you can calculate the vout by counting which "output" it is, starting at 0)


Still crashing, I guess I'm gonna hodl that for life
newbie
Activity: 37
Merit: 0
I get this 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)
when typing last command sendrawtransaction "HASH"
This means you have not properly signed the transaction with the minimum number of private keys as specified in the MultiSig wallet... if Electrum 2FA... then you need to sign with 2-of-3. If you see that message, it means you have only signed it with ONE of the required keys... so while it is possible you did signrawtransaction twice with different keys... one of those keys might be wrong.
[/quote]

When i'm signing first time i get this

https://i.imgur.com/TW9DBs6.jpg

and second time

https://i.imgur.com/Du3FhHM.jpg
HCP
legendary
Activity: 2086
Merit: 4314
When I type deserialize(gettransaction("TXID_HERE"))
into the Electroum's wallet, it crashes..I updated to the latest version and it still crash
Weird... I would not have expected that... what happens if you just use: gettransaction("TXID_HERE")

Does it still crash? or do you get the raw transaction hex? if you get the hex... put it into: https://coinb.in/#verify (it will give you the same info as derserialize(), txid, address, amount, scriptpubkey, and you can calculate the vout by counting which "output" it is, starting at 0)


I get this 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)
when typing last command sendrawtransaction "HASH"
This means you have not properly signed the transaction with the minimum number of private keys as specified in the MultiSig wallet... if Electrum 2FA... then you need to sign with 2-of-3. If you see that message, it means you have only signed it with ONE of the required keys... so while it is possible you did signrawtransaction twice with different keys... one of those keys might be wrong.
newbie
Activity: 37
Merit: 0
I get this 16: mandatory-script-verify-flag-failed (Signature must be zero for failed CHECK(MULTI)SIG operation) (code -26)
when typing last command sendrawtransaction "HASH"
newbie
Activity: 15
Merit: 0
When I type deserialize(gettransaction("TXID_HERE"))
into the Electroum's wallet, it crashes..I updated to the latest version and it still crash

Also, do I have have to download the full core wallet (150GB)??
Just spent like 3 hours on this..idk if it's worth the 0.27 bcg that I have there  Huh
HCP
legendary
Activity: 2086
Merit: 4314
Going to go ahead and guess you have not wrapped the transactionID in "" marks have you?

try: deserialize(gettransaction("TransactionID"))

like this: deserialize(gettransaction("028a1dfd086b851f03d7d853616247ae0da865f086c49679c885529bdd4dd191"))

the " (quote) marks are important Wink
newbie
Activity: 1
Merit: 0
Has anyone else recieved the error:

>> Traceback (most recent call last):
                                                                                              ^
SyntaxError: invalid syntax



when inputting this command into Electrum's console:

deserialize(gettransaction(Transtion_ID))



I think I've tried pretty much everything.
HCP
legendary
Activity: 2086
Merit: 4314
The one that was converted to 2FA - if this was done AFTER 10-24, wouldn't a pre 2FA seed word set work to recreate the one private key that is of interest?
In short... yes, if they moved their coins to the 2FA wallet AFTER the fork, then their old, original "Standard" seed would allow them to get the private key. Note that with a Standard Electrum wallet, you don't even need to use the seed+BIP39 tool, you can just goto the "Addresses" tab ("View -> Show Addresses"), right click on the address you are interested in and select "Private Key" Wink


Quote
(not sure how a conversion to 2FA works but it seems it would require a new seed word sequence and hence an entirely new set of key pairs)
You don't "convert" to 2FA as such... you generate a completely new wallet with a completely new seed... and then send all your coins to the new 2FA wallet... so yes, you are correct, the 2FA wallet will indeed have a new seed mnemonic and entirely new sets of key pairs.


Pages:
Jump to: