Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: jackjack on June 10, 2013, 06:35:54 PM



Title: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: jackjack on June 10, 2013, 06:35:54 PM
Looks like more and more people needs double-spending because of forever unconfirmed transactions.
If you created your transaction with bitcoin-qt (aka Satoshi client or bitcoin client), follow this guide (https://bitcointalk.org/index.php?topic=35214.0), which uses pywallet. This would delete the transaction from your delete and allow you to create a new one.
If not, you are in the right place.

1. Export your private key in base58 format (how to do this depends on the software used to make the unconfirmed transaction, but I'm sure it is straight-forward)
2. Create an empty wallet in bitcoin-qt (can be done with renaming your current wallet.dat to wallet.dat.bak and launching bitcoin-qt. Just be sure to keep wallet.dat.bak...)
3. Launch bitcoin-qt
4. Import the private key into bitcoin-qt (see this: https://en.bitcoin.it/wiki/How_to_import_private_keys_v7%2B)
5. Quit bitcoin-qt
6. Run
Code:
bitcoin-qt -rescan
7. Wait
8. Wait...
9. Now you have the full balance of the single key you imported (compare with blockexplorer. If not, stop here and post in this thread)
10. Create the transaction you wanted to do without forgetting the fee
11. Delete the new, nearly empty wallet.dat (just rename it if you're not sure about that part)
12. Rename wallet.dat.bak (thus your original wallet) to wallet.dat
13. Done


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: marjamrob on July 23, 2013, 03:26:01 PM
If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: clock27 on September 21, 2013, 01:38:35 PM
my unconfirmed tx's are from multibit :( its been 10 days now so imma try this trick


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: deepceleron on September 21, 2013, 09:55:38 PM
You are missing the part with the double-spending.

What you describe will remove a transaction from Bitcoin. This removes the "already spent" status of particular unspent txouts (individual bitcoin payments you've received from someone else and change inputs from previous transactions, called "inputs" when you look at block explorer sites) and returns them to your balance sheet. However, this alone neither prevents the transaction from later being included in the blockchain or guarantees that the previous transaction will be invalidated with a new spend from your wallet.

Picture this scenario:
-My wallet has a 1BTC and a 2BTC payment I've received and no other transactions.
-I send seller 1BTC with no fee (this transaction uses the wallet's unspent 1btc txout)
-which doesn't confirm in a timely manner.

Then:
-I follow this procedure to remove the transaction from my Bitcoin client and return the balance to Bitcoins I can spend.

Now:
-I resend 1BTC to the merchant with a 0.01 voluntary fee
-The wallet picks the most sensible txouts to construct the transaction of 1.01BTC, which is to use the 2BTC payment instead. 1.01BTC is sent to the sender and the wallet gets 0.99BTC change back.

Result:
-Merchant quickly gets new 1BTC payment
-Original transaction is not invalidated by any of it's txouts being double-spent
-But... surprise, some miner includes the original transaction in a block, now you have paid twice.


You must document the actual txouts spent by a payment before removing it, and use a coin-control type wallet to re-spend some of the same txouts with appropriate fee; only when some of the same txouts are confirmed in the blockchain could the original payment be considered invalid.


There was a previous discussion about adding a re-send type feature to double-spend with more fee, with code for miners to recognize the new transaction as legitimate as it did not alter the original payment:

I thought I have seen Gavin somewhere talking about adding fees to already existing transactions... am I mistaken ?

I'm working on a patch that will create the basic infrastructure to add fees to transactions that have been sent but not yet included in a block. It will only let you add additional inputs and outputs, but never make any output have a lower value than it did before. Nor will it let you modify a transaction that has already been spent.

I've been considering what criteria nodes should have to allow discarding a pending in-memory transaction and replace it with an increased-fee transaction. Your conclusion is logical.

Since the output of a transaction that is change can't be identified by miners or nodes, to validate what constitutes a legitimate non-double-spend transaction, it appears that a retransmitted transaction must not alter any inputs or outputs in the original transaction. If one of the outputs were allowed to be reduced to increase the fee, this could mean a 0 confirmation payment to someone could be changed from the expected value, which is the definition of a malevolent double-spend. If any output could be modified in the original, this means that 0 confirm payments could not be trustable, because output values could be moved from one recipient to another or reduced.

Instead, fee must solely be added by adding a new input, and a separate change payment must be sent. In the example below, I show where we add another complete input and change (where fee = input - change).

http://we.lovebitco.in/img/modtransaction.png

OutputX, another payment to another recipient (or a third change payment to enhance anonymity even more), could be optional and shouldn't be a "blocker" if it exists. Change from adding a fee demands some new outputs. However, being able to add such "mini-transaction" chunks with new inputs and outputs and retransmit them, could mean that a service that issues many regular payments could just keep adding to an existing 0 confirmation transaction and retransmitting, instead of creating a new transaction. I don't know if this would be a novel feature or undesirable.

Another strange situation is if the original tx has spent all the available inputs, the user can't increase the fee. Explaining why the wallet can't add more fee even though it shows a balance will be one for the UI designers.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: stellan0r on November 19, 2013, 05:00:36 PM
If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.

Does it mean it will be reversed and back in my wallet to spend if the tx was not confirmed within 30 hours?
What would happen if I would import the blockchain wallet data into bitcoin-qt and double spend the btc to get them back?


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: markjamrobin on November 19, 2013, 05:03:47 PM
If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.

Does it mean it will be reversed and back in my wallet to spend if the tx was not confirmed within 30 hours?
What would happen if I would import the blockchain wallet data into bitcoin-qt and double spend the btc to get them back?

You have to wait for it to leave te memory pool, anyway, but in ~30 hours, it will be back in a Blockchain wallet.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: stellan0r on November 19, 2013, 05:08:45 PM
so you are actually saying that I need to wait and do nothing, right? ;-)

then my first tx should be back in my wallet tomorrow morning... too bad the blockchain wallet does this from time to time, seems I will only use the custom tx instead of quick tx in the future (where I can adjust the fee by hand)


If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.

Does it mean it will be reversed and back in my wallet to spend if the tx was not confirmed within 30 hours?
What would happen if I would import the blockchain wallet data into bitcoin-qt and double spend the btc to get them back?

You have to wait for it to leave te memory pool, anyway, but in ~30 hours, it will be back in a Blockchain wallet.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: stellan0r on November 19, 2013, 05:29:29 PM
well, it seems waiting really works ;)

just got all 3 tx at the same time confirmed.. crazy system, hope this works better as soon as btc is really mainstream ;)


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: DannyHamilton on November 19, 2013, 05:32:50 PM
well, it seems waiting really works ;)

just got all 3 tx at the same time confirmed.. crazy system, hope this works better as soon as btc is really mainstream ;)

It will work fine if users include a reasonable transaction fee.

It will also work better if miners implement "child pays for parent".  Such an enhancement would increase their profits and would solve problems like this.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: deepceleron on November 19, 2013, 06:05:29 PM
If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.
If You Use A Blockchain.info Wallet

Don't.
It uses a non-standard Bitcoin that doesn't calculate correct minimum fees or minimum transactions amounts required by Bitcoin.
Many learned that the hard way.

As a TL;DR to my long post above: after removing a never-confirming transaction from your wallet to restore your balance, simply spend your whole wallet balance back to a new wallet address to be sure the old transaction is invalidated on the network.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: 976_BTC on March 05, 2014, 09:11:37 PM
Hello,

This is my first post here.  Hello to everyone.

I have the same unconfirmed, zero(0) confirmations transaction I sent from my blockchain wallet.  I sent about $245 to ONE address.  I sent it 48 hours ago.  I read someone above stated that blockchain will return the coins after about 30 hours, so this is now starting to worry me bc everywhere I read it takes blockchain 30-48 hours approx. to get the coins back if a transaction stays unconfirmed.

Is there any BTC masters out there that could help me with this for a fee?  I would very very greatly appreciate it.

Details-

- I sent around $245
- I afterwards sent a couple cents to the same address that I got the unconfirmed stuck transfer, and the couple cents went thru in less then an hour
- the wallet I'm sending it to has no way for me to check if there is any pending transfers.
- I used the recommended fees setting(the middle setting)
- the network propagation is very low at 0-1%

Thanks a million in advance for any help or thoughts.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: Bitalo_Maciej on March 06, 2014, 07:20:19 AM
@976_BTC: We cannot help you without TXID or destination address of the transaction.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: w1R903 on March 06, 2014, 11:00:15 AM

Is there any BTC masters out there that could help me with this for a fee?  I would very very greatly appreciate it.


If you post the transaction id, I'm sure someone will help you.  I'll check back here later today to see if you've posted it.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: 976_BTC on March 06, 2014, 03:30:03 PM
Hello, everybody,

The coins finally came thru. I really worried my ass off for nothing. I thought everyone was wrong about the "just wait" phrases. I thought this was a rare occurrence that could only happen to me, but about 50 hours later, the Coins came!!!!

Thanks a million though for everyone's help and input.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: w1R903 on March 06, 2014, 09:12:45 PM
Hello, everybody,

The coins finally came thru. I really worried my ass off for nothing. I thought everyone was wrong about the "just wait" phrases. I thought this was a rare occurrence that could only happen to me, but about 50 hours later, the Coins came!!!!

Thanks a million though for everyone's help and input.

Actually, in this case it probably had nothing to do with Bitcoin directly, but rather with blockchain.info's implementation.  Blockchain.info has been having some difficulties with transactions getting "stuck" the past few weeks.  They've issued a statement about it:

https://blog.blockchain.com/2014/03/05/occasional-unconfirmed-transactions-are-being-addressed/

It appears it has been resolved, at least according to the update they published to that statement.  But the point is, this appears to have been a blockchain.info problem, not a Bitcoin issue.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: faronwong on March 12, 2014, 11:55:40 PM
Ive mistakenly sent a bitcoin without minimum tx fee duh.....unconfirmed as youd guess.....will this eventually get there or be returned?....timeframes anyone? as above done this on blockchain!! two hours so far

thanks


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: lelapin on January 25, 2015, 08:25:42 AM
I made a double spend with the funds of an unconfirmed tx, now all my funds are stuck and blockchain.info blockr and blocktrail show different balance and differ on a 0.3 tx , my wallet is at blockchain.info, it shows a positive balance but I cant spend it, help pls my addy is 1AndReyU6rVV2bjS6a6XoVdkhFqsyycK9Z


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: jackjack on January 27, 2015, 01:37:31 PM
Which transaction was double-spent?


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: Newar on January 27, 2015, 01:58:18 PM
Which transaction was double-spent?

This is his thread: https://bitcointalk.org/index.php?topic=935258.0


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: worhiper_-_ on March 25, 2015, 08:52:58 AM
If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.

I'm getting a feeling that this was changed as I'm getting a transaction of mine rebroadcasted every day for about a week...

Also sorry for the necropost...


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: kalp on November 25, 2016, 05:53:12 PM
need your help with 2 unconfirmed transactions.
transaction done from AIMBTC to 2 different bitcoin wallets on 22nd Nov-16. already 72hours passed, but amount not received buy receiver or reversed to my wallet.

https://chain.so/tx/BTC/20187195451dc640cf41063de8c904c4fef589009c1f8ce802c6c42594b48372

https://chain.so/tx/BTC/2f728cf4e0f1e85e18c97fd8098acda2703464ffbd479d7452ab1f7eef69c72b

please help to recover my bitcoins.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: zicred on January 07, 2017, 03:03:07 PM
Hi for all
made a mistake sending 0,5btc with fee 255 satoshi
now i have unconfirmed tx 1b391d54470adcd282ff8fa3782d7f012f85e001de147aeac0f211bb7164dc35 from 4 january
Trying delete wallet.dat and import private key. It is not helped me. I see previous balance in bitcoin core but cant make new transaction
Double spend resolve the problem...


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: longbob72 on January 07, 2017, 03:14:25 PM
Hi for all
made a mistake sending 0,5btc with fee 255 satoshi
now i have unconfirmed tx 1b391d54470adcd282ff8fa3782d7f012f85e001de147aeac0f211bb7164dc35 from 4 january
Trying delete wallet.dat and import private key. It is not helped me. I see previous balance in bitcoin core but cant make new transaction
What can i do now?

Contact Quickseller (https://bitcointalk.org/index.php?action=profile;u=358020) or macbook-air (https://bitcointalk.org/index.php?action=profile;u=16114) to push your transaction to F2pool. You can also try submitting the transaction here (https://www.viabtc.com/tools/txaccelerator/), but I haven't actually see a successful attempt with that so it may or may not work.


Title: Re: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client
Post by: mattvk on June 22, 2017, 02:49:04 PM
can anybody help me ( i will pay 80$ ) i got scammed 2 hours ago by a guy but transaction is still unconfirmed.i only signed up to ask this.