Bitcoin Forum
April 19, 2024, 07:41:10 PM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: can i just send transaction to peers without adding it in my mempool ?  (Read 1281 times)
btctousd81 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


View Profile WWW
September 15, 2017, 04:59:54 PM
Merited by ABCbits (1)
 #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
 

1713555670
Hero Member
*
Offline Offline

Posts: 1713555670

View Profile Personal Message (Offline)

Ignore
1713555670
Reply with quote  #2

1713555670
Report to moderator
1713555670
Hero Member
*
Offline Offline

Posts: 1713555670

View Profile Personal Message (Offline)

Ignore
1713555670
Reply with quote  #2

1713555670
Report to moderator
"Your bitcoin is secured in a way that is physically impossible for others to access, no matter for what reason, no matter how good the excuse, no matter a majority of miners, no matter what." -- Greg Maxwell
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3374
Merit: 6511


Just writing some code


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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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: 3374
Merit: 6511


Just writing some code


View Profile WWW
September 15, 2017, 05:31:30 PM
Merited by ABCbits (1)
 #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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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: 3374
Merit: 6511


Just writing some code


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: 3360
Merit: 4570



View Profile
September 15, 2017, 07:11:02 PM
Merited by ABCbits (1)
 #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: 490
Merit: 389


Do not trust the government


View Profile
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.
Argon2
Full Member
***
Offline Offline

Activity: 140
Merit: 101


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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


View Profile WWW
September 19, 2017, 03:14:04 AM
Last edit: September 19, 2017, 03:33:59 AM by btctousd81
 #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: 3374
Merit: 6511


Just writing some code


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 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


View Profile WWW
September 19, 2017, 05:26:34 AM
Last edit: September 19, 2017, 05:49:27 AM by btctousd81
 #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
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


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)

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
btctousd81 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


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

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
btctousd81 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


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?

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
btctousd81 (OP)
Sr. Member
****
Offline Offline

Activity: 434
Merit: 270


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
Sr. Member
****
Offline Offline

Activity: 770
Merit: 305


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?

Bitcoin SV GUI client for Windows and Linux
https://github.com/AlisterMaclin/bitcoin-sv/releases
Pages: [1] 2 »  All
  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!