Bitcoin Forum
March 19, 2024, 02:44:05 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: I broke my wallet, sends never confirm now.  (Read 12575 times)
kermit (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
September 29, 2010, 11:05:57 AM
 #1

Nothing I send gets confirmed now. 

Here's how I did it:

I was sending out payments under .01 in size and not paying a transaction fee, which of course were never confirmed.

Here's a guess as to why it broke my wallet:

Because the change leftover was also then never confirmed, yet my client treats it as if it was so includes those amounts in the amounts it sends out.



I've only lost 100btc, so I'm not real worried, but if you know how to fix it without too much trouble, that'd be nice.
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
"Governments are good at cutting off the heads of a centrally controlled networks like Napster, but pure P2P networks like Gnutella and Tor seem to be holding their own." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
1710816245
Hero Member
*
Offline Offline

Posts: 1710816245

View Profile Personal Message (Offline)

Ignore
1710816245
Reply with quote  #2

1710816245
Report to moderator
Tritonio
Hero Member
*****
Offline Offline

Activity: 640
Merit: 500


Vanity of vanities; all is vanity...


View Profile
September 29, 2010, 12:27:57 PM
 #2

You could edit your client to make it include into blocks any transactions without looking at the fee. And then wait a month or so until you make a block which will include your transactions... Or wait until someone else with a custom client includes your transactions in his block.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5138
Merit: 12564


View Profile
September 29, 2010, 12:38:32 PM
 #3

Quote from: kermit
Because the change leftover was also then never confirmed, yet my client treats it as if it was so includes those amounts in the amounts it sends out.

This seems likely. Try sending a ton of 0.01 transactions -- most of these transactions will work if this is the case.

Or wait until someone else with a custom client includes your transactions in his block.

For this you'll want to use the -maxconnections switch with a high number of connections, because propagation of your invalid transaction will be very poor.

You could also "double-spend" your pre-experiment coins by acting as though the unconfirmed transactions never happened. A wallet backup would roll things back, for example.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Tritonio
Hero Member
*****
Offline Offline

Activity: 640
Merit: 500


Vanity of vanities; all is vanity...


View Profile
September 29, 2010, 12:40:24 PM
 #4

For this you'll want to use the -maxconnections switch with a high number of connections, because propagation of your invalid transaction will be very poor.

Huh? Clients don't propagate what they consider invalid? I thought that they just didn't include it in their blocks...
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5138
Merit: 12564


View Profile
September 29, 2010, 12:46:52 PM
 #5

Huh? Clients don't propagate what they consider invalid? I thought that they just didn't include it in their blocks...

Hmm; I'm not sure about this case. They're not working on your new transaction because the previous transaction wasn't in a previous block and isn't in their memory pool. I don't know if they'd relay it.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
nanotube
Hero Member
*****
Offline Offline

Activity: 482
Merit: 501


View Profile WWW
September 29, 2010, 01:42:32 PM
 #6

Hey, so i've been the recipient of a few of these microtransactions
so now i have several transactions in my wallet that are now perpetually in the '0/unconfirmed' state

so the question is, if i send stuff, will it include those bitcoins in my sends, thus propagating the invalid chain? what is to be done here?

note also that this seems like a valid way to spam the network - send a bunch of microtransactions without the fee, so you can effectively multispend the same bit of btc and spam everyone's wallets with bogus microtransactions at no cost to you?

Join #bitcoin-market on freenode for real-time market updates.
Join #bitcoin-otc - an over-the-counter trading market. http://bitcoin-otc.com
OTC web of trust: http://bitcoin-otc.com/trust.php
My trust rating: http://bitcoin-otc.com/viewratingdetail.php?nick=nanotube
Tritonio
Hero Member
*****
Offline Offline

Activity: 640
Merit: 500


Vanity of vanities; all is vanity...


View Profile
September 29, 2010, 01:51:15 PM
 #7

Hey, so i've been the recipient of a few of these microtransactions
so now i have several transactions in my wallet that are now perpetually in the '0/unconfirmed' state
They will get confirmed when someone that doesn't require fees include them in his/her block.
so the question is, if i send stuff, will it include those bitcoins in my sends, thus propagating the invalid chain? what is to be done here?
There is no invalid chain just because someone didn't want to pay the fee. It will just take longer for them to get included in a block and until then they can be double spend if someone hasn't heard about them. BTW if nodes don't propagate transactions just because they don't like them it will be dangerous since it will be easier for someone to double spend bitcoins.
note also that this seems like a valid way to spam the network - send a bunch of microtransactions without the fee, so you can effectively multispend the same bit of btc and spam everyone's wallets with bogus microtransactions at no cost to you?
You can also send the same 1BTC back and forth between two clients, using different addresses every time. If you do it fast enough you will probably be able to fill up the block that everyone is trying to generate and therefore make the network really slow and lower the chances for legitimate transactions to get into blocks... Also if you do it reeeealllly fast you could saturate the network for a long time, even after you exit the network. You will just leave the rest trying to fit hundreds of thousands of transactions into blocks... I don't know if there is any protection in the protocol from this kind of attacks... If not, they are quite easy to be done. We really need fixed transaction fees with the option to change your preferences on what is the fixed price you accept and what fee to include in your own transactions.
kermit (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
September 29, 2010, 02:34:45 PM
 #8

it seems this could take down the whole network depending on the logic behind combining lots.. as in if the micropayment without fee is combined with a normal transaction and has change, both the send and the change would never confirm either.  so now you have 2 lots that will never confirm.  repeat.

and it does seem the client lets you spend unconfirmed coin.
nanotube
Hero Member
*****
Offline Offline

Activity: 482
Merit: 501


View Profile WWW
September 29, 2010, 03:27:50 PM
 #9

Hey, so i've been the recipient of a few of these microtransactions
so now i have several transactions in my wallet that are now perpetually in the '0/unconfirmed' state
They will get confirmed when someone that doesn't require fees include them in his/her block.

yes and.... at this point /all/ clients require fees for transactions <0.01, do you have any reason to expect that this will change at any point in the future? i don't. so "never will get confirmed" seems a reasonable approximation to reality.

Quote
so the question is, if i send stuff, will it include those bitcoins in my sends, thus propagating the invalid chain? what is to be done here?
There is no invalid chain just because someone didn't want to pay the fee. It will just take longer for them to get included in a block and until then they can be double spend if someone hasn't heard about them. BTW if nodes don't propagate transactions just because they don't like them it will be dangerous since it will be easier for someone to double spend bitcoins.

yes but the problem is that the client doesn't let the user choose which coins to spend, it does it all "automagically" behind the scenes. so how would a user know if he's sending confirmed coins or unconfirmed coins?

Quote
note also that this seems like a valid way to spam the network - send a bunch of microtransactions without the fee, so you can effectively multispend the same bit of btc and spam everyone's wallets with bogus microtransactions at no cost to you?
You can also send the same 1BTC back and forth between two clients, using different addresses every time. If you do it fast enough you will probably be able to fill up the block that everyone is trying to generate and therefore make the network really slow and lower the chances for legitimate transactions to get into blocks... Also if you do it reeeealllly fast you could saturate the network for a long time, even after you exit the network. You will just leave the rest trying to fit hundreds of thousands of transactions into blocks... I don't know if there is any protection in the protocol from this kind of attacks... If not, they are quite easy to be done. We really need fixed transaction fees with the option to change your preferences on what is the fixed price you accept and what fee to include in your own transactions.

yes, but that's a separate issue. i'm really trying to figure out what, if anything, to be doing about the handful of never-to-be-confirmed transactions i have in my wallet, whether the client will prioritize sending other coins first or not, and if not... that means it's possible that i'll never be able to make a send transaction that will be confirmed, because the unconfirmed bits of coin will be included. which would in turn mean that my whole wallet is foobar.

Join #bitcoin-market on freenode for real-time market updates.
Join #bitcoin-otc - an over-the-counter trading market. http://bitcoin-otc.com
OTC web of trust: http://bitcoin-otc.com/trust.php
My trust rating: http://bitcoin-otc.com/viewratingdetail.php?nick=nanotube
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5138
Merit: 12564


View Profile
September 29, 2010, 03:56:04 PM
 #10

I checked the code. It seems that the transactions will be relayed, since they pass AcceptToMemoryPool. The network will tend to forget these transactions because the memory pool is cleared when Bitcoin shuts down, and as far as I can tell nodes never relay transactions that they already have in their memory pool.

Quote from: Tritonio
I don't know if there is any protection in the protocol from this kind of attacks

There is. The more transactions waiting to be included in a block, the higher the transaction fee has to be for one to get in.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
wscott
Newbie
*
Offline Offline

Activity: 20
Merit: 0


View Profile
September 29, 2010, 04:54:41 PM
 #11

And in the future node could certainly drop connections from nodes that generate bad transactions.
nanotube
Hero Member
*****
Offline Offline

Activity: 482
Merit: 501


View Profile WWW
September 29, 2010, 05:55:49 PM
 #12

I checked the code. It seems that the transactions will be relayed, since they pass AcceptToMemoryPool. The network will tend to forget these transactions because the memory pool is cleared when Bitcoin shuts down, and as far as I can tell nodes never relay transactions that they already have in their memory pool.

Quote from: Tritonio
I don't know if there is any protection in the protocol from this kind of attacks

There is. The more transactions waiting to be included in a block, the higher the transaction fee has to be for one to get in.

theymos: well... the problem is that it causes problems for the wallets that happen to have received those transactions. my wallet now includes a bunch of small transactions that will never be confirmed (due to their not having paid the requisite fees).

since the client does not let the user control which coins to send, any transaction i send out in the future is liable to try to include those coins in the outgoing payment, which, in turn, will never get confirmed, thus borking my whole wallet.

so say a 'rogue' client harvests a bunch of addresses of the net (these forums are a good and ripe place), and starts sending out a bunch of .000001 payments with no fee. now these wallets will all be contaminated with these never-to-be-confirmed payments, and since the client doesn't allow one to choose which coins get sent, they may be included in future outgoing payments, which will also never get confirmed.

so what should i do to 'clear' my wallet? i'd need some custom tool to be able to send /specific coins/, so that i can send them all to another wallet and drop the contaminated one.

and more importantly, for the future - how do we address this problem?

Join #bitcoin-market on freenode for real-time market updates.
Join #bitcoin-otc - an over-the-counter trading market. http://bitcoin-otc.com
OTC web of trust: http://bitcoin-otc.com/trust.php
My trust rating: http://bitcoin-otc.com/viewratingdetail.php?nick=nanotube
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5138
Merit: 12564


View Profile
September 29, 2010, 06:28:47 PM
 #13

At (roughly) line 3191 in main.cpp (SelectCoins), change the if statement to this:
Code:
if (!pcoin->IsFinal() || pcoin->fSpent || pcoin->GetDepthInMainChain() < 1)

Your client will then no longer consider coins with 0 confirmations when choosing coins.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
September 29, 2010, 06:37:56 PM
 #14

At (roughly) line 3191 in main.cpp (SelectCoins), change the if statement to this:
Code:
if (!pcoin->IsFinal() || pcoin->fSpent || pcoin->GetDepthInMainChain() < 1)

Your client will then no longer consider coins with 0 confirmations when choosing coins.

IMO, this should make it into the upstream bitcoin client, as either
  • a command line switch, requiring confirmation for all sent coins
  • a two-pass search:  search first for confirmed coins.  if not enough confirmed coins are available, use unconfirmed coins.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5138
Merit: 12564


View Profile
September 29, 2010, 06:47:21 PM
 #15

The best option might be four passes at 120, 6, 1, and 0, to somewhat prioritize based on depth.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Tritonio
Hero Member
*****
Offline Offline

Activity: 640
Merit: 500


Vanity of vanities; all is vanity...


View Profile
September 29, 2010, 06:50:53 PM
 #16

and more importantly, for the future - how do we address this problem?

I really don't care about extremelly fast transactions. It would be enough for me if Bitcoin didn't even show unconfirmed transactions and didn't even try to spend them before they get confirmed. FFS just wait 10minutes for a block to appear confirming them.  Grin
nanotube
Hero Member
*****
Offline Offline

Activity: 482
Merit: 501


View Profile WWW
September 29, 2010, 07:13:23 PM
 #17

At (roughly) line 3191 in main.cpp (SelectCoins), change the if statement to this:
Code:
if (!pcoin->IsFinal() || pcoin->fSpent || pcoin->GetDepthInMainChain() < 1)

Your client will then no longer consider coins with 0 confirmations when choosing coins.

thanks theymos for the patch!

i guess now i have to figure out how to build bitcoind.... Smiley

or maybe i'll just wait around for this to make it into the next official release...
if satoshi agrees with jgarzik as far as including those options in mainline, maybe i don't have to wait that long...

Join #bitcoin-market on freenode for real-time market updates.
Join #bitcoin-otc - an over-the-counter trading market. http://bitcoin-otc.com
OTC web of trust: http://bitcoin-otc.com/trust.php
My trust rating: http://bitcoin-otc.com/viewratingdetail.php?nick=nanotube
kermit (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
September 29, 2010, 07:47:17 PM
 #18

Some people might want to add the

pcoin->GetDepthInMainChain() < 1

in GetBalance() too.
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1091


View Profile
September 29, 2010, 07:58:47 PM
 #19

Some people might want to add the

pcoin->GetDepthInMainChain() < 1

in GetBalance() too.

Well, I would rather split "balance" in two:  confirmed and unconfirmed balances.

Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
nanotube
Hero Member
*****
Offline Offline

Activity: 482
Merit: 501


View Profile WWW
September 29, 2010, 08:58:33 PM
 #20

ok, so i built a modified bitcoind, with the addition of 'pcoin->GetDepthInMainChain() < 1' to both SelectCoins and GetBalance.

My 'stock client' balance shows as 131.00139787, and my modified client balance shows as 130.92112098, so i have about 0.08xx of "bad" bitcoins' worth of transactions in my wallet.

So I guess now, all i need to do is create another wallet, and then send all the "good coins" from my old wallet to my new one (or, i guess... i could just use the same wallet, since my bitcoind won't try to send the bad coins, i can just ignore them....)

But yes, I hope the modifications as described by jgarzik (being configurable with cli switches/checkboxes) do make it into mainline - because otherwise it's too easy to 'poison' people's wallets with bogus transactions.

Join #bitcoin-market on freenode for real-time market updates.
Join #bitcoin-otc - an over-the-counter trading market. http://bitcoin-otc.com
OTC web of trust: http://bitcoin-otc.com/trust.php
My trust rating: http://bitcoin-otc.com/viewratingdetail.php?nick=nanotube
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!