dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 05:25:39 PM Last edit: November 08, 2011, 09:46:19 AM by dogisland |
|
Update: I've added a 20 BTC bounty for the creation of an offline HTML page that creates an address transaction using Javascript.The Bounty has been claimed. I want to get a sanity check on something I'm currently working on. At the moment StrongCoin uses BitcoinJS and the BitcoinJS exit node to generate transactions for arbitrary addresses. The standard bitcoin client already knows what addresses it's looking out for so it doesn't need to go back through the blockchian to collect unspent transaction outs. It just maintains a list of unspent outs as the blocks arrive. However with StrongCoin you can import a key at any time so I need the ability to get the unspent transaction outs form the past so to speak. Take this block explorer API call for example http://blockexplorer.com/q/mytransactions/1PurtonoEouSwXZXZqddxWgeLTRJynr51AIs there enough information in the q/mytransactions call to calculate the unspent outs ? Has anyone use blockexplorer this way to get at that information ? If blockexplorer does provide enough information in that call then I reckon it wouldn't be too difficult to knock up a web page (html page) that people could use offline. i.e. 1. The page would take the BlockExplorer JSON from a q/mytransactions query in a text area. (You could copy it over on a USB). 2. A text area for your private key in hex. 3. A submit button that then uses Javascript to create a Bitcoin transaction (in hex). (BitcoinJS has code for this). 4. This transaction could then be carried over to an online machine and broadcasted. 20 BTC to the first person to implement this. The 20 BTC will be paid through with a transaction created with the page. So the solution would be 1 html page then a number of JS files (i.e. BitcoinJS etc) that the page links to. This must work with no network connection.
|
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5306
Merit: 13215
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 06:05:39 PM |
|
I designed /q/mytransactions for things like that. It has all the information you need to do that, assuming your client only sends and receives address transactions. That page doesn't show non-address transactions.
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 06:28:50 PM |
|
I designed /q/mytransactions for things like that. It has all the information you need to do that, assuming your client only sends and receives address transactions. That page doesn't show non-address transactions.
Thanks. In that case I've added a bounty to see if anyone wants to implement this.
|
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 06:36:03 PM Last edit: November 03, 2011, 11:39:01 PM by BTCurious |
|
I will work on this, it seems perfectly doable as far as I can tell.
Edit: One thing the /q/mytransactions doesn't show, is block generation reward. However, I highly doubt that this is relevant for your purposes. It's something to keep in mind, though, if someone ever uses the code to count wallet balance.
|
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5306
Merit: 13215
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 07:17:40 PM |
|
Something to note: if you're capable of storing data, you can minimize the amount of data you download/process by handling ETag headers and using the block-stop parameter to /q/mytransactions.
It would not be too hard for me to add pubkey-TX support to /q/mytransactions. I haven't seen any demand for it, though.
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 07:32:26 PM |
|
Something to note: if you're capable of storing data, you can minimize the amount of data you download/process by handling ETag headers and using the block-stop parameter to /q/mytransactions. I think processing all transactions of just one address won't be slow enough for the user to get bothered by it, really. I'll code it without storing data first, since that's easier.
|
|
|
|
dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 07:51:44 PM |
|
It would not be too hard for me to add pubkey-TX support to /q/mytransactions. I haven't seen any demand for it, though.
What is pubkey-TX ?
|
|
|
|
theymos
Administrator
Legendary
Offline
Activity: 5306
Merit: 13215
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 08:20:28 PM |
|
What is pubkey-TX ?
Transactions can be sent directly to a public key instead of to an address. Some generation transactions do this. The generations that pools like Eligius produce are actually address transactions, so they will be detected by mytransactions. Nowadays few individuals receive pubkey transactions.
|
1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 03, 2011, 11:10:11 PM |
|
In what format do you usually have your private key?
|
|
|
|
dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 04, 2011, 09:14:46 AM |
|
In what format do you usually have your private key?
Base58.
|
|
|
|
dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 07, 2011, 02:28:05 PM |
|
Anyone fancy a go at this ?
|
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 07, 2011, 02:48:23 PM |
|
Is there still one of those broadcast transaction sites, so I can check if everything's working? Can't seem to find it anymore…
|
|
|
|
etotheipi
Legendary
Offline
Activity: 1428
Merit: 1093
Core Armory Developer
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 07, 2011, 04:17:55 PM |
|
Is there still one of those broadcast transaction sites, so I can check if everything's working? Can't seem to find it anymore…
It turns out the original site you are thinking of was taken offline, but Nibor is working on one based on this thread. You could PM him to find out how he's doing on it. Admittedly, such a site is useful occasionally for folks, but has remarkably low-demand on a regular basis, which is why the original site was taken offline.
|
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 08, 2011, 12:23:38 AM Last edit: November 08, 2011, 12:46:14 AM by BTCurious |
|
My homemade transaction, and the client's transaction based on that one, were just accepted in the blockchain. Which means it's working ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) (So yes, it took somewhat longer than expected, but everything is in working order now.) It's available here: http://ge.tt/9XKMag9?cThe library included is bitcoinjs-lib, so you can download that instead of the lib directory in the zip, then there's less code to "trust". I haven't done any error catching, so if there is any error (incorrect key, not enough funds, etc), then it will show up in the javascript console. The user interface is probably self-explanatory, but: Put in the transaction history (eg this) in the big box, and the private key for that address in the box below. Press "Parse" It will calculate your address (You can verify this is correct), and your current balance. You can now fill in the target address, the money you want to send, and the fee you want to include. Any change will be sent back to the original address itself. Press generate to generate the transaction. It will pop up in the bar below the button. If there are any questions, let me know. Enjoy, and goodnight ![Smiley](https://bitcointalk.org/Smileys/default/smiley.gif) (Any of the addresses in my sig will do for a payment) PS: I broadcasted my transaction eventually by hardcoding/hacking it into a python bitcoin client by ThomasV, but since you run strongcoin, you probably have your own broadcast script anyway. (Screenshot:) ![](https://ip.bitcointalk.org/?u=http%3A%2F%2Fimg100.imageshack.us%2Fimg100%2F5782%2Fexampleo.png&t=665&c=hg809FYY6T7hVA)
|
|
|
|
dogisland (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 08, 2011, 09:47:14 AM |
|
This is great. Thanks. 20BTC Payment has been made.
|
|
|
|
|
Jaagu
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 62
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 09, 2011, 12:28:53 PM Last edit: November 09, 2011, 12:40:22 PM by Jaagu |
|
BTCurious, I tried your Offline TX generation webpage in 1) IE 6.0 2) OperaTor 3) Google Chrome and 4) FireFox portable. Parse > Address, Balance worked only in FireFox ![Undecided](https://bitcointalk.org/Smileys/default/undecided.gif) Next I tried in Opera. It returned errors: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= JavaScript - file://localhost/D:/tmp2/offlineTransaction.html Inline script compilation Syntax error while loading: line 209 of linked script at file://localhost/D:/tmp2/offlineTransaction.js : Expected identifier for (var b in tx.in ) { ---------------------^ JavaScript - file://localhost/D:/tmp2/offlineTransaction.html Event thread: click Error: name: ReferenceError message: Statement on line 1: Undefined variable: parseFormData Backtrace: Line 1 of function script parseFormData(this.form) ... stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' JavaScript - file://localhost/D:/tmp2/offlineTransaction.html Event thread: click Error: name: ReferenceError message: Statement on line 1: Undefined variable: parseFormData Backtrace: Line 1 of function script parseFormData(this.form) ... stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' JavaScript - file://localhost/D:/tmp2/offlineTransaction.html Event thread: click Error: name: ReferenceError message: Statement on line 1: Undefined variable: parseFormData Backtrace: Line 1 of function script parseFormData(this.form) ... stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' JavaScript - file://localhost/D:/tmp2/offlineTransaction.html Event thread: click Error: name: ReferenceError message: Statement on line 1: Undefined variable: parseFormData Backtrace: Line 1 of function script parseFormData(this.form) ... stacktrace: n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace'=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= I am dumbuser. Maybe you could help?
|
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 09, 2011, 01:03:11 PM |
|
BTCurious, I tried your Offline TX generation webpage in 1) IE 6.0 2) OperaTor 3) Google Chrome and 4) FireFox portable. Parse > Address, Balance worked only in FireFox ![Undecided](https://bitcointalk.org/Smileys/default/undecided.gif) Next I tried in Opera. It returned errors: --snip-- Maybe you could help? Heya! For me it worked fine in both chrome and firefox. (I just tried on IE, and it didn't work for that. Is there anyone who wants IE to be specifically supported?) About the Opera error: I suspect the first error is due to the field in the data called "in". "in" is also a javascript keyword, which might cause problems. For me it didn't, so I went with it. Here's a file with a workaround which shouldn't have that problem: http://ge.tt/9jstkk9About it not working in various browsers: It might be that it's erroring on some unique thing in the data you gave it. There should be an error console in firefox (Maybe tools > web developer?), or in chrome ("Wrench tool" > tools > javascript console) that will give you an error. Apart from that, can you tell me what address you're trying to parse? I can see if it works for me.
|
|
|
|
Jaagu
Member
![*](https://bitcointalk.org/Themes/custom1/images/star.gif)
Offline
Activity: 62
Merit: 10
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 09, 2011, 01:19:43 PM Last edit: November 09, 2011, 02:55:00 PM by Jaagu |
|
Your improvement made it work in Chrome (both Address and Balance are returned), but in Opera only Address is returned. Compatibility with IE would be also desirable, because then one could make tx-s from any computer in the world, without installing bitcoin client and without using online wallets (after nibor gets he's webpage http://bitsend.rowit.co.uk/ fixed (see: https://bitcointalk.org/index.php?topic=50282.msg611729#msg611729).
|
|
|
|
BTCurious
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
November 09, 2011, 01:31:35 PM |
|
Can you check if you get any errors in a javascript console? It should be somewhere in the menus… I never really use Opera.
Oh btw, "Apart from that, can you tell me what address you're trying to parse? I can see if it works for me." I meant public address (1somethingsomething) of course, not private key.
|
|
|
|
|