Bitcoin Forum
September 24, 2018, 08:41:09 AM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: can i just send transaction to peers without adding it in my mempool ?  (Read 1196 times)
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 15, 2017, 04:59:54 PM
 #1

is this possible ?

i think not, but i need confirmation.

i have created a raw transaction and i have tx in hex.
can i push the tx hex to other peers without adding it in my mempool ?

but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.

something like this.

 but i need more details.

i am planning to create tx and just feed it to the peers. if that is possible.

thanks
 

Make a difference with your Ether.
Donate Ether for the greater good.
SPRING.WETRUST.IO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537778469
Hero Member
*
Offline Offline

Posts: 1537778469

View Profile Personal Message (Offline)

Ignore
1537778469
Reply with quote  #2

1537778469
Report to moderator
1537778469
Hero Member
*
Offline Offline

Posts: 1537778469

View Profile Personal Message (Offline)

Ignore
1537778469
Reply with quote  #2

1537778469
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1654


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
September 15, 2017, 05:05:00 PM
 #2

You can't do that in Bitcoin Core. However there are other tools and software that allow you to broadcast a transaction. You can use submittx to do this: https://github.com/laanwj/bitcoin-submittx

btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 15, 2017, 05:19:11 PM
 #3

You can't do that in Bitcoin Core. However there are other tools and software that allow you to broadcast a transaction. You can use submittx to do this: https://github.com/laanwj/bitcoin-submittx

i am confused here.,

how can nodes accept full tx ?
doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ?

i am checking that python code now.

thanks

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1654


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
September 15, 2017, 05:31:30 PM
 #4

i am confused here.,

how can nodes accept full tx ?
doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ?

i am checking that python code now.

thanks
A node can and will accept an unsolicited transaction, i.e. it will receive and handle a transaction that was not announced to it with an inv message. There is no need to send an inv message to announce the txid first, just that it is more efficient to do so instead of just sending a tx.

btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 15, 2017, 05:38:24 PM
 #5

i am confused here.,

how can nodes accept full tx ?
doesnt protocol says, it sends hash only at first and upon asking, its sends full tx ?

i am checking that python code now.

thanks
A node can and will accept an unsolicited transaction, i.e. it will receive and handle a transaction that was not announced to it with an inv message. There is no need to send an inv message to announce the txid first, just that it is more efficient to do so instead of just sending a tx.

it means, i can push tx directly, instead of sending hash and waiting for it to reply.

damn.,

if its not too much to ask, can you direct me to code, which sends tx directly. to peers. ? from bitcoin- core src.

so far i have found this .

Code:
static void RelayTransaction(const CTransaction& tx, CConnman& connman)
{
    CInv inv(MSG_TX, tx.GetHash());
    connman.ForEachNode([&inv](CNode* pnode)
    {
        pnode->PushInventory(inv);
    });
}


but it send hash first.

thanks

-------------------------------------------------------------------------------------------------

edit1 :

Code:
    void PushInventory(const CInv& inv)
    {
        LOCK(cs_inventory);
        if (inv.type == MSG_TX) {
            if (!filterInventoryKnown.contains(inv.hash)) {
                setInventoryTxToSend.insert(inv.hash);
            }
        } else if (inv.type == MSG_BLOCK) {
            vInventoryBlockToSend.push_back(inv.hash);
        }
    }

so its sending hash, now looking in to NetMsgType

achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1654


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
September 15, 2017, 05:57:27 PM
 #6

Just because Bitcoin Core does not do it doesn't mean that it is not allowed on the network. Just look at how NetMsgType::TX is handled: https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L1762. Nowhere in that does it require it to have received an inv with the txid. The inv with the txid is only there to avoid sending txs to peers that don't need them and thus save on bandwidth.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
September 15, 2017, 07:11:02 PM
 #7

is this possible ?

Yes.

i think not,

Why do you think that?

but i need confirmation.

I can confirm that you are incorrect.

i have created a raw transaction and i have tx in hex.
can i push the tx hex to other peers without adding it in my mempool ?

You already asked this at the beginning of your post.  Why are you asking the same question twice?

but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.

something like this.

Wait, is this a question about how the Bitcoin Core software operates, or is this a question about what is technically possible?

but i need more details.

i am planning to create tx and just feed it to the peers. if that is possible.

It is, as long as you use the proper communication protocol when communicating with those peers.

aleksej996
Sr. Member
****
Offline Offline

Activity: 406
Merit: 301


Do not trust the government


View Profile WWW
September 15, 2017, 11:12:49 PM
 #8

You can just use a website like this https://blockchain.info/pushtx

Pop it in and click the button. This will push the transaction to all the peers of the network, if it is a valid transaction of course.

░░░░░░░▄▄▄▄▄▄
░░░░▄██████████▄
░░░██████████████
░░██████▐▌██████
█████░░░░░░░▀█████
██████▄▄░░▄▄░░██████
████████░░▀▀▄██████
████████░░▄▄▄░░█████
██████▀▀░░▀▀▀░░█████
█████░░░░░░░░█████
░░██████▐▌██████
░░░██████████████
░░░░▀██████████▀
░░░░░░░▀▀▀▀▀▀
░░░

                   BitCloak Bitcoin Mixer  
  BTC & BCH | API| MULTIADDRESS| PGP PROOF|  FAST MIX |  ESCROW|  MORE !

░░░░░░░▄▄▄▄▄▄
░░░░▄██████████▄
░░░██████████████
░░██████▐▌██████
█████░░░░░░░▀█████
██████▄▄░░▄▄░░██████
████████░░▀▀▄██████
████████░░▄▄▄░░█████
██████▀▀░░▀▀▀░░█████
█████░░░░░░░░█████
░░██████▐▌██████
░░░██████████████
░░░░▀██████████▀
░░░░░░░▀▀▀▀▀▀
░░░

Argon2
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 17, 2017, 11:51:22 PM
 #9

is this possible ?

i think not, but i need confirmation.

i have created a raw transaction and i have tx in hex.
can i push the tx hex to other peers without adding it in my mempool ?

but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.

something like this.

 but i need more details.

i am planning to create tx and just feed it to the peers. if that is possible.

thanks
 
Yes. Simply broadcast it in serialized binary format. You will still add it to the mempool once it propagates back to you however. In order to do what you want you need to change the underlying code to ignore your transactions in the mempool.
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 19, 2017, 03:13:09 AM
 #10

is this possible ?

i think not, but i need confirmation.

i have created a raw transaction and i have tx in hex.
can i push the tx hex to other peers without adding it in my mempool ?

but as per the bitcoin core source on , we only send tx hash hex, to peers , and if they dont have it, then we send full tx hex.

something like this.

 but i need more details.

i am planning to create tx and just feed it to the peers. if that is possible.

thanks
 
Yes. Simply broadcast it in serialized binary format. You will still add it to the mempool once it propagates back to you however. In order to do what you want you need to change the underlying code to ignore your transactions in the mempool.

so it will be like relay node., just relaying tx to other nodes.

-------------------------------------------------------------------------------



btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 19, 2017, 03:14:04 AM
 #11

You can't do that in Bitcoin Core. However there are other tools and software that allow you to broadcast a transaction. You can use submittx to do this: https://github.com/laanwj/bitcoin-submittx

i tried this., and its working as expected.,

thanks

--------------------------------------------------------------------------------------------------------

edit 1 :

looks like it also says inv message before and wait for the reply and then push tx.


achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1526
Merit: 1654


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
September 19, 2017, 03:52:46 AM
 #12

looks like it also says inv message before and wait for the reply and then push tx.
You never specified that that was what you wanted when you made this thread until after I posted that link.

Bitcoinj is an example of something that broadcasts transactions without an inv: https://github.com/bitcoinj/bitcoinj/blob/a7cad0ede447d4bcba7dd55639df442a408df6fb/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java#L152

btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 19, 2017, 05:26:34 AM
 #13

looks like it also says inv message before and wait for the reply and then push tx.
You never specified that that was what you wanted when you made this thread until after I posted that link.

Bitcoinj is an example of something that broadcasts transactions without an inv: https://github.com/bitcoinj/bitcoinj/blob/a7cad0ede447d4bcba7dd55639df442a408df6fb/core/src/main/java/org/bitcoinj/core/TransactionBroadcast.java#L152

sorry , i must have missed that, and my english isnt very good, so sometimes, i miss some things from very long sentences.

thanks, looking in to it.

i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible,

amaclin1
Full Member
***
Offline Offline

Activity: 434
Merit: 208


View Profile
September 19, 2017, 06:34:57 AM
 #14

i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible,

The tool you are looking for Smiley
Just put your list in config file and run executable with a tx in hex as parameter
https://cloud.mail.ru/public/2rUa/zgcW6vf8g
(sources included)
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 19, 2017, 11:53:56 AM
 #15

i wanted just to force feed my whole tx to peers of my choice, i mean i have list of peers, and i wanted to force feed them my newly created tx, as quick as possible,

The tool you are looking for Smiley
Just put your list in config file and run executable with a tx in hex as parameter
https://cloud.mail.ru/public/2rUa/zgcW6vf8g
(sources included)


Thank you, building it in linux.


amaclin1
Full Member
***
Offline Offline

Activity: 434
Merit: 208


View Profile
September 19, 2017, 12:00:05 PM
 #16

Thank you, building it in linux.
It requires OpenSSL for ::SHA256() method
You have to slighly modify project file, because the windows path is hardcoded there
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 23, 2017, 06:48:11 AM
 #17

Thank you, building it in linux.
It requires OpenSSL for ::SHA256() method
You have to slighly modify project file, because the windows path is hardcoded there

i have build it in linux, no errros, no warnings ., using

qmake-qt5
make

but its not broadcasting tx to the nodes.
any clue ?

thanks


i am now trying it on windows.

amaclin1
Full Member
***
Offline Offline

Activity: 434
Merit: 208


View Profile
September 23, 2017, 07:00:24 AM
 #18

but its not broadcasting tx to the nodes.
any clue ?
thanks
i am now trying it on windows.

This is not "production tool". I created it for myself and it runs ok on windows.
Do you have the config file (with a list of ip) located in current directory?
What is the output of PushTxTool when you run it?
Do you pass the transaction hex as an argument?
btctousd81
Sr. Member
****
Offline Offline

Activity: 392
Merit: 252


View Profile WWW
September 23, 2017, 11:34:31 AM
 #19

but its not broadcasting tx to the nodes.
any clue ?
thanks
i am now trying it on windows.

This is not "production tool". I created it for myself and it runs ok on windows.
Do you have the config file (with a list of ip) located in current directory?
What is the output of PushTxTool when you run it?
Do you pass the transaction hex as an argument?

in windows.,
its braocasting tx and giving.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.


but i cant able to compile it., what are you using ? i mean platform ? compiler ? linking libraries ?

thanks

amaclin1
Full Member
***
Offline Offline

Activity: 434
Merit: 208


View Profile
September 23, 2017, 11:45:22 AM
 #20

in windows.,
its braocasting tx and giving.

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Can you send me a screenshot in PM?

Quote
but i cant able to compile it., what are you using ? i mean platform ? compiler ? linking libraries ?
a) Qt/C++ (very old version)
b) OpenSSL  (very old version) for ::SHA256() method

In fact there are only ~200 lines of code there. Isn't it easy to rewrite the code
to make your own tool based on my concept?
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!