Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: btctousd81 on September 15, 2017, 04:59:54 PM



Title: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 15, 2017, 04:59:54 PM
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
 


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: achow101 on September 15, 2017, 05:05:00 PM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 15, 2017, 05:19:11 PM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: achow101 on September 15, 2017, 05:31:30 PM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 15, 2017, 05:38:24 PM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: achow101 on September 15, 2017, 05:57:27 PM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: DannyHamilton on September 15, 2017, 07:11:02 PM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: aleksej996 on September 15, 2017, 11:12:49 PM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: Argon2 on September 17, 2017, 11:51:22 PM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 19, 2017, 03:13:09 AM
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.

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




Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 19, 2017, 03:14:04 AM
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.



Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: achow101 on September 19, 2017, 03:52:46 AM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 19, 2017, 05:26:34 AM
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,


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: amaclin1 on September 19, 2017, 06:34:57 AM
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 :)
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)


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 19, 2017, 11:53:56 AM
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 :)
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.



Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: amaclin1 on September 19, 2017, 12:00:05 PM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 23, 2017, 06:48:11 AM
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.


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: amaclin1 on September 23, 2017, 07:00:24 AM
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?


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 23, 2017, 11:34:31 AM
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


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: amaclin1 on September 23, 2017, 11:45:22 AM
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?


Title: Re: can i just send transaction to peers without adding it in my mempool ?
Post by: btctousd81 on September 23, 2017, 04:10:33 PM
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?

i have sent you pm.

and yes, i am working on re writing code.,
will see how it goes.