Bitcoin Forum
November 15, 2024, 02:42:32 AM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to send an invalid transaction for testing purposes?  (Read 1410 times)
Geremia (OP)
Sr. Member
****
Offline Offline

Activity: 507
Merit: 253


View Profile WWW
July 24, 2015, 03:22:38 AM
 #1

How could I send an invalid transaction—for testing purposes, such as with testnet or regtest?

For example, I would like to to try to double-spend, spend non existent coins, etc.

(cf. the related Bitcoin StackExchange question.)

BTC tip jar | my BTC wiki, BTC StackExchange | Tox ID: 65C3E8810738AD9D175234808FCB317A1103632903436203D45411AE97C03F54C34861AB6663
Join Kraken. | The best, free book on Bitcoin: Mastering Bitcoin
Nos cum prole pia benedicat Virgo Maria.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
July 24, 2015, 05:27:08 AM
 #2

How could I send an invalid transaction—for testing purposes, such as with testnet or regtest?

For example, I would like to to try to double-spend, spend non existent coins, etc.

(cf. the related Bitcoin StackExchange question.)

Send it where?

Send it from where?

Most node and peer software will prevent the sending or relaying of invalid transactions, therefore you would need to write (or modify) your own node program to allow you to even attempt such a thing.  Then, if you wanted some software to accept the transaction and not simply disconnect and block your custom node, then you would need to write and run your own custom peer to connect to.  At that point you will essentially have created your own altcoin network since nearly every node on the bitcoin network will refuse to communicate with any of your peers once they start receiving invalid transactions from your nodes.
g3rszpi
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


View Profile
July 24, 2015, 07:14:23 AM
 #3

How could I send an invalid transaction—for testing purposes, such as with testnet or regtest?

For example, I would like to to try to double-spend, spend non existent coins, etc.

(cf. the related Bitcoin StackExchange question.)
Yeah, sure . For testing purposes Cheesy
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
July 24, 2015, 01:49:53 PM
Merited by ABCbits (2)
 #4

How could I send an invalid transaction—for testing purposes, such as with testnet or regtest?

For example, I would like to to try to double-spend, spend non existent coins, etc.

(cf. the related Bitcoin StackExchange question.)

A double spend requires you "only" to send a TX with bitcoin core, close it, use pywallet to remove the TX from the wallet.dat, start bitcoin core again and create another TX that spends the exact same input. However - as Danny has noted - this TX will not get accepted by other nodes that already know about the 1st TX - by the time you are done with pywallet close to all nodes - and if you send it to often you will end up on their ban list.

On SE someone suggest you may use createrawtransaction which is correct as it does not require the TX to be valid, there are no sanity checks. You can try to broadcast it unsign, but again other nodes will not accept such a thing. Even if you signed a TX that is using inputs you never received (spend coins that do not exist) I doubt your unmodified bitcoin core will allow you to send it, but even if - or if you followed Dannys advice to write your own node - no other node in the network will accept it. If no other node accepts your TX they also dont spread it, thus all you accomplish with this is that you separate your node from the rest of the network as you (slowly) build up your banscore on other nodes.

Tbh I dont see the testing purpose. One fundamental concept of bitcoin is that no node in the network trusts any other node and is checking everything that is communicated. If you try to broadcast something that makes no sense to other nodes you will not get very far. This is no different on testnet or with regtest enabled. If you check your nodes debug.log you can see it dropping TX from time to time because they are not "standard". A non standard TX however might still get confirmed as they are valid, they are just difficult to send to a miner/pool.

This also sounds to me like an XY Problem[1]. What is the actual problem you try to solve here? What do you want to accomplish?

[1] http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem

Im not really here, its just your imagination.
jaydipmodhwadia
Sr. Member
****
Offline Offline

Activity: 322
Merit: 250

Verify my Bitcoin Address before EVERY transaction


View Profile WWW
July 24, 2015, 09:32:28 PM
 #5

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 509


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
July 25, 2015, 07:51:38 AM
 #6

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?

It is not plausible.

Kazimir
Legendary
*
Offline Offline

Activity: 1176
Merit: 1011



View Profile
July 26, 2015, 08:01:11 PM
 #7

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?
This is meaningless bogus, complete and utter nonsense. Same as saying someone wire transferred US Dollars to a Litecoin address. Or emailed some bricks of gold to a gmail address.

In theory, there's no difference between theory and practice. In practice, there is.
Insert coin(s): 1KazimirL9MNcnFnoosGrEkmMsbYLxPPob
TrueBeliever
Member
**
Offline Offline

Activity: 78
Merit: 11


View Profile
July 27, 2015, 02:39:53 AM
 #8

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?
This is meaningless bogus, complete and utter nonsense. Same as saying someone wire transferred US Dollars to a Litecoin address. Or emailed some bricks of gold to a gmail address.

Or someone posted some US quarter coins to store in their Dropbox account.

If someone does manage to send a transaction from the bitcoin blockchain across the ether to the litecoin blockchain I wonder what exchange rate they would get  Tongue

In all seriousness though it is difficult to counter such nonsensical rumors without more specific information or a link to the OP.

██████████    YoBit.net - Cryptocurrency Exchange - Over 350 coins
█████████    <<  ● $$$ - $$$ - $$$ - $$$ - $$$ - $$$ - $$$   >>
██████████    <<  ● Play DICE! Win 1-5 btc just for 5 mins!  >>
Amitabh S
Legendary
*
Offline Offline

Activity: 1001
Merit: 1005


View Profile
July 27, 2015, 02:48:32 AM
 #9

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?


+1. This is absolute nonsense drool that comes from trolling.
This is meaningless bogus, complete and utter nonsense. Same as saying someone wire transferred US Dollars to a Litecoin address. Or emailed some bricks of gold to a gmail address.

Coinsecure referral ID: https://coinsecure.in/signup/refamit (use this link to signup)
shorena
Copper Member
Legendary
*
Offline Offline

Activity: 1498
Merit: 1540


No I dont escrow anymore.


View Profile
July 27, 2015, 08:50:17 AM
Last edit: July 27, 2015, 08:15:52 PM by shorena
 #10

Idk if this has anything to do with what the OP says, but I have heard that someone sent some litecoins to a btc Addy... Would this be of consideration?
This is meaningless bogus, complete and utter nonsense. Same as saying someone wire transferred US Dollars to a Litecoin address. Or emailed some bricks of gold to a gmail address.

Or someone posted some US quarter coins to store in their Dropbox account.

If someone does manage to send a transaction from the bitcoin blockchain across the ether to the litecoin blockchain I wonder what exchange rate they would get  Tongue

In all seriousness though it is difficult to counter such nonsensical rumors without more specific information or a link to the OP.

Yet it still happened. The main problem is that litecoin multisig addresses use the same prefix as bitcoin multisig, thus the address is considered valid on both networks. As they are derived from the same private keys they can still be spend, its just a big mess.

See Dannys post below its more precise and less likely to be understood wrong.

-> https://litecointalk.org/index.php?PHPSESSID=p5vju9t28dhs6hbd7acudemap2&topic=26513.0
-> https://www.reddit.com/r/Bitcoin/comments/24qal5/what_happens_if_i_send_bitcoin_to_a_litecoin/

Im not really here, its just your imagination.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
July 27, 2015, 02:17:16 PM
 #11

Yet it still happened.

Sort of, but not really.

It's not like the litecoins show up in the bitcoin wallet.

The litecoins were sent to a valid litecoin address.  It just so happened that the litecoin address was also a valid bitcoin address and that the litecoin address that the litecoins were sent to was copied from an address that was being published for the purpose of receiving bitcoins.

It's a bit like if there were more than one Danny Hamilton in the world.  If I then asked you to send me something in the mail, and you searched for my name on the internet and got the other Danny Hamilton's address, then you would have been sending the mail to "Danny Hamilton", but not to me.

It isn't possible to send litecoins to a bitcoin address.  It is possible to send litecoins to a litecoin address, and it is also possible for the litecoin address to also be a valid bitcoin address.
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1081


I may write code in exchange for bitcoins.


View Profile
July 28, 2015, 12:19:38 AM
 #12

Yet it still happened.

Sort of, but not really.

It's not like the litecoins show up in the bitcoin wallet.

The litecoins were sent to a valid litecoin address.  It just so happened that the litecoin address was also a valid bitcoin address and that the litecoin address that the litecoins were sent to was copied from an address that was being published for the purpose of receiving bitcoins.

It's a bit like if there were more than one Danny Hamilton in the world.  If I then asked you to send me something in the mail, and you searched for my name on the internet and got the other Danny Hamilton's address, then you would have been sending the mail to "Danny Hamilton", but not to me.

It isn't possible to send litecoins to a bitcoin address.  It is possible to send litecoins to a litecoin address, and it is also possible for the litecoin address to also be a valid bitcoin address.

That's really quite fascinating, still.  I didn't find a link to the original description when reading above.  Danny, was this something that you were playing with?

EDIT: sorry, i see the link in Shorena's post now, following up myself.
Pages: [1]
  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!