samotari / paynoway

A mobile app for testing payment systems against double-spend attacks.
GNU General Public License v3.0
36 stars 8 forks source link

Double-spend without RBF #7

Open chill117 opened 5 years ago

chill117 commented 5 years ago

For coins that do not have the RBF feature it is still theoretically possible to double-spend. Further research is needed, but here is a general idea:

There might be some other tricks that can be used to prevent wide-spread propagation of the initial payment transaction such as:

iqbiz commented 2 years ago

Sir i wanted to know that Double Spend without RBF Protocol is possible? and if yes then can you please teach me how or which wallet is providing?

chill117 commented 2 years ago

It is technically possible but not trivial to achieve nor guaranteed to succeed. You can check the comments in #44 to see some ideas around this topic. But again it is not something that has been implemented yet in PayNoWay.

iqbiz commented 2 years ago

Dear Sir can you guide me or teach me double spend without RBF. I will also pay according to my pocket sir. Guide me through which wallet i can do this. Or another thing is this possible to get such bitcoin lightning network wallet which accept RBF bitcoin and then send those RBF bitcoin no need to make channel like there is no need to make channel in "Wallet of Satoshi"

iqbiz commented 2 years ago

in PaNoway double spend without RBF is possible or if we send double send amount to PayNoWay and then send that btc to another walelt then will that wallet receive payment without "Parnet" or "RBF" Tag?

chill117 commented 2 years ago

As I said, double-spending without RBF using PayNoWay is not possible at the moment. I do not know of any wallet application that has this capability either. It's not a trivial thing to achieve. And please, do not use this app nor the techniques described in this project to double-spend against real merchants without their prior explicit consent. This project is intended for educational and testing purposes to help the bitcoin community.

iqbiz commented 2 years ago

thank you very much sir. And sir if double spend without RBF is possible and you can teach then i am willing to pay the fee sir.

chill117 commented 2 years ago

thank you very much sir. And sir if double spend without RBF is possible and you can teach then i am willing to pay the fee sir.

I won't be doing that. But there are plenty of resources online for you to find and learn from. If you have the time and motivation to do so, I suggest you try that.

iqbiz commented 2 years ago

I been searching on that from last 6 months and haven't got any success. if u guide me little or the source point i will definitely get success. need you little help to het source point.

iqbiz commented 2 years ago

sir again i search alot for the resources but haven't got any. So can u please help me out in getting any resource

iqbiz commented 2 years ago

a very very very humble request to share the resource. I need it. If i get this atleast i will earn little for my kids. Please help me in that.

iqbiz commented 2 years ago

I sent the stuck transaction This is a bit complicated. Make sure you follow the steps exactly.

On the Transactions tab, right click the stuck transaction and choose "copy transaction ID". Paste to a text editor in order to save the value somewhere. We'll call this value STUCK_TX. Once you've saved STUCK_TX somewhere, right click the stuck transaction again and choose "copy raw transaction"; we'll call this value STUCK_RAWTX. Go to Help -> Debug Window -> Console tab. Type decoderawtransaction STUCK_RAWTX. Under "vin" (near the top), find the first "txid" label. Copy the txid next to the "txid" label, and call this STUCK_VIN. You need to temporarily break connectivity. Go to Settings -> Options -> Network Tab. Enable "Connect through SOCKS5 proxy (default proxy)". Change "Proxy IP" and "port" to something that won't actually work; for example, an IP of 127.0.0.1 and a port of 10 is very unlikely to work. If you already have a proxy set up, note down your current settings so that you can restore them later. Shut down Bitcoin Core. Go to your Data directory and delete the file mempool.dat. This stops it acting as a cache and reloading your transaction. Start Bitcoin Core with the command-line option -walletbroadcast=0. On Linux, you might be able to just run bitcoin-qt -walletbroadcast=0, depending on how your current startup script works. On Windows: find the shortcut for Bitcoin Core on your desktop or start menu; right click it and choose "properties"; add -walletbroadcast=0 to the end of "target", so for example "C:\Program Files\Bitcoin\bitcoin-qt.exe" would become "C:\Program Files\Bitcoin\bitcoin-qt.exe" -walletbroadcast=0; click "Apply"; use that specific shortcut to start Bitcoin Core. On the Transactions tab, right click the stuck transaction and choose "abandon transaction". Warning: Even though the transaction is listed as abandoned, it can still go through. People have in the past lost money by abandoning a transaction, resending a separate replacement transaction, and then having both transactions go through. The following steps are designed to replace the abandoned transaction in a way which will prevent this sort of double payment from happening. Undo the change which broke connectivity: Go to Settings -> Options -> Network Tab. Either disable "Connect through SOCKS5 proxy (default proxy)" or restore your previous proxy settings. Restart Bitcoin Core, this time without -walletbroadcast=0. Go to Settings -> Options -> Wallet. Ensure that "enable coin control features" is selected, and click OK. Go to the Send tab. Click the "Inputs..." button. For each entry in the list, right click it and select "copy transaction ID", and paste to a text editor. You have to go through the entire list, and for each entry with a txid matching STUCK_VIN, enable the checkbox on the far left. Usually there is only one matching, but if there is more than one, then you have to enable all of them. It is very important that you get this step right. In addition to the coins selected in the previous step, which are required, you can select more coins on the Coin Selection dialog if needed. You are creating a transaction that will replace your stuck transaction, so you need to bring "Amount" at the top high enough to send the transaction again, plus fees. Try to select as few as possible, though. Once enough coins are selected, press OK. (Optional, makes your new fee more accurate.) In the "Coin Control Features" pane, call the value for "Bytes" NEWTX_BYTES. Referring back to the fee estimation steps in the first section of this page: Set NEWTX_SIZE to be TOTAL_SIZE - STUCK_SIZE + NEWTX_BYTES, where TOTAL_SIZE and STUCK_SIZE were defined back in that section. Do the estimated fee calculation using this NEWTX_SIZE. Duplicate all of the settings of the stuck transaction, except for the fee. Instead of using the "recommended" fee, choose custom -> total at least, and then use the amount indicated in this page's fee estimation section. Note that under normal circumstances you should almost always use either the recommended fee or a per-kilobyte custom fee, not "total at least"; this situation is a special case. Send the transaction. Either the new transaction or the old transaction should get confirmed (probably the new transaction), but not both if you did the coin control stuff correctly above. Sometimes these transactions don't propagate well, since they sometimes look like double-spend attempts. To improve this, find your new transaction in the list of transactions. Right click it and select "copy raw transaction". Google "Bitcoin pushtx" to find several sites where you can paste this raw transaction to improve propagation. I received the stuck transaction In the previous section on choosing an appropriate new fee, you can optionally set NEWTX_SIZE to 193 in order to pay a lower fee.

This is a bit complicated. Make sure you follow the steps exactly.

Generate a new address in the same wallet. We'll call this NEW_ADDR. On the Transactions tab, right click the stuck transaction and choose "copy transaction ID". Paste to a text editor in order to save the value somewhere. We'll call this value STUCK_TX. Go to Help -> Debug Window -> Console tab. Type gettransaction STUCK_TX. We are going to collect several pieces of data from the output. First, looking at the "details" section, double-check that this actually is the stuck transaction that you're thinking of; if you accidentally selected the wrong transaction, you could lose BTC. Under "details", call the number next to "vout" STUCK_VOUT; call the number next to "amount" STUCK_AMOUNT. When copying values, do not include quotes. From STUCK_AMOUNT, subtract the total fee which you calculated in the first section on this page. Call this number NEW_AMOUNT. For example, if the stuck transaction sends you 1 BTC and you need to add a fee of 0.001 BTC, NEW_AMOUNT is 0.999. Type createrawtransaction '[{"txid":"STUCK_TX","vout":STUCK_VOUT}]' '{"NEW_ADDR":NEW_AMOUNT}'. Note that you must make four substitutions in this command using variables defined previously. When doing so, do not tamper with the quotes; just replace the variable name such as STUCK_TX with the data. Important: If you do not use the correct value for NEW_AMOUNT as previously described, then you could massively overpay the fee. NEW_AMOUNT should be pretty close to the amount of the stuck transaction. (This step is for double-checking only, but should not be skipped.) Call the output of the previous command NEW_RAWTX. Type decoderawtransaction NEW_RAWTX. Under "vout", check that "value" is equal to NEW_AMOUNT and "addresses" is equal to NEW_ADDR. Double-check that NEW_AMOUNT is not tons less than STUCK_AMOUNT. Type signrawtransaction NEW_RAWTX. In the output, copy the data between quotes right after "hex". Don't copy the quotes themselves, just what's in between them. Call this NEW_RAWTX_SIGNED. Type sendrawtransaction NEW_RAWTX_SIGNED. If you get an error, discard your signed transaction (which may be dangerous) and get help from an expert. Electrum As of 2.7.18.

I sent the stuck transaction If you enabled "Replaceable" when sending the transaction, find the stuck transaction in the History list, right click it, and choose "Increase fee". Electrum will guide you through it.

If you did not enable "Replaceable" when sending the transaction:

Redo "choosing an appropriate new fee" above using a NEWTX_SIZE of 500. Create a new address in the same wallet (or a different one, if you want); call this NEW_ADDR. In your transaction history, right click the stuck transaction and select details. Under "Outputs", one of the addresses will usually be highlighted. Copy this address and call it CHANGE_ADDR. If none of the addresses are highlighted, then stop here: you can't use this method. Exit the details dialog and go to the "Coins" tab. Find the coin matching the address found above. Right click it and choose "Spend". If this coin has very low value, less than what you need to pay in the new fee, then ctrl-click other coins before clicking "spend" in order to add more value. Send a transaction to NEW_ADDR (ie. a transaction to yourself) with the new, higher fee. The amount of the transaction doesn't actually matter, but for fee efficiency, it's best to spend all of the BTC associated with CHANGE_ADDR minus the fee.

iqbiz commented 2 years ago

please help me this is workable?

chill117 commented 2 years ago

Again, this is not something I have the time to help you with. Please do your own research and experimentation to achieve whatever it is that you are attempting.

iqbiz commented 2 years ago

okay bosss. thanks

harryqt commented 2 years ago

@iqbiz typical indian spotted.. not trying to be racist. But please dude stop begging for everything, you're the reason I hate to call my self indian.