Pages:
Author

Topic: Getting unspent outs for arbitrary addresses from BlockExplorer. (Bounty 20BTC) - page 2. (Read 8676 times)

hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
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

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/9jstkk9

About 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.
member
Activity: 62
Merit: 10
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

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?
sr. member
Activity: 262
Merit: 250
sr. member
Activity: 262
Merit: 250
This is great. Thanks. 20BTC Payment has been made.
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
My homemade transaction, and the client's transaction based on that one, were just accepted in the blockchain. Which means it's working Smiley

(So yes, it took somewhat longer than expected, but everything is in working order now.)

It's available here: http://ge.tt/9XKMag9?c

The 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 (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:)
legendary
Activity: 1428
Merit: 1093
Core Armory Developer
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.
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
Is there still one of those broadcast transaction sites, so I can check if everything's working? Can't seem to find it anymore…
sr. member
Activity: 262
Merit: 250
Anyone fancy a go at this ?
sr. member
Activity: 262
Merit: 250
In what format do you usually have your private key?

Base58.
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
In what format do you usually have your private key?
administrator
Activity: 5222
Merit: 13032
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.
sr. member
Activity: 262
Merit: 250
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 ?
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
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.
administrator
Activity: 5222
Merit: 13032
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.
hero member
Activity: 714
Merit: 504
^SEM img of Si wafer edge, scanned 2012-3-12.
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.
sr. member
Activity: 262
Merit: 250
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.
administrator
Activity: 5222
Merit: 13032
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.
sr. member
Activity: 262
Merit: 250
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/1PurtonoEouSwXZXZqddxWgeLTRJynr51A

Is 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.
Pages:
Jump to: