Pages:
Author

Topic: Webpage to paste raw tx for broadcast? (Read 9999 times)

member
Activity: 84
Merit: 10
April 02, 2013, 03:06:47 PM
#58
https://blockchain.info/pushtx


is that what you
were looking for?
hero member
Activity: 560
Merit: 500
I am the one who knocks
April 02, 2013, 02:24:14 PM
#57
You can use use the Raw Transaction API now in bitcoind to do this.  Something like:
Code:
bitcoind sendrawtransaction 0011223344....
hero member
Activity: 826
Merit: 500
March 12, 2013, 05:30:54 PM
#56
I've been using something like this to dump raw transactions into the network, feel free to adapt to your language of choice if you want something that runs locally.  I don't have anything like it running on a public web server but it shouldn't be too hard to do.

Code:
#!/usr/bin/perl

use IO::Socket;use IO::Select;use Digest::SHA;

$tx=shift(@ARGV);
$btc=IO::Socket::INET->new(PeerAddr=>"localhost",PeerPort=>'8333',Proto=>'tcp') or die "Socket";
$port="\x20\x8d";$magic="\xf9\xbe\xb4\xd9";$mmatch="f9.be.b4.d9";
$sel=IO::Select->new();$sel->add($btc);

$p="\x2c\x7e\x00\x00"; # Version
$p.="\x01\x00\x00\x00\x00\x00\x00\x00"; # Services
$h=sprintf('%x',time());while(length($h)<16){$h="0".$h;}
$h=reverse($h);$p.=pack('h*',$h); # Unix Timestamp
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # To IP
$p.="\x7f\x00\x00\x01".$port; # 127.0.0.1:port
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # From IP
$p.="\x00\x00\x00\x00".$port; # 0.0.0.0:port
@chars=('a'..'f', 0..9);$rr=join '',map {$chars[rand @chars]} 1..16;
$p.=pack('H*',$rr); # Random Unique ID
$p.="\x00"; # No User Agent
$p.="\x00\x00\x00\x00"; # No Blocks

sendpacket('version',$p);
while($gotver==0){
  ($c,$p)=readpacket();
  if($c eq 'version'){$gotver=1;}
sleep(1);}
sendpacket('verack','');

$tt=pack('H*',$tx);
$h=Digest::SHA::sha256(Digest::SHA::sha256($tt));
$p="\x01\x01\x00\x00\x00".pack('H*',reverse(unpack('h*',$h)));

sendpacket('inv',$p);$gotreq=0;
while($gotreq==0){
  ($c,$pp)=readpacket();
  if($c eq 'getdata' && $p eq $pp){$gotreq=1;}
sleep(1);}

sendpacket('tx',$tt);
print "Sent transaction ".unpack('H*',$h)."\n";
close($btc);

sub sendpacket{my $c=shift(@_);my $p=shift(@_);
  my $o=$magic;while(length($c)<12){$c.="\x00";}$o.=$c; #Command
  my $h=sprintf('%x',length($p));while(length($h)<8){$h="0".$h;}
  $h=reverse($h);$o.=pack('h*',$h); # Payload length
  $h=Digest::SHA::sha256(Digest::SHA::sha256($p));
  $h=unpack('H*',$h);$o.=pack('H*',substr($h,0,8)); # Checksum
  $o.=$p; # Payload
  print $btc $o;print STDERR "Sent $c (".length($p)." byte payload)\n";
}
sub readpacket{
  if(!$sel->can_read(1)){return 0;}
  my @x;my $x;while(1){read($btc,$x,1);$x=unpack('H*',$x);
    push(@x,$x);if($#x>3){shift(@x);}
    if(join('.',@x) eq $mmatch){
      my $cmd;my $len;
      read($btc,$cmd,12);read($btc,$len,4);read($btc,$x,4);
      $x=unpack('h*',$len);$x=reverse($x);$len=hex($x);
      $x=chop($cmd);while($x eq "\x00"){$x=chop($cmd);}$cmd.=$x;
      print STDERR "Read $cmd ($len byte payload)\n";
      if($len>0){read($btc,$x,$len);return ($cmd,$x);}
      else{return ($cmd,'');}
    }
  }
}


nice one! i wish more such simple approaches were there instead of tweaking the full bitcoind to do minor stuff!!
hero member
Activity: 560
Merit: 500
I am the one who knocks
August 03, 2012, 03:29:37 PM
#55
Yeah, it just connects to a bitcoind (through the p2p connection, not RPC), does the handshake, and offers up that single tx hash and then the tx itself when it is requested.  Basically the same as 'mktx send' is supposed to do in the subvertx package, I just found it far easier to rewrite as a script rather than to try and get all the dependencies for that to compile on the systems I was working on.
Agreed; however I am attempting to setup an electrum server so I don't have that option :/
full member
Activity: 125
Merit: 100
August 03, 2012, 03:25:56 PM
#54
Yeah, it just connects to a bitcoind (through the p2p connection, not RPC), does the handshake, and offers up that single tx hash and then the tx itself when it is requested.  Basically the same as 'mktx send' is supposed to do in the subvertx package, I just found it far easier to rewrite as a script rather than to try and get all the dependencies for that to compile on the systems I was working on.
hero member
Activity: 560
Merit: 500
I am the one who knocks
August 03, 2012, 03:03:30 PM
#53
I've been using something like this to dump raw transactions into the network, feel free to adapt to your language of choice if you want something that runs locally.  I don't have anything like it running on a public web server but it shouldn't be too hard to do.

Code:
#!/usr/bin/perl

use IO::Socket;use IO::Select;use Digest::SHA;

$tx=shift(@ARGV);
$btc=IO::Socket::INET->new(PeerAddr=>"localhost",PeerPort=>'8333',Proto=>'tcp') or die "Socket";
$port="\x20\x8d";$magic="\xf9\xbe\xb4\xd9";$mmatch="f9.be.b4.d9";
$sel=IO::Select->new();$sel->add($btc);

$p="\x2c\x7e\x00\x00"; # Version
$p.="\x01\x00\x00\x00\x00\x00\x00\x00"; # Services
$h=sprintf('%x',time());while(length($h)<16){$h="0".$h;}
$h=reverse($h);$p.=pack('h*',$h); # Unix Timestamp
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # To IP
$p.="\x7f\x00\x00\x01".$port; # 127.0.0.1:port
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # From IP
$p.="\x00\x00\x00\x00".$port; # 0.0.0.0:port
@chars=('a'..'f', 0..9);$rr=join '',map {$chars[rand @chars]} 1..16;
$p.=pack('H*',$rr); # Random Unique ID
$p.="\x00"; # No User Agent
$p.="\x00\x00\x00\x00"; # No Blocks

sendpacket('version',$p);
while($gotver==0){
  ($c,$p)=readpacket();
  if($c eq 'version'){$gotver=1;}
sleep(1);}
sendpacket('verack','');

$tt=pack('H*',$tx);
$h=Digest::SHA::sha256(Digest::SHA::sha256($tt));
$p="\x01\x01\x00\x00\x00".pack('H*',reverse(unpack('h*',$h)));

sendpacket('inv',$p);$gotreq=0;
while($gotreq==0){
  ($c,$pp)=readpacket();
  if($c eq 'getdata' && $p eq $pp){$gotreq=1;}
sleep(1);}

sendpacket('tx',$tt);
print "Sent transaction ".unpack('H*',$h)."\n";
close($btc);

sub sendpacket{my $c=shift(@_);my $p=shift(@_);
  my $o=$magic;while(length($c)<12){$c.="\x00";}$o.=$c; #Command
  my $h=sprintf('%x',length($p));while(length($h)<8){$h="0".$h;}
  $h=reverse($h);$o.=pack('h*',$h); # Payload length
  $h=Digest::SHA::sha256(Digest::SHA::sha256($p));
  $h=unpack('H*',$h);$o.=pack('H*',substr($h,0,8)); # Checksum
  $o.=$p; # Payload
  print $btc $o;print STDERR "Sent $c (".length($p)." byte payload)\n";
}
sub readpacket{
  if(!$sel->can_read(1)){return 0;}
  my @x;my $x;while(1){read($btc,$x,1);$x=unpack('H*',$x);
    push(@x,$x);if($#x>3){shift(@x);}
    if(join('.',@x) eq $mmatch){
      my $cmd;my $len;
      read($btc,$cmd,12);read($btc,$len,4);read($btc,$x,4);
      $x=unpack('h*',$len);$x=reverse($x);$len=hex($x);
      $x=chop($cmd);while($x eq "\x00"){$x=chop($cmd);}$cmd.=$x;
      print STDERR "Read $cmd ($len byte payload)\n";
      if($len>0){read($btc,$x,$len);return ($cmd,$x);}
      else{return ($cmd,'');}
    }
  }
}

I assume this connects to bitcoind?  Thanks for the code, shouldn't be too hard to hack up, thanks.
full member
Activity: 125
Merit: 100
August 03, 2012, 02:51:21 PM
#52
I've been using something like this to dump raw transactions into the network, feel free to adapt to your language of choice if you want something that runs locally.  I don't have anything like it running on a public web server but it shouldn't be too hard to do.

Code:
#!/usr/bin/perl

use IO::Socket;use IO::Select;use Digest::SHA;

$tx=shift(@ARGV);
$btc=IO::Socket::INET->new(PeerAddr=>"localhost",PeerPort=>'8333',Proto=>'tcp') or die "Socket";
$port="\x20\x8d";$magic="\xf9\xbe\xb4\xd9";$mmatch="f9.be.b4.d9";
$sel=IO::Select->new();$sel->add($btc);

$p="\x2c\x7e\x00\x00"; # Version
$p.="\x01\x00\x00\x00\x00\x00\x00\x00"; # Services
$h=sprintf('%x',time());while(length($h)<16){$h="0".$h;}
$h=reverse($h);$p.=pack('h*',$h); # Unix Timestamp
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # To IP
$p.="\x7f\x00\x00\x01".$port; # 127.0.0.1:port
$p.="\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xFF\xFF"; # From IP
$p.="\x00\x00\x00\x00".$port; # 0.0.0.0:port
@chars=('a'..'f', 0..9);$rr=join '',map {$chars[rand @chars]} 1..16;
$p.=pack('H*',$rr); # Random Unique ID
$p.="\x00"; # No User Agent
$p.="\x00\x00\x00\x00"; # No Blocks

sendpacket('version',$p);
while($gotver==0){
  ($c,$p)=readpacket();
  if($c eq 'version'){$gotver=1;}
sleep(1);}
sendpacket('verack','');

$tt=pack('H*',$tx);
$h=Digest::SHA::sha256(Digest::SHA::sha256($tt));
$p="\x01\x01\x00\x00\x00".pack('H*',reverse(unpack('h*',$h)));

sendpacket('inv',$p);$gotreq=0;
while($gotreq==0){
  ($c,$pp)=readpacket();
  if($c eq 'getdata' && $p eq $pp){$gotreq=1;}
sleep(1);}

sendpacket('tx',$tt);
print "Sent transaction ".unpack('H*',$h)."\n";
close($btc);

sub sendpacket{my $c=shift(@_);my $p=shift(@_);
  my $o=$magic;while(length($c)<12){$c.="\x00";}$o.=$c; #Command
  my $h=sprintf('%x',length($p));while(length($h)<8){$h="0".$h;}
  $h=reverse($h);$o.=pack('h*',$h); # Payload length
  $h=Digest::SHA::sha256(Digest::SHA::sha256($p));
  $h=unpack('H*',$h);$o.=pack('H*',substr($h,0,8)); # Checksum
  $o.=$p; # Payload
  print $btc $o;print STDERR "Sent $c (".length($p)." byte payload)\n";
}
sub readpacket{
  if(!$sel->can_read(1)){return 0;}
  my @x;my $x;while(1){read($btc,$x,1);$x=unpack('H*',$x);
    push(@x,$x);if($#x>3){shift(@x);}
    if(join('.',@x) eq $mmatch){
      my $cmd;my $len;
      read($btc,$cmd,12);read($btc,$len,4);read($btc,$x,4);
      $x=unpack('h*',$len);$x=reverse($x);$len=hex($x);
      $x=chop($cmd);while($x eq "\x00"){$x=chop($cmd);}$cmd.=$x;
      print STDERR "Read $cmd ($len byte payload)\n";
      if($len>0){read($btc,$x,$len);return ($cmd,$x);}
      else{return ($cmd,'');}
    }
  }
}
legendary
Activity: 1596
Merit: 1100
August 02, 2012, 09:10:31 AM
#51
Right now, the Satoshi client has no tx-forwarding capability. 

This is certainly not true.  If the Satoshi client did not forward transactions, nothing would get relayed on the network.

But I'm guessing you meant new transactions?

If so, you want the recently added sendrawtransaction RPC from the 'raw transactions' API.

hero member
Activity: 560
Merit: 500
I am the one who knocks
August 02, 2012, 07:05:18 AM
#50
http://blockchain.info/pushtx

Ignore the bit about the fees.
Thanks piuk!  I knew I had saw one on your site but couldn't find it.

I will use it to send a donation when I get to work.
hero member
Activity: 910
Merit: 1005
August 01, 2012, 06:20:16 PM
#49
http://blockchain.info/pushtx

Ignore the bit about the fees.
hero member
Activity: 560
Merit: 500
I am the one who knocks
August 01, 2012, 05:34:48 PM
#48
http://bitsend.rowit.co.uk/

Now you just have to create the transactions by hand!
Sorry to bump an old topic, but this site is gone now, and was wondering if there were any still in operation.

Just got electrum working and though that would be a great way to do super-anon TXs.  You could send a pre-signed TX from any internet cafe or library.
TT
member
Activity: 77
Merit: 10
November 24, 2011, 01:07:06 AM
#47
A few suggestions:

1) What about parsing out the transaction and showing a hex offset byte dump, one field per line?

2) You can show if there are any parsing errors (i.e. a variable length field has different size than indicated by the size field or fixed length field has inappropriate content or is of wrong size). I recommend writing such errors in red in the byte dump.

3) You can also check the scriptSig and scriptPubKey fields for whether they correspond to standard transaction types.

4) If all the above checks out, you can then verify the signatures...and indicate which, if any, fail.

5) If you want to get a little fancier, you can look for typical errors (wrong endianness, i.e.)...heuristically trying to figure out where the user might have screwed up.

6) If you do manage to figure out the user's error, you can fix it and suggest a valid transaction.

-TT
sr. member
Activity: 438
Merit: 291
November 21, 2011, 03:53:40 PM
#46
Thanks, looks like it worked: http://blockexplorer.com/t/8G3y5ANENm

I will think about providing better feedback to help people debug.
Not sure how to do it though. Any ideas?
TT
member
Activity: 77
Merit: 10
November 20, 2011, 06:51:55 PM
#45
OK,

I think I figured out what caused your app to crash.

The initial byte of the scriptSig should be 48, not 47...since
the number of bytes pushed on the stack includes the hash type code byte.

The input was:
Quote
0100000001b1195dbf2f80ada2b6de7001de4199b286eec8d90896be93fd6311589c32ecdd01000 0008b483045022100979bb252e6137a7a42fb15f8dfc54f813b334911ee1443271bbd64fe277c224702200 9a5e0bf8d8dc5dd6c658a1c543f4a17617227f259675bb5a0267ea5930c33a4014104085fc258cb bcc6fdea0acfef5578b7e8f13b70e7a400de3ba988b346886f54083f55b2dcebeb2de545d2aad03 affa4f76a58b68bb0ce0d64898b04adf0a98dfeffffffff0130d39700000000001976a9141b00a2 f6899335366f04b277e19d777559c35bc888ac00000000

It gave me the following output:
Quote
Tx Hash:bf90f6453e991aded9949541b76cc96b3cf93fbbf841efe7483c75c135b8cd98

from:1GiHRDbYLZLrbp8dUd7i6enbK5hysf8MC1

[72]3045022100979bb252e6137a7a42fb15f8dfc54f813b334911ee1443271bbd64fe277c224702200 9a5e0bf8d8dc5dd6c658a1c543f4a17617227f259675bb5a0267ea5930c33a401 [65]04085fc258cbbcc6fdea0acfef5578b7e8f13b70e7a400de3ba988b346886f54083f55b2dcebeb2 de545d2aad03affa4f76a58b68bb0ce0d64898b04adf0a98dfe

outpoint 1:ddec329c581163fd93be9608d9c8ee86b29941de0170deb6a2ad802fbf5d19b1

to:13Tn1QkAcqnQvGA7kBiCBH7NbijNcr6GMs

0.09950000 BTC

DUP HASH160 [20]1b00a2f6899335366f04b277e19d777559c35bc8 EQUALVERIFY CHECKSIG

Our ID:d2fbb712-1a73-423a-bfa4-52ba2f1eb716
TT
member
Activity: 77
Merit: 10
November 20, 2011, 05:33:56 PM
#44
Or here, try this one instead:

Quote
0100000001b1195dbf2f80ada2b6de7001de4199b286eec8d90896be93fd6311589c32ecdd01000 0008b473045022100979bb252e6137a7a42fb15f8dfc54f813b334911ee1443271bbd64fe277c22 47022009a5e0bf8d8dc5dd6c658a1c543f4a17617227f259675bb5a0267ea5930c33a4014104085 fc258cbbcc6fdea0acfef5578b7e8f13b70e7a400de3ba988b346886f54083f55b2dcebeb2de545 d2aad03affa4f76a58b68bb0ce0d64898b04adf0a98dfeffffffff0130d39700000000001976a91 41b00a2f6899335366f04b277e19d777559c35bc888ac00000000

It's .0995 btc for you!
TT
member
Activity: 77
Merit: 10
November 20, 2011, 05:17:52 PM
#43
nibor,

Your web app is extremely useful for testing a transaction signing module I'm working on.
(Pretty soon, I will have developed full transaction broadcast capabilities myself.)

It seems to be crashing on a particular input, though:
Quote
0100000001b1195dbf2f80ada2b6de7001de4199b286eec8d90896be93fd6311589c32ecdd01000 0008b473045022058e08abd09852421d32597942e7813d698b23df03831f5c7b305f04f8805ef32 0221009d27134a7aef289080ca44fc710f2287a18569dae33f7a932cdaa62a4b6a41db014104085 fc258cbbcc6fdea0acfef5578b7e8f13b70e7a400de3ba988b346886f54083f55b2dcebeb2de545 d2aad03affa4f76a58b68bb0ce0d64898b04adf0a98dfeffffffff0180969800000000001976a91 4703e53ae0059c70345ee3f18c36806f1c63fa03888ac00000000

Could you please tell me why it's crashing? I believe I've formatted the transaction correctly.

Thanks.

(Note: I entered the transaction in with no whitespace characters at all)
sr. member
Activity: 438
Merit: 291
November 18, 2011, 05:51:47 PM
#42
Page is up again and should be now for good.

Might go down for few mins on occasion as I update the look of it.
sr. member
Activity: 438
Merit: 291
November 16, 2011, 02:49:53 AM
#41
Will be up again at weekend.
Was overloading the server and need to move it all to another.
This will be done at weekend.

Thanks
full member
Activity: 154
Merit: 102
Bitcoin!
November 15, 2011, 11:08:30 AM
#40
Your page is down? Huh
Yes, it does appear to be down.
member
Activity: 62
Merit: 10
November 15, 2011, 10:57:53 AM
#39
Your page is down? Huh
Pages:
Jump to: