Bitcoin Forum
May 05, 2024, 03:10:09 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to convey transaction to network  (Read 1963 times)
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
April 30, 2015, 05:05:13 PM
 #1

I have a most perfectly formed transaction ready to go.  What is the easiest way to transmit it into the bitcoin network for processing? 

I don't want to set up and run bitcoind on a local machine.  Too much agro.  Is there a trusted node with a permanent IP which I can send (via some protocol) the bytes to?  What is the minimum handshaking that must be done to establish a connection to this node with a know IP.  Is there an easier way?  Does blockchain.info support that?
1714878609
Hero Member
*
Offline Offline

Posts: 1714878609

View Profile Personal Message (Offline)

Ignore
1714878609
Reply with quote  #2

1714878609
Report to moderator
Transactions must be included in a block to be properly completed. When you send a transaction, it is broadcast to miners. Miners can then optionally include it in their next blocks. Miners will be more inclined to include your transaction if it has a higher transaction fee.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714878609
Hero Member
*
Offline Offline

Posts: 1714878609

View Profile Personal Message (Offline)

Ignore
1714878609
Reply with quote  #2

1714878609
Report to moderator
virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 507


LOTEO


View Profile
April 30, 2015, 05:08:31 PM
 #2

I have a most perfectly formed transaction ready to go.  What is the easiest way to transmit it into the bitcoin network for processing? 

I don't want to set up and run bitcoind on a local machine.  Too much agro.  Is there a trusted node with a permanent IP which I can send (via some protocol) the bytes to?  What is the minimum handshaking that must be done to establish a connection to this node with a know IP.  Is there an easier way?  Does blockchain.info support that?

You can use a thin client library for that, have a look at pybitcoinlib. Transactions can be pushed using blockchain.info or an exchange.


...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 266


View Profile
April 30, 2015, 05:20:48 PM
Merited by ABCbits (5)
 #3

Substitute the tx hex for your own, and this is good to go. I haven't used it over the CLI before, it will reject transactions sometimes, so watch out for that. It sometimes states there is a problem with the transaction, but it gets broadcast anyway.

curl -X POST -d tx=010000000158891e8f28100642464417f53845c3953a43e31b35d061bdbf6ca3a64fffabb8000000008c493046022100a9d501a6f59c45a24e65e5030903cfd80ba33910f24d6a505961d64fa5042b4f02210089fa7cc00ab2b5fc15499fa259a057e6d0911d4e849f1720cc6bc58e941fe7e20141041a2756dd506e45a1142c7f7f03ae9d3d9954f8543f4c3ca56f025df66f1afcba6086cec8d4135cbb5f5f1d731f25ba0884fc06945c9bbf69b9b543ca91866e79ffffffff01204e0000000000001976a914d04b020dab70a7dd7055db3bbc70d27c1b25a99c88ac00000000 https://blockchain.info/pushtx

Otherwise, you might be able to do something similar for this form: https://insight.bitpay.com/tx/send

There are probably several of these insight servers around, some googling might help you have some redundancy for broadcasting.

Bitwasp Developer.
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1076


I may write code in exchange for bitcoins.


View Profile
April 30, 2015, 05:27:45 PM
 #4

I have a most perfectly formed transaction ready to go.  What is the easiest way to transmit it into the bitcoin network for processing?  

I don't want to set up and run bitcoind on a local machine.  Too much agro.  Is there a trusted node with a permanent IP which I can send (via some protocol) the bytes to?  What is the minimum handshaking that must be done to establish a connection to this node with a know IP.  Is there an easier way?  Does blockchain.info support that?

You can use a thin client library for that, have a look at pybitcoinlib. Transactions can be pushed using blockchain.info or an exchange.


I poked around a bit in that library, I see where in an example "import socket" is used to send to a local IP.  I guess socket uses TCP for the connection.  However, like the OP, I'd also be interested in knowing if it's possible to connect in this way to any particular full node.  

@OP, the blockchain tool to accept a raw transaction over HTTP is here: https://blockchain.info/pushtx
samson
Legendary
*
Offline Offline

Activity: 2097
Merit: 1068


View Profile
April 30, 2015, 09:26:17 PM
 #5

Someone wrote a blog entry which covers this - scroll down a little and there's a python script to do it.

http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
May 01, 2015, 10:29:23 AM
Last edit: May 01, 2015, 11:21:36 AM by TKeenan
 #6

@OP, the blockchain tool to accept a raw transaction over HTTP is here: https://blockchain.info/pushtx

Hmm, that's seems cool.  

However, I can't get this one to publish.  Any idea what's up?

010000000128442f044ac462554b880776d3e2e33794e6fec7c1f01ee9e7e82ae66534034300000 0
006a47304402203fe2ee295c4c27b6d2d90e5aeaa83b651d2ad729d99b57fb292d4ea4e07a1d690 2
201265c12ec5bbe379c973c358738a07ee369e9237dd600ad07b7db41729b8457d012103611dc2a 5
7e244ab48a6d1b9bbb8958a0743c002d141def726cd2d2732dd01561ffffffff03c027090000000 0
001976a914c5760f778c8d2fcd0f7e8aa1a163ca8089c9fe9488ac309c3800000000001976a9140 c
c3ed93022d209d7907939a5be757db143e568c88ac0000000000000000266a24313337352054686 f
6d61732053742e2053616e2052616661656c2c20434120393230363700000000


I have a most perfectly formed transaction ready to go.
Maybe not! Wink
TheButterZone
Legendary
*
Offline Offline

Activity: 3052
Merit: 1031


RIP Mommy


View Profile WWW
May 01, 2015, 07:03:16 PM
 #7

010000000128442f044ac462554b880776d3e2e33794e6fec7c1f01ee9e7e82ae66534034300000 0
006a47304402203fe2ee295c4c27b6d2d90e5aeaa83b651d2ad729d99b57fb292d4ea4e07a1d690 2
201265c12ec5bbe379c973c358738a07ee369e9237dd600ad07b7db41729b8457d012103611dc2a 5
7e244ab48a6d1b9bbb8958a0743c002d141def726cd2d2732dd01561ffffffff03c027090000000 0
001976a914c5760f778c8d2fcd0f7e8aa1a163ca8089c9fe9488ac309c3800000000001976a9140 c
c3ed93022d209d7907939a5be757db143e568c88ac0000000000000000266a24313337352054686 f
6d61732053742e2053616e2052616661656c2c20434120393230363700000000

Need to remove all spaces and carriage returns from that hex so that it is an unbroken string of characters, then it's valid. I just broadcasted it via Electrum.

Saying that you don't trust someone because of their behavior is completely valid.
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
May 02, 2015, 06:05:00 AM
Last edit: May 02, 2015, 08:23:13 AM by TKeenan
 #8

010000000128442f044ac462554b880776d3e2e33794e6fec7c1f01ee9e7e82ae66534034300000 0
006a47304402203fe2ee295c4c27b6d2d90e5aeaa83b651d2ad729d99b57fb292d4ea4e07a1d690 2
201265c12ec5bbe379c973c358738a07ee369e9237dd600ad07b7db41729b8457d012103611dc2a 5
7e244ab48a6d1b9bbb8958a0743c002d141def726cd2d2732dd01561ffffffff03c027090000000 0
001976a914c5760f778c8d2fcd0f7e8aa1a163ca8089c9fe9488ac309c3800000000001976a9140 c
c3ed93022d209d7907939a5be757db143e568c88ac0000000000000000266a24313337352054686 f
6d61732053742e2053616e2052616661656c2c20434120393230363700000000

Need to remove all spaces and carriage returns from that hex so that it is an unbroken string of characters, then it's valid. I just broadcasted it via Electrum.
Nice!  Thanks very much for that.  Smiley

OOPs, bad news.  Blockchain.info blocks transactions with an OP_Return as 'non standard transactions' - https://blockchain.info/rejected .  Is there a better API to push transactions into?

TheButterZone
Legendary
*
Offline Offline

Activity: 3052
Merit: 1031


RIP Mommy


View Profile WWW
May 02, 2015, 09:10:57 AM
 #9

You could try http://eligius.st/~wizkid057/newstats/pushtxn.php

Saying that you don't trust someone because of their behavior is completely valid.
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
May 02, 2015, 10:30:46 AM
 #10

Yeah, I don't know how to write the WebRequest object in .Net to send to the push URL at blockr.  Having trouble with the encoding and stuff. 

Blockchain.info has a sweet API for .Net - but then they go and block OP_Return.  Why do they block OP_Return?  That is totally stupid.  Does any other blockchain API providers have a nice .Net code on GitHub? 

Holy shit this is hard.
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 506


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
May 03, 2015, 06:26:52 AM
 #11

https://en.bitcoin.it/wiki/Transaction_broadcasting

https://bitcointalk.org/index.php?topic=902674.0

https://bitcointalk.org/index.php?topic=496249.0

tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1076


I may write code in exchange for bitcoins.


View Profile
May 04, 2015, 04:12:57 PM
 #12

Yeah, I don't know how to write the WebRequest object in .Net to send to the push URL at blockr.  Having trouble with the encoding and stuff. 

Blockchain.info has a sweet API for .Net - but then they go and block OP_Return.  Why do they block OP_Return?  That is totally stupid.  Does any other blockchain API providers have a nice .Net code on GitHub? 

Holy shit this is hard.

I don't understand what .NET has to do with it.  If you're using that blockchain API, can't you just use HTTP POST.  Programming language shouldn't matter should it?
virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 507


LOTEO


View Profile
May 04, 2015, 08:49:38 PM
 #13

Yeah, I don't know how to write the WebRequest object in .Net to send to the push URL at blockr.  Having trouble with the encoding and stuff. 

Blockchain.info has a sweet API for .Net - but then they go and block OP_Return.  Why do they block OP_Return?  That is totally stupid.  Does any other blockchain API providers have a nice .Net code on GitHub? 

Holy shit this is hard.

I don't understand what .NET has to do with it.  If you're using that blockchain API, can't you just use HTTP POST.  Programming language shouldn't matter should it?

It should work with any language that can do HTTP POST including very low level programming languages. I think .NET is ops preferred language.

...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
May 06, 2015, 09:49:13 AM
 #14

It should work with any language that can do HTTP POST including very low level programming languages. I think .NET is ops preferred language.

Yep.  Exactly.  But could somebody post an example of an HTTP POST in .Net that sends a transaction into a node (the network) - (which node?) (a permanent known node?). 

Please post some code which does this if you can.
InceptionCoin
Member
**
Offline Offline

Activity: 108
Merit: 10


View Profile
May 06, 2015, 02:19:14 PM
 #15

OOPs, bad news.  Blockchain.info blocks transactions with an OP_Return as 'non standard transactions' - https://blockchain.info/rejected .  Is there a better API to push transactions into?
Standard node doesn't relay non-standard tx. So it never reaches mining pool. So you need to push into directly to pull, as TheButterZone sad before eligius pool allows it.

Skilled C++ and Python programmer. Looking around to create solid longterm coin by myself. Do you have any ideas? Feel free to PM me.
TKeenan (OP)
Hero Member
*****
Offline Offline

Activity: 874
Merit: 1000



View Profile
May 06, 2015, 02:46:14 PM
 #16

OOPs, bad news.  Blockchain.info blocks transactions with an OP_Return as 'non standard transactions' - https://blockchain.info/rejected .  Is there a better API to push transactions into?
Standard node doesn't relay non-standard tx. So it never reaches mining pool. So you need to push into directly to pull, as TheButterZone sad before eligius pool allows it.
When will 80byte OP_Return become standard?
tspacepilot
Legendary
*
Offline Offline

Activity: 1456
Merit: 1076


I may write code in exchange for bitcoins.


View Profile
May 06, 2015, 05:54:32 PM
 #17

It should work with any language that can do HTTP POST including very low level programming languages. I think .NET is ops preferred language.

Yep.  Exactly.  But could somebody post an example of an HTTP POST in .Net that sends a transaction into a node (the network) - (which node?) (a permanent known node?). 

Please post some code which does this if you can.

Sorry, I don't know anything about .NET, but almost every language I've worked with has some sort of system("systemcommandhere") call.  Why not just use .NET's version of system() and then the classic curl binary:

$ curl -X POST --data "foo=bar&baz=quux" URL
unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1005


View Profile
May 06, 2015, 06:17:35 PM
 #18

Easiest way? You've answered yourself, yes, Blockchain can do that https://blockchain.info/pushtx

You can also just use Electrum... or Armory if you have it. You can also push it here https://btc.blockr.io/tx/push. Also here https://brainwallet.org/#tx
virtualx
Hero Member
*****
Offline Offline

Activity: 672
Merit: 507


LOTEO


View Profile
May 06, 2015, 09:05:20 PM
 #19

It should work with any language that can do HTTP POST including very low level programming languages. I think .NET is ops preferred language.

Yep.  Exactly.  But could somebody post an example of an HTTP POST in .Net that sends a transaction into a node (the network) - (which node?) (a permanent known node?). 

Please post some code which does this if you can.

Sorry, I don't know anything about .NET, but almost every language I've worked with has some sort of system("systemcommandhere") call.  Why not just use .NET's version of system() and then the classic curl binary:

$ curl -X POST --data "foo=bar&baz=quux" URL

HTTP post with command line is probably the easiest method. He could use a wrapper for a HTTP client request or execute a system call. I don't think Windows comes with a copy of curl but there are windows ports of curl.

He can use something like this:

Code:
ProcessStartInfo transaction = new ProcessStartInfo ("curl.exe .....", "parameters"); 
Process.Start (transaction);

...loteo...
DIGITAL ERA LOTTERY


r

▄▄███████████▄▄
▄███████████████████▄
▄███████████████████████▄
▄██████████████████████████▄
▄██  ███████▌ ▐██████████████▄
▐██▌ ▐█▀  ▀█    ▐█▀   ▀██▀  ▀██▌
▐██  █▌ █▌ ██  ██▌ ██▌ █▌ █▌ ██▌
▐█▌ ▐█ ▐█ ▐█▌ ▐██  ▄▄▄██ ▐█ ▐██▌
▐█  ██▄  ▄██    █▄    ██▄  ▄███▌
▀████████████████████████████▀
▀██████████████████████████▀
▀███████████████████████▀
▀███████████████████▀
▀▀███████████▀▀
r

RPLAY NOWR
BE A MOON VISITOR!
[/center]
InceptionCoin
Member
**
Offline Offline

Activity: 108
Merit: 10


View Profile
May 15, 2015, 12:40:49 PM
 #20

OOPs, bad news.  Blockchain.info blocks transactions with an OP_Return as 'non standard transactions' - https://blockchain.info/rejected .  Is there a better API to push transactions into?
Standard node doesn't relay non-standard tx. So it never reaches mining pool. So you need to push into directly to pull, as TheButterZone sad before eligius pool allows it.
When will 80byte OP_Return become standard?
Here https://github.com/bitcoin/bitcoin/blob/f0043c2d6d2ceddd631a76b424dd8c163f3dad66/src/main.cpp#L885 bitcoin-core prohibits to accept to memory(and eventually to relay) non-standart txs unless it explicitly setted in params. I dont know are txs with OP_Return non-standart now, but if so they will not be relayed by bitcoin-core standart wallet.

Skilled C++ and Python programmer. Looking around to create solid longterm coin by myself. Do you have any ideas? Feel free to PM me.
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!