Search content
Sort by

Showing 5 of 5 results by paulwall
Post
Topic
Board Electrum
Re: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP]
by
paulwall
on 21/02/2018, 18:32:53 UTC
     "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!

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.
Post
Topic
Board Electrum
Re: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP]
by
paulwall
on 29/01/2018, 15:26:09 UTC
Hi HCP!

Looks like I am stuck somewhere at the end. I have a total of 3 addresses and one of them appears to be very tricky wallet address with 4 Transaction IDs. I did my best to fulfill all of the requirements for "More than one input" and I hardly doubt I made a mistake there. However, after I signrawtransaction the second time, I get:

"complete": false,
  "errors": [
    {
      "txid": "dc7995b5b2756c85657803519569c2203e7d18ff3bae7679f1a4b579cf9fca6c",
      "vout": 0,
      "witness": [
      ],
      "scriptSig": "",
      "sequence": 4294967295,
      "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. 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.

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.

Anyhow, considering the fact that at the end this particular transaction ID had issues I assume it might have been related to the issue I faced at the beginning. Please, assist.

P.S. I managed to retrieve BTG from my other two addresses (one of them is the "Change" address mentioned above) with no issues. So I've got to be doing something right.
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.
Post
Topic
Board Electrum
Re: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP]
by
paulwall
on 27/01/2018, 14:03:49 UTC
Hi!

Looks like I am stuck at the beginning. So I have created the 2fadisabled wallet, but when I am trying to open it with text editor the file looks like a mess and it does not have any "xprv" values in it. I do the cmd+F search and nothing pops up for xprv. I am using Mac OS HS and Electrum 3.0.3 Can anyone help, please?
Did you set a wallet password? It sounds like you're opening an encrypted file...

To successfully extract the X1 and X2 xprvs, your wallet file must not be encrypted, nor should the sensitive records be encrypted... The only way to achieve this is to NOT use a wallet password.

If you've already set a password, you can unset it by "changing the password" and just leaving the "new" password fields empty

Thank you! That was the problem. I suggest that you add it to the initial manual, because it can be confusing as the checkbox is automatically checked as "Encrypt wallet file" when one creates a new wallet.
Post
Topic
Board Electrum
Re: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP]
by
paulwall
on 25/12/2017, 18:38:26 UTC
Hi!

Looks like I am stuck at the beginning. So I have created the 2fadisabled wallet, but when I am trying to open it with text editor the file looks like a mess and it does not have any "xprv" values in it. I do the cmd+F search and nothing pops up for xprv. I am using Mac OS HS and Electrum 3.0.3 Can anyone help, please?

Very strange, I don't really know how Mac works honestly, never had it but I guess it opens the files just like the .txt of Windows.
Btw, don't use CMD+F, just go on the very bottom of the text file, if you want PM me a screen of the very bottom of the txt obscuring the sensible datas, I can check

I will try to replicate it on Windows maybe. Electrum for Mac might create different wallet files or something. Honestly, there is no xprv in the file whatsoever - neither at the bottom nor at the top.
Post
Topic
Board Electrum
Re: [TUTORIAL] How to extract Bitcoin Gold from a 2fa Electrum Wallet [STEP BY STEP]
by
paulwall
on 25/12/2017, 08:22:36 UTC
Hi!

Looks like I am stuck at the beginning. So I have created the 2fadisabled wallet, but when I am trying to open it with text editor the file looks like a mess and it does not have any "xprv" values in it. I do the cmd+F search and nothing pops up for xprv. I am using Mac OS HS and Electrum 3.0.3 Can anyone help, please?