Pages:
Author

Topic: Gocoin - totally different bitcoin client with deterministic cold wallet - page 6. (Read 38686 times)

legendary
Activity: 2053
Merit: 1356
aka tonikt
FYI, few days ago, after a longer period of testing, I released Gocoin version 1.0.0.

I have built binaries of this release for Windows and Linux. You can download them from here: https://sourceforge.net/projects/gocoin/files/?source=directory
Inside each archive there is a file with SHA-256 sums, signed with my bitcoin-otc PGP key.

The Linux execs require 64 bit OS.
Windows binaries require 64-bit platform for downloader in client, but the wallet and balio apps will also work on 32 bit systems.
If you need a binary for any other platform (OSX, FreeBSD, Linux i386, Linux ARM), let me know - I can build it for you.

When launching the client make sure to have the www/ folder in the place (it contains the WebUI app).

For the wallet there is an example config file (with all the config parameters are commented out).

Don't hesitate to give me a shout, if you'd experience any issues: [email protected]
legendary
Activity: 2053
Merit: 1356
aka tonikt
The new code seems quite stable already and soon I am going to merge unspent4 branch into the master.
It means that when you get it, it will have to rebuild your UTXO database, which may take up to one hour.

I could have put in a converter to speed up this process pretty much, but that will add an unnecessary code to the client, so I prefer not to.
The rebuilding of UTXO db is a one time operation and I just do not think it would be worth it.

This message is just a notice of my intent, and if you have any objections against what I am going to do, there is still time to raise them.
If you don't have any objections, just expect that at some time in a future (after you pull the most recent sources), your node may take up to an hour to launch for the first time.

Or if you prefer to get it over with now, checkout the unspent4 branch and build it - then starting the node will make then conversion for you already.
It doesn't remove unspent3 database, so after the conversion is done, you can still use the old gocoin node (tag 1.0.0rc7 or lower).
legendary
Activity: 2053
Merit: 1356
aka tonikt
sounds promising, I am interested in having gocoin running on a small 32 bit ARM hardware.
it was possible with original client, I gladly help with 32 bit experiments x86 / ARM.
free time shortage, but hopefully try something during the week.
best regards !
sure - it's always worth trying.
let me know if you needed any help.
and also how it went.

all I can say about 32-bit "incompatibility" is that when I build the node with 32-bit compiler and run it on my 64 bit windows, it crashes after awhile complaining something about memory allocation error.
but it does not seem to take more than 2GB of the system memory at any time, so that's kind of weird.
it may be only happening on windows - worth trying at a different OS.

also, in the testnet mode, it should work just fine on 32 bit OS.
the database isn't so big yet.
but who needs testnet mode for anything except testing.
sr. member
Activity: 259
Merit: 250
sounds promising, I am interested in having gocoin running on a small 32 bit ARM hardware.
it was possible with original client, I gladly help with 32 bit experiments x86 / ARM.
free time shortage, but hopefully try something during the week.
best regards !
legendary
Activity: 2053
Merit: 1356
aka tonikt
Update on the development.

I had said to myself that after I would have the current code running without any changes for like 2 weeks, then I would tag it as 1.0
And the problem is that I apparently don't have a patience for it - 2 weeks is just too long for me to not touch a code Smiley
So now I am already on 1.0.0-RC8, and again the code was hugely remade.

In rc8 I changed the format of UTXO database. Now it is kept in "gocoin/btcnet/unspent4/", while the old one was in unspent3.
The new format allowed me to further simplify the architecture, but also performs significantly better (e.g. the node starts faster).
But the most important thing is that it decreased memory consumption, from far over 2GB to slightly over 1GB. But it still does not work on 32-bit arch (too little memory space for Go framework, I guess).
Additionally the size of unspent4 folder is significantly lower, comparing to its predecessor.

I developed this version on a branch, because the new database format means that the node needs to rebuild the UTXO at the first launch.
It may take up to an hour, so I did not want to annoy anyone, especially when it wasn't all complete and stable yet.

But the current version seems to have all the old full functionality already.
If anyone would like to try it before I get to merge it with the master, to checkout the branch:
Code:
git checkout unspent4
...and then rebuild your binaries.

Any feedback welcome.

Oh, and there were plenty of changes since my last announcement on 0.9.13, though mostly of architecture / performance matter.
Not much visible on a user interface level, but really plenty of good stuff. As usually you can find a more detailed list in changelog.txt

Also, if you run it for the first time and have no fresh bitcoind to import your blocks from, make sure to try the downloader.
On my few yrs old i5 desktop PC, with 50Mb downlink, it fetches the current block chain (while building UTXO database) in about 90 minutes.
For comparison: on the same PC, bitcoin-qt needs like 6 hours to just re-index the chainstate (having the blocks on disk already).
legendary
Activity: 2053
Merit: 1356
aka tonikt
I just said: this feature was pretty useless.
It wasn't adding any security and was a hell lot a hassle to use it.

I don't see why anyone would want to extract hashes, just to sign numbers instead of the actual transaction file.
And then, to make it even more convoluted, use another tool to put the signatures + pubkeys into the unsigned transaction, before broadcasting.
The wallet can do all this things together, in much more secured way, where you can actually check what you are signing, instead of just signing a meaningless number.
This feature just didn't make any sense to me.
legendary
Activity: 2053
Merit: 1356
aka tonikt
BTW, the latest version of wallet also supports Litecoin (add -ltc switch)
The client node does not, but you can fetch balance of your Litecoin addresses from http://ltc.blockr.io using tool/balio
Then broadcast a signed transaction to Litecoin network using this page: http://ltc.blockr.io/tx/push (or the official litecoin's client sendrawtransaction RPC).


From other useful changes in the wallet, now you can just do:
Code:
wallet -raw rawtx.txt
.. to sign all the multisig inputs that the current wallet knows keys for. (previously you had to specify a specific signing address with "-msign")
legendary
Activity: 2053
Merit: 1356
aka tonikt
wallet -raw tx2sign.txt -hashes

wallet -sign -hash
Sorry I don't know what that message means, but recently I removed support for the "-hashes" and "-hash -sign.." commands.

This signing method wasn't adding any security and required a lot of hassle (e.g. playing with tool/txaddsig).
Moreover, it was not compatible with multisig, after I eventually added support for it at some point.

So I decided to remove this code from the source, because I find it important for the wallet code to be clean, readable and as simple as possible.
Maybe one day I will add it back, but for now it will stay disabled, because each new option complicates the testing.

But if you need these commands, just checkout some previous tag (between 0.9.2 and 0.9.14) and build the wallet executable from it.
newbie
Activity: 44
Merit: 0
Oh, you mean the lock time.
Yeah, sure that should be easy to add.

FAIK, it's just setting the LockTime to a value other than zero.
You can do it yourself, if you like playing with source code.

Look inside wallet/signtx.go, function make_signed_tx() and change:
Code:
tx.Lock_time = 0
... to whatever you need. (like a value read from a command line).

I really encourage people to play with the code - if you are a programmer, especially if you did a lot of C, Go is a really cool language to code in.
I've been coding C all my life, but writing in Go is just so much more pleasant. And it compiles so quickly that at the beginning you cannot even believe it Smiley

Of course, there is a testnet switch -t and make sure to use it while you are having fun, to not be sorry at the end.


EDIT:
As for the lock time, I read that in order for it to work, you would also need to set this:
Code:
tin.Sequence = 0xffffffff
... to a different value.

Thanks Piotr_n. That's very helpful!
legendary
Activity: 2053
Merit: 1356
aka tonikt
Oh, you mean the lock time.
Yeah, sure that should be easy to add.

FAIK, it's just setting the LockTime to a value other than zero.
You can do it yourself, if you like playing with source code.

Look inside wallet/signtx.go, function make_signed_tx() and change:
Code:
tx.Lock_time = 0
... to whatever you need. (like a value read from a command line).

I really encourage people to play with the code - if you are a programmer, especially if you did a lot of C, Go is a really cool language to code in.
I've been coding C all my life, but writing in Go is just so much more pleasant. And it compiles so quickly that at the beginning you cannot even believe it Smiley

Of course, there is a testnet switch -t and make sure to use it while you are having fun, to not be sorry at the end.


EDIT:
As for the lock time, I read that in order for it to work, you would also need to set this:
Code:
tin.Sequence = 0xffffffff
... to a different value.
newbie
Activity: 44
Merit: 0
Well, you can put any kind of scripts into the wallet's code, but without a specific application (a user case), I don't see how I could add anything more.
So far gocoin supports the following output scripts:
* P2KH address (a regular bitcoin address)
* P2SH address (that's for multisig)
* NULL output describing the next one's encrypted constant (for stealth payments)
* NULL output with an arbitrary data (e.g. to attach text messages to transactions)
Adding other kind of output scripts is not really a challenge, but I need a specific application for it, before I can put it in.

As from the node's side.
Gocoin node (unlike bitcoin-qt) does not split transactions into "standard" and "non-standard".
As long as the fee per byte is efficient, it will get routed, despite of a content of the script.

The most basic application is to make the transaction not redeemable for a given number of blocks. While it's clearly not a feature that will be currently used by many users, there are applications being built on top of the bitcoin blockchain that can take advantage of such features.

In any case, it's good to know that the wallet can be easily modified to support different output scripts.
legendary
Activity: 2053
Merit: 1356
aka tonikt
Well, you can put any kind of scripts into the wallet's code, but without a specific application (a user case), I don't see how I could add anything more.
So far gocoin supports the following output scripts:
* P2KH address (a regular bitcoin address)
* P2SH address (that's for multisig)
* NULL output describing the next one's encrypted constant (for stealth payments)
* NULL output with an arbitrary data (e.g. to attach text messages to transactions)
Adding other kind of output scripts is not really a challenge, but I need a specific application for it, before I can put it in.

As from the node's side.
Gocoin node (unlike bitcoin-qt) does not split transactions into "standard" and "non-standard".
As long as the fee per byte is sufficient (plus some other rules are met), it will get routed, despite of the content of a script.

EDIT:
Personally I think that dividing transaction into "standard" and "non-standard" has been a really stupid idea and I just cannot believe that instead of abandoning it they are just adjusting the rules of the standardness - that's crazy! It would be nice though to measure txs by how much CPU power they require to get verified - and then check the fee not only against the size, but also against the CPU required. But that seems like a too much advanced solution for the mainstream - it will take them at least 5 years to find out that this is an idea worth exploring Wink
newbie
Activity: 44
Merit: 0
Do you have any plans to allow scripts in transactions?
I don't think I understand this question, so please precise.

But I have another answer to your previous question - times time a positive one Smiley

Is it possible to spend an unconfirmed transaction?
Not in the current implementation - not without modifying the source code..

Unless it would be an unspent transaction that you made yourself, using gocoin.
Actually, it is possible.
It just came to my mind.
The fetchbal tool - it can fetch unconfirmed balance.
And then, having your unconfirmed transaction in the balance folder, you can just use it on the wallet (it won't see a difference).

Thanks for clarifying regarding unconfirmed transactions.

What I meant about the scripts is to enable transactions that contain bitcoin scripts such as time constraints, and other bitcoin contracts as described here:
https://en.bitcoin.it/wiki/Contracts

legendary
Activity: 2053
Merit: 1356
aka tonikt
Do you have any plans to allow scripts in transactions?
I don't think I understand this question, so please precise.

But I have another answer to your previous question - times time a positive one Smiley

Is it possible to spend an unconfirmed transaction?
Not in the current implementation - not without modifying the source code..

Unless it would be an unspent transaction that you made yourself, using gocoin.
Actually, it is possible.
It just came to my mind.
The fetchbal tool - it can fetch unconfirmed balance.
And then, having your unconfirmed transaction in the balance folder, you can just use it on the wallet (it won't see a difference).
newbie
Activity: 44
Merit: 0
Do you have any plans to allow scripts in transactions?
legendary
Activity: 2053
Merit: 1356
aka tonikt
newbie
Activity: 44
Merit: 0
When building client or wallet:

membind.go:63: cannot use _Ctype_size_t(v.datlen) (type C.size_t) as type C.ulong in function argument
Thanks for reporting.
It must be specific for your libc, I cannot reproduce it here.
But I've just committed a possible fix - can you try now, please?

Otherwise you can always build it by overwriting membind.go (in qdb) with the one from no_gcc folder.
You just won't be able to enjoy the recent mem usage optimizations, but should build flawlessly then.

Seems to compile now... Thanks
legendary
Activity: 2053
Merit: 1356
aka tonikt
When building client or wallet:

membind.go:63: cannot use _Ctype_size_t(v.datlen) (type C.size_t) as type C.ulong in function argument
Thanks for reporting.
It must be specific for your libc, I cannot reproduce it here.
But I've just committed a possible fix - can you try now, please?

Otherwise you can always build it by overwriting membind.go (in qdb) with the one from no_gcc folder.
You just won't be able to enjoy the recent mem usage optimizations, but should build flawlessly then.
newbie
Activity: 44
Merit: 0
When building client or wallet:

membind.go:63: cannot use _Ctype_size_t(v.datlen) (type C.size_t) as type C.ulong in function argument
legendary
Activity: 2053
Merit: 1356
aka tonikt
Wtf?
Make sure you have relatively fresh version of go. I'd advise 1.2 at least, though I think you rather have something pre 1.0

I was doing many changes today - could have broken something. If so, I'll fix it tomorrow.
But i'm pretty sure the last tag should build well, with a proper compiler.
Pages:
Jump to: