Bitcoin Forum
April 23, 2024, 11:49:28 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [GUIDE]Double-spending an unconfirmed transaction made with a third-party client  (Read 30525 times)
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 10, 2013, 06:35:54 PM
Last edit: June 12, 2013, 10:48:19 PM by jackjack
Merited by BitMaxz (2)
 #1

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, 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

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
1713916168
Hero Member
*
Offline Offline

Posts: 1713916168

View Profile Personal Message (Offline)

Ignore
1713916168
Reply with quote  #2

1713916168
Report to moderator
1713916168
Hero Member
*
Offline Offline

Posts: 1713916168

View Profile Personal Message (Offline)

Ignore
1713916168
Reply with quote  #2

1713916168
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713916168
Hero Member
*
Offline Offline

Posts: 1713916168

View Profile Personal Message (Offline)

Ignore
1713916168
Reply with quote  #2

1713916168
Report to moderator
1713916168
Hero Member
*
Offline Offline

Posts: 1713916168

View Profile Personal Message (Offline)

Ignore
1713916168
Reply with quote  #2

1713916168
Report to moderator
marjamrob
Full Member
***
Offline Offline

Activity: 140
Merit: 100



View Profile
July 23, 2013, 03:26:01 PM
 #2

If You Use A Blockchain.info Wallet

Wait.
It will stop being broadcasted in 30 hours. I learned that the hard way.
clock27
Sr. Member
****
Offline Offline

Activity: 308
Merit: 250



View Profile
September 21, 2013, 01:38:35 PM
 #3

my unconfirmed tx's are from multibit Sad its been 10 days now so imma try this trick

deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1025



View Profile WWW
September 21, 2013, 09:55:38 PM
 #4

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).



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.
stellan0r
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500


Medical Translations for Bitcoins


View Profile
November 19, 2013, 05:00:36 PM
 #5

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?

Allgemeine Gesundheitsberatung gegen Bitcoin-Zahlung. Bei Fragen einfach eine PM schicken!
If you want to send a thank you: BTC "1PZJvKvarRviQRQWejpvXW2j4e1xbT8MZb"
markjamrobin
Sr. Member
****
Offline Offline

Activity: 462
Merit: 250



View Profile
November 19, 2013, 05:03:47 PM
 #6

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.

stellan0r
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500


Medical Translations for Bitcoins


View Profile
November 19, 2013, 05:08:45 PM
 #7

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.

Allgemeine Gesundheitsberatung gegen Bitcoin-Zahlung. Bei Fragen einfach eine PM schicken!
If you want to send a thank you: BTC "1PZJvKvarRviQRQWejpvXW2j4e1xbT8MZb"
stellan0r
Hero Member
*****
Offline Offline

Activity: 574
Merit: 500


Medical Translations for Bitcoins


View Profile
November 19, 2013, 05:29:29 PM
 #8

well, it seems waiting really works Wink

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

Allgemeine Gesundheitsberatung gegen Bitcoin-Zahlung. Bei Fragen einfach eine PM schicken!
If you want to send a thank you: BTC "1PZJvKvarRviQRQWejpvXW2j4e1xbT8MZb"
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4606



View Profile
November 19, 2013, 05:32:50 PM
 #9

well, it seems waiting really works Wink

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

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.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1025



View Profile WWW
November 19, 2013, 06:05:29 PM
 #10

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.
976_BTC
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 05, 2014, 09:11:37 PM
 #11

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.
Bitalo_Maciej
Member
**
Offline Offline

Activity: 80
Merit: 10


Lead developer


View Profile WWW
March 06, 2014, 07:20:19 AM
 #12

@976_BTC: We cannot help you without TXID or destination address of the transaction.

Web wallets get hacked all the time. Computer wallets get hacked all the time as well.
Solution? Hybrid P2SH wallets - safer than your online and offline wallets combined. Check it out, store and trade your Bitcoins with ease of mind!
w1R903
Full Member
***
Offline Offline

Activity: 218
Merit: 100


View Profile
March 06, 2014, 11:00:15 AM
 #13


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.

4096R/F5EA0017
976_BTC
Newbie
*
Offline Offline

Activity: 2
Merit: 0


View Profile
March 06, 2014, 03:30:03 PM
 #14

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.
w1R903
Full Member
***
Offline Offline

Activity: 218
Merit: 100


View Profile
March 06, 2014, 09:12:45 PM
 #15

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.

4096R/F5EA0017
faronwong
Jr. Member
*
Offline Offline

Activity: 266
Merit: 1


View Profile
March 12, 2014, 11:55:40 PM
 #16

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
lelapin
Newbie
*
Offline Offline

Activity: 34
Merit: 0


View Profile
January 25, 2015, 08:25:42 AM
 #17

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
jackjack (OP)
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
January 27, 2015, 01:37:31 PM
 #18

Which transaction was double-spent?

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Newar
Legendary
*
Offline Offline

Activity: 1358
Merit: 1000


https://gliph.me/hUF


View Profile
January 27, 2015, 01:58:18 PM
 #19

Which transaction was double-spent?

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

OTC rating | GPG keyid 1DC91318EE785FDE | Gliph: lightning bicycle tree music | Mycelium, a swift & secure Bitcoin client for Android | LocalBitcoins
worhiper_-_
Hero Member
*****
Offline Offline

Activity: 700
Merit: 500


View Profile
March 25, 2015, 08:52:58 AM
 #20

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...
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!