etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
October 29, 2011, 07:07:47 PM |
|
A couple months ago I ran across apage someone made with a giant text-input box, where you could copy a serialized Tx into it and it would be broadcast onto the network. Does anyone know if this still exists, and if so, what is the link to it? Extra-credit: does it work with the testnet, too?
|
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 01, 2011, 09:31:22 PM |
|
What would be the reason to have something like this? What is the use case?
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
November 01, 2011, 09:37:01 PM |
|
I can construct transactions offline, signing them with a private key only kept on an offline computer. But then that packet must be transferred to an online computer and broadcast. Right now, the Satoshi client has no tx-forwarding capability. So I have 3 options:
(1) Write a program that can connect to the BTC network with peer discovery, networking protocol, etc (HARD) (2) Modify the client source code to allow tx-forwarding (HARD -- I could spend a week just figuring out how to compile it) (3) Copy-and-paste the serialized tx into a webpage where someone has already done this work for the rest of us (takes 10 seconds)
Personally, I prefer option 3.
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 01, 2011, 10:06:29 PM |
|
Okay that makes sense. So you would basically use this to be able to send/spend bitcoins that have have in offline storage (paper wallet, etc).
This sounds like an interesting project I might like to take on to get my feet wet. Can you give me an example of an offline transaction you would construct and what the resultant data packet would be that would need to be sent? I will have to do some reading about the bitcoin protocol, but if you give me an example, that will get me jump started.
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
November 01, 2011, 10:15:28 PM |
|
There's a couple different ways to communicate a transaction with ASCII characters as I was proposing here, but the binary structure is constant. See the first image I posted on this page: https://bitcointalk.org/index.php?topic=29416.0That shows exactly how a Tx is serialized in binary, and has an example of every kind of "standard" TxIn and TxOut. This is exactly how the data is stored in your .bitcoin/blk0001.dat file, and exactly how it would be communicated to a tx-forwarder. The only question is if it's a webpage for pasting ASCII, how do you represent that binary data in ASCII? I think the best option is simply representing it in hex: two hexbytes per binary byte. Here's an example transaction, and what I would expect to be able to copy into the webpage: 01000000020f7b7fb86d4cf646058e41d3b007183fdf79736ed19b2a7468abc5bd04b16e91000000008c493046022100b2ee39d2fcc2e5544a57c30f7b4e49cfb82222666d034fb90e22348e17e28e0f022100db91c3199cc7b41d4d7afce0ccb4ceb424b9476d51c06142583daf53ce0a9b66014104c32215a9093011bd3c41283ace3d002c666077b24a605b3cfc8f71019a0f43df66f389f3d9a62188a494b869dc7e5f9dffc98a76d3088a21e9b738ec9eba98cbffffffff97004125528f7b5ed33465caaae021c0b815f3e6a3707641d5a0bca43fc14949010000008a473044022033d02c2e896f1a1252488d534cfb08abf3e7ea90aba7ba6f57abf189cef1d837022005668d755013b0e59a2af5145f10efe62ea716d333268b0b5a3efbd82d1439be014104c32215a9093011bd3c41283ace3d002c666077b24a605b3cfc8f71019a0f43df66f389f3d9a62188a494b869dc7e5f9dffc98a76d3088a21e9b738ec9eba98cbffffffff0100c2eb0b000000001976a91402bf4b2889c6ada8190c252e70bde1a1909f961788ac00000000
If you want to try following the binary bytemap, here's a pretty-printed version of the same data (each row is 32 bytes): 0x0000: 01000000 020f7b7f b86d4cf6 46058e41 d3b00718 3fdf7973 6ed19b2a 7468abc5 0x0020: bd04b16e 91000000 008c4930 46022100 b2ee39d2 fcc2e554 4a57c30f 7b4e49cf 0x0040: b8222266 6d034fb9 0e22348e 17e28e0f 022100db 91c3199c c7b41d4d 7afce0cc 0x0060: b4ceb424 b9476d51 c0614258 3daf53ce 0a9b6601 4104c322 15a90930 11bd3c41 0x0080: 283ace3d 002c6660 77b24a60 5b3cfc8f 71019a0f 43df66f3 89f3d9a6 2188a494 0x00a0: b869dc7e 5f9dffc9 8a76d308 8a21e9b7 38ec9eba 98cbffff ffff9700 4125528f 0x00c0: 7b5ed334 65caaae0 21c0b815 f3e6a370 7641d5a0 bca43fc1 49490100 00008a47 0x00e0: 30440220 33d02c2e 896f1a12 52488d53 4cfb08ab f3e7ea90 aba7ba6f 57abf189 0x0100: cef1d837 02200566 8d755013 b0e59a2a f5145f10 efe62ea7 16d33326 8b0b5a3e 0x0120: fbd82d14 39be0141 04c32215 a9093011 bd3c4128 3ace3d00 2c666077 b24a605b 0x0140: 3cfc8f71 019a0f43 df66f389 f3d9a621 88a494b8 69dc7e5f 9dffc98a 76d3088a 0x0160: 21e9b738 ec9eba98 cbffffff ff0100c2 eb0b0000 00001976 a91402bf 4b2889c6 0x0180: ada8190c 252e70bd e1a1909f 961788ac 00000000
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 01, 2011, 10:32:55 PM |
|
Nice diagrams. This will give me something to chew on as a familiarize myself with the protocol.
I'm thinking that the easiest way to set this up as a web service would be to patch the client source code to allow injecting pre-constructed transactions, and then use the client to handle communicating with peers and broadcasting the tx. I think it's either that or writing my own script to handle peer discovery and communication. I'll have to start messing around with this on testnet.
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 01, 2011, 10:39:48 PM |
|
I hadn't seen that patch. I'll have to take a look at that.
I think I'll still have a go at setting this up as a webpage, since that would be a lot more convenient for people than patching the client.
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
November 01, 2011, 10:47:22 PM |
|
I've seen that discussion before, and that was actually going to be my last resort if I couldn't find this webpage... I hadn't seen that patch. I'll have to take a look at that.
I think I'll still have a go at setting this up as a webpage, since that would be a lot more convenient for people than patching the client.
Don't let me discourage you from diving into BTC -- it can be a fun, amazingly-educational experience. But I know for sure that three months ago there was a tx-broadcast webpage already in existence. Unfortunately, I lost all my bookmarks and am trying to locate it again... On the other hand, it may not be too difficult to setup such a webpage if you use the patch linked to from terrytibs: run an instance of the patched bitcoind, then make a webpage with a simple text-input box. The POST (?) command will simply convert the input text to binary, and pass it to your patched bitcoind for broadcast. You probably don't even need to know anything about BTC to do it! Just make sure there's someway to identify that there was an error... I imagine 90% of people trying to post txs in this way will have done something incorrectly the first few tries.
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 01, 2011, 10:58:28 PM |
|
Don't let me discourage you from diving into BTC -- it can be a fun, amazingly-educational experience. But I know for sure that three months ago there was a tx-broadcast webpage already in existence. Unfortunately, I lost all my bookmarks and am trying to locate it again...
If you find the page, that's great! I think I'm still going to go ahead with this for the learning experience. On the other hand, it may not be too difficult to setup such a webpage if you use the patch linked to from terrytibs: run an instance of the patched bitcoind, then make a webpage with a simple text-input box. The POST (?) command will simply convert the input text to binary, and pass it to your patched bitcoind for broadcast. You probably don't even need to know anything about BTC to do it! Just make sure there's someway to identify that there was an error... I imagine 90% of people trying to post txs in this way will have done something incorrectly the first few tries.
Sounds like we're thinking alike. I'm going to give this a try.
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
nibor
|
|
November 01, 2011, 11:19:53 PM |
|
Is quite simple to do in bitcoinj. Do you have a format in mind? If so send me an sample will see what I can do. Please DOUBLE check it is signed correctly! Make it a transaction that sends to my address below and I will have more motivation! I was thinking that if www.bitaddress.org could also create/sign transactions (not trival as need to link all the inputs), then if you had this web site you could then create transaction totally offline.
|
|
|
|
|
btc_artist
Full Member
Offline
Activity: 154
Merit: 102
Bitcoin!
|
|
November 02, 2011, 12:02:15 AM |
|
Is quite simple to do in bitcoinj. Do you have a format in mind? If so send me an sample will see what I can do. Please DOUBLE check it is signed correctly! Make it a transaction that sends to my address below and I will have more motivation! I was thinking that if www.bitaddress.org could also create/sign transactions (not trival as need to link all the inputs), then if you had this web site you could then create transaction totally offline. It might not be a good idea to construct the transactions online, because that means you're giving your private key to a 3rd party (and sending it over the wire). Yes, it looks like the domain is not online anymore. In any case, I'm working on getting a page up that will do this.
|
BTC: 1CDCLDBHbAzHyYUkk1wYHPYmrtDZNhk8zf LTC: LMS7SqZJnqzxo76iDSEua33WCyYZdjaQoE
|
|
|
etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
November 02, 2011, 12:54:33 AM |
|
Is quite simple to do in bitcoinj. Do you have a format in mind? If so send me an sample will see what I can do. Please DOUBLE check it is signed correctly! Make it a transaction that sends to my address below and I will have more motivation! I was thinking that if www.bitaddress.org could also create/sign transactions (not trival as need to link all the inputs), then if you had this web site you could then create transaction totally offline. I just created a tx, transferring 1.0 BTC to the address in your signature. I plugged this tx and the previous one into my ECDSA unit-test (which works on other Blockchain tx-pairs) and it passed. So I'm fairly confident that this is signed correctly. Here's the raw hex: 0100000001f658dbc28e703d86ee17c9a2d3b167a8508b082fa0745f55be5144a4369873aa010000008c49304602210041e1186ca9a41fdfe1569d5d807ca7ff6c5ffd19d2ad1be42f7f2a20cdc8f1cc0221003366b5d64fe81e53910e156914091d12646bc0d1d662b7a65ead3ebe4ab8f6c40141048d103d81ac9691cf13f3fc94e44968ef67b27f58b27372c13108552d24a6ee04785838f34624b294afee83749b64478bb8480c20b242c376e77eea2b3dc48b4bffffffff0200e1f505000000001976a9141b00a2f6899335366f04b277e19d777559c35bc888ac40aeeb02000000001976a9140e0aec36fe2545fb31a41164fb6954adcd96b34288ac00000000 And a pretty version of it: 0x0000: 01000000 01f658db c28e703d 86ee17c9 a2d3b167 a8508b08 2fa0745f 55be5144 0x0020: a4369873 aa010000 008c4930 46022100 41e1186c a9a41fdf e1569d5d 807ca7ff 0x0040: 6c5ffd19 d2ad1be4 2f7f2a20 cdc8f1cc 02210033 66b5d64f e81e5391 0e156914 0x0060: 091d1264 6bc0d1d6 62b7a65e ad3ebe4a b8f6c401 41048d10 3d81ac96 91cf13f3 0x0080: fc94e449 68ef67b2 7f58b273 72c13108 552d24a6 ee047858 38f34624 b294afee 0x00a0: 83749b64 478bb848 0c20b242 c376e77e ea2b3dc4 8b4bffff ffff0200 e1f50500 0x00c0: 00000019 76a9141b 00a2f689 9335366f 04b277e1 9d777559 c35bc888 ac40aeeb 0x00e0: 02000000 001976a9 140e0aec 36fe2545 fb31a411 64fb6954 adcd96b3 4288ac00 0x0100: 000000 @btc_novice: I'll happily toss you a BTC too, to test your solution, if you get something running.
|
|
|
|
nibor
|
|
November 02, 2011, 07:06:07 AM |
|
Damn! now I have to do it.
Your string was perfect. I can load into the bitcoinj transaction object 1st time. It contains the following transaction:
9072559e9e2772cd6ac88683531a512cba6c2fee82b2476ed5e84c24abe5f526 from 12HFYcL3Gj8EPhgeXk5689z8Wcc7x7FsNx to 13Tn1QkAcqnQvGA7kBiCBH7NbijNcr6GMs 1.00 BTC to 12HFYcL3Gj8EPhgeXk5689z8Wcc7x7FsNx 0.49 BTC
So that was the only tricky bit done.
I just now need to write the easy but dull jetty wrapper for it.
|
|
|
|
nibor
|
|
November 02, 2011, 08:32:00 AM |
|
|
|
|
|
dogisland
|
|
November 02, 2011, 09:49:01 AM |
|
Is a mess! Will tidy up at sort out hosting it over next few days.
It's a fine start. If you know anything about Maven then I would consider creating a pom.xml if I were you. You can then include bitcoinj in a clean fashion. http://code.google.com/p/bitcoinj/wiki/UsingMavenThe benefit with that is then you could then host the code on Heroku (for free), they now accept java programs as long as there's a pom.xml and a proc file.
|
|
|
|
etotheipi (OP)
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
|
November 02, 2011, 02:53:29 PM |
|
If we could get a bunch of users to setup such forwarders on webpages with SSL, then technically users won't need Tor for the anonymity they seek.
The user accesses the tx-forwarding webpage which connects via SSL. The tx-to-be-broadcast is uploaded, sometimes it broadcast, sometimes forwarded to one of the other tx-forwarding webpages (also via SSL). The final IP address that broadcasts the tx is different than the IP of the originator, and as long as tx-requests are pooled and not sent immediately, then it would be tough to correlate the originator of the tx with any particular SSL connection in the logs (but of course, the webservers probably wouldn't be saving logs of the SSL connections anyway, so that's probably not relevant).
While this is great for anonymity, you as the webserver host should be aware that it does open up far-fetched-but-non-zero risk for you. If you allow people to upload arbitrary transactions, and those transactions are for illegal activity, the investigation might end up at your IP address, and you might be in a frustrating position.
I think the chances of this are extraordinarily slim. Additionally, theoretically, they shouldn't be able to do anything to if they can't prove you own the private key, but the legal system isn't always rational like this, especially when complicated technology/protocols are involved. It's just a warning -- I would do it anyway because I really think the risk is virtually non-existent (at least until countries start explicitly trying to outlaw BTC), but it's something worth noting.
|
|
|
|
nibor
|
|
November 02, 2011, 10:02:21 PM |
|
The benefit with that is then you could then host the code on Heroku (for free), they now accept java programs as long as there's a pom.xml and a proc file.
Does Heroku allow outgoing long standing IP connection for free? I have used Google Apps before and they do not allow that (only http). And also you can not have long running processes that keep IP connections open.
|
|
|
|
|