17

Suppose we reach a state where only transactions that pay a fee are accepted by miners. Further supposed that someone created a transaction using an old/odd client that allowed them not to send any fees.

In this case, what would happen to the transaction? Could it be undone? Would the coins be lost forever?

5

I have successfully used the methodology described here to delete a transaction which didn't go anywhere because of a too low fee. In short, the process is as follows:

  • Configure Linux machine with db4.8-util and bitcointools. Ubuntu works fine.
  • Run following command on your data folder:

    ./dbdump.py --datadir ~/.bitcoin --wallet-tx > tx.txt
    
  • Open tx.txt using text editor. Find transaction in question. Should look like:

    ==WalletTransaction== 12a75d48a002ab920 ...
    block: 00000000000000000000000000000000 ...
    2 tx in, 1 out
    TxIn: value: 0.007640 prev(c09e92cb94ff1fb6d4 ...
    TxIn: value: 0.000050 prev(7dcda75e6ad8b5adc7 ...
    TxOut: value: 0.007690 pubkey:  Script: DUP HA...
    
  • Reverse the 12a75d48a002ab920... value, get something like 92ab02a0485da712. Don't need to reverse the whole line, just a few hex values from beginning. You will need to search for this in the database dump.

  • Dump the database using following command:

    db4.8_dump ~/.bitcoin/wallet.dat > dumpfile
    
  • Using text editor open the dumpfile and search for that 92ab02a0485da712 line you found earlier. There will be two lines - key and value, you need to delete both. Save the file.

  • Re-import the database using the following command:

    db4.8_load ~/.bitcoin/wallet2.dat < dumpfile
    

If all went fine, the wallet2.dat will have a database without transaction in question.

All of this, of course, only works if transaction was never accepted by the network, which is likely the case if you already waited a day, and nothing happens. There is no way to undo transaction which was already accepted by the network. I tried this technology twice and both times worked fine.

9

The transaction would have no effect. A transaction that wasn't accepted by the network has no effect on the ability to spend coins. The person whose coins were affected could simply delete that transaction from his own database. There's no need to undo the transaction since it was never committed to the block chain anyway.

  • 1
    But ... the transaction appears in the network immediately. If I transfer from A to B, B sees the TX immediately with 0 confirmations. So how can A delete it? – ripper234 Sep 5 '11 at 4:52
  • 3
    You're assuming a broken network configuration where transactions are accepted for relaying even though no miners are willing to commit them. There are many ways you can break the network with inconsistent configurations, that's just one of them. Everyone who participates in the Bitcoin system wants a useful system and the network would not be permitted to go into a useless state. (What if all miners refused to include any transactions at all?) – David Schwartz Sep 5 '11 at 5:29
  • What? I'm assuming someone using an unofficial or old bitcoin client, that doesn't include any TX fees. In this case, his transaction will be seen immediately, but it might take years for his TX to be confirmed, if at all. – ripper234 Sep 5 '11 at 7:48
  • 3
    Right, I understand that. If the network permitted a transaction to remain pending indefinitely without some way to override it with another transaction, the network as a whole would be broken. A broken client can't cause lost coins, you can just use a different client. – David Schwartz Sep 5 '11 at 16:37
1

Generally it is assumed that any client at that time will require a fee. As most clients require a fee now unless you start them with the no fee flag.

I suppose anyone could write their own client or use a client that has it re-enabled, but that is really on their own head and their best bet then would be to mine until they get a block and add their transaction to the block. That might take a couple years, but hey, they wanted a free transaction.

  • 1
    So if someone is using such a client, the TX would essentially be lost (except for the "mine your own block" solution)? There is no way to undo it or add fees retroactively, right? Hmm, someone could create a mining pool that includes specific transactions for an increased fee. – ripper234 Sep 5 '11 at 7:49
  • More likely a bank or such would create their own pool to handle their own transactions.. for no fee. – Evil Spork Sep 5 '11 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.