Bitcoin Forum

Bitcoin => Wallet software => Topic started by: piotr_n on May 08, 2013, 06:03:57 PM



Title: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 08, 2013, 06:03:57 PM
If anyone is interested in my original implementation of a full bitcoin client, feel invited to try Gocoin.
Having been disappointed with other alternative implementations of a full bitcoin node you maybe have seen, please be assured that this one actually works! :)

Pre-compiled binaries for Windows and Linux (amd64) can be downloaded here: https://sourceforge.net/projects/gocoin/files/?source=directory
They are usually not up to date as in general I provide no binaries, but building the client using Go compiler is quite easy and (unlike other bitcoin clients) this one builds in a second.

The project is open source and the code is available at GitHub: https://github.com/piotrnar/gocoin
To build the sources, just follow the instructions from README.md (https://github.com/piotrnar/gocoin/blob/master/README.md).
Ask if you'd get stuck, but it is pretty straight forward, so you probably won't.

You can find the official webpage of the project at: http://gocoin.pl/ - there is the User Manual and a lot of other info.

There is also a wiki article: https://en.bitcoin.it/wiki/Gocoin although it hasn't been updated for awhile (feel welcome to contribute to it)


Note: the info below refers to Gocoin version 1.8.0

General info
  • There are no known consensus incompatibilities. Gocoin's consensus lib passes all the recent transaction & script tests (from the core's repo (https://github.com/bitcoin/bitcoin/tree/master/src/test/data)). Gocoin's node passes all the blocks test from TheBlueMatt's test scripts (https://github.com/TheBlueMatt/test-scripts). The node has (an optional) functionality to (cross-) check each new transaction with the core's consensus lib.
  • The solution is fully functional, but I like working on it, so please keep in mind that the HEAD is a work in progress and will probably always be. The source code gets tagged regularly, so if anything does not work for you with the latest version, try the previous tag. The database format is not supposed to change.
  • You do not need the client (node) in order to use the wallet. In such case use balio tool to fetch the balance of the addresses you own, in order to spend your coins (read more here (https://bitcointalk.org/index.php?topic=199306.msg3414806#msg3414806)).
  • Works with testnet, so you can start your gocoin adventure from it (use "-t" switch at the command line, for both client and wallet).

Client (the online bitcoin node)
  • Has a web interface (WebUI), by default available at http://localhost:8833/ (to access WebUI from a different host, you have to modify the config file first).
  • The entire UTXO database is kept in system memory, to maximise performance of verifying transactions and blocks.
  • From version 1.7.0 the node monitors balance on all P2SH and P2KH addresses allowing to check (or fetch for spending) the balance of any random address. The wallet's addresses aren't kept in the node's memory, but only in the user's browser.
  • The blocks on your disk are compressed, which saves 20-30% of space (comparing to bitcoin core). Additionally there is a tool called bdb that can purge old blocks from the database.

Wallet (secure your money offline)
  • It is a separate app meant to be used as a deterministic cold wallet (on an offline PC), though if you don't mind the risks nothing can stop you from using it on the online PC.
  • Is console only, does not have any graphical user interface. Any operations on the wallet are driven by command line switches. You can put some defaults in a config file.
  • Has very low system requirements (tested working on Raspberry Pi Model A).
  • The wallet's security does not rely on any random number source.
  • The wallet's private key pool is based on a seed-password, so as long as you remember it you don't need any backups (some people call it a brain-wallet).
  • Since the seed-password is basically a straight forward private key of your coins, make sure that it is complex enough and that nobody is able to peek at it.
  • If you don't trust your brain to make a password strong enough, use a randomly generated string (e.g. cat /dev/urandom | head -c 20 | xxd -p) as the seed-password.
  • By default the wallet works with a pool of 250 deterministic addresses (you can change this value, if you need more).
  • In addition to the deterministic key pool, you can import raw private keys generated elsewhere (they need to be in the base58 format).
  • Supports (partial) signing of multi-signature transactions.
  • Supports Litecoin (allowing spending of litecoins with balio tool).


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 09, 2013, 03:49:54 PM
Hey guys, that's just not fair that today many bitcoin-focused media are screaming about a "bitcoin alternative made in Go", that is planed to be released "soon", by some Conformal (whoever they are), while my yesterday's announcement has been completely ignored.

What is wrong with you?  :)
You don't believe me, that my software actually works? It really does - feel free to see for yourself.

Of course my implementation is not a "bitcoind alternative", but only because I am not a kind of person that would be spending his time trying to re-invent a wheel.
I mean: why would I need a bitcoind alternative, if I already have bitcoind?

So my implementation has not much to do with bitcoind, but instead it is focused on fulfilling my own personal needs, which might (by a chance) be similar with your needs - think about it.

And that is, for instance, why my node does not relay transactions.
I know that it is bad for the network, but I am very sorry for having only 1000kbps of upstream at my DSL, and so I am not going to waste 50% of it, plus lots of my CPU, just to relay your satoshidice bets. So I don't - and what can you do about it? ;)

Another feature that I needed, and implemented it into Gocoin, was a cold deterministic wallet, that is based on a password-seed and thus does not require any backups.
My implementation is designed for such a wallet(s), which is of course an opposite of how it is made in bitcoind.

Moreover, Gocoin has an option to limit the bandwidth usage, which was also very important for me.
I do not know if you were checking the actual bandwidth that your bitcoin client takes, but all I can tell you is that my browser stops loading pages, when I have it running and you guys have just mined a new block. So for me a bandwidth limit is not a minor feature.

To wrap it up. I really don't understand why a news about an implementation of bitcoind in Go, that is supposed to be released in some undefined feature, happens to be so much more of a headline than a news about a Go implementation of a bitcoin node with some unique features, that can already be tried. I guess it's because I just don't know the right people in the theater... :)


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: ab8989 on May 09, 2013, 06:27:43 PM
Do you think that all projects written in Go should have equal amount of interest or is it that everything that is somehow related to bitcoin clients should have equal amount of coverage or what?

I will tell you a secret, and the name of it is MARKETING.

The other group start their marketing message:
"btcd is an alternative full-node implementation of the bitcoin protocol written in Go and is currently under active development"
Sounds very interesting, doesn't it, and you have to read much deeper into the message to realize that it actually is really really far from fulfilling the expectations set in the first sentence. But see how that tactic works.

On the other hand you start your marketing message with:
"If anyone is interested in yet another bitcoin client, you are welcome to try my recent work"
You express you don't believe anybody is interested in something yet another. Okay, got the message.

"At this stage the solution is meant for developers who know what Go is, and rather only for testing"
Okay it is only for the 10 people that are both developers and do it in Go, and not only that but actually only for those ones that are interested in jumping to test somebody else's random work turning the number of people that feel interested pretty close to zero. Most of the others have closed the browser tab already by now.

Then what follows is a long post that is basically tl:dr with a lot of incoherent random deep-inside detail issues from here and there and you are wondering why the masses of people are not jumping up and down.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: gweedo on May 09, 2013, 06:32:18 PM
Of course my implementation is not a "bitcoind alternative", but only because I am not a kind of person that would be spending his time trying to re-invent a wheel.
I mean: why would I need a bitcoind alternative, if I already have bitcoind?

Scale, read about it, plus if you had a bitcoind in the language you use most often, you can customize it more to your uses.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 09, 2013, 08:05:20 PM
Do you think that all projects written in Go should have equal amount of interest or is it that everything that is somehow related to bitcoin clients should have equal amount of coverage or what?

I will tell you a secret, and the name of it is MARKETING.
Yeah,  MARKETING – whatever, man.

Both; for the mankind, and for me, marketing is even more useless than re-inventing wheels, so let me just stay away from it, OK?

In the meantime, if you had any questions, or a feedback, about an actually working first bitcoin client written in Go, you know where to find me. :)


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: LightRider on May 10, 2013, 05:13:39 AM
Show them your work. Maybe you can get a consultancy gig.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 10, 2013, 10:37:38 AM
Show them your work. Maybe you can get a consultancy gig.
Thanks for an advise, but I am doing well, not working for a corp that cuts a large part of my work's fruits, to pay for their stupid marketing, just so stupid people could be jumping up an down... :)

Just a "thanks, I like your client and I actually use it" from a random person - that's all I need as an incentive for my work.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: meowmeowbrowncow on May 10, 2013, 12:25:25 PM


Awesome.  Thanks for bringing Go to Bitcoin.


Re: Go's special channel interfaces.  Any benefit for a Bitcoin client?


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 10, 2013, 12:31:05 PM
Re: Go's special channel interfaces.  Any benefit for a Bitcoin client?
Of course - it would be a huge waste to not use such a great feature, and also go routines...
Though not really so much of it, at least at this stage.

If you grep the sources for "chan" or "go", you can find the places.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: meowmeowbrowncow on May 10, 2013, 12:34:44 PM
Re: Go's special channel interfaces.  Any benefit for a Bitcoin client?
Of course - it would be a huge waste to not use such a great feature, and also go routines...
Though not really so much of it, at least at this stage.

If you grep the sources for "chan" or "go", you can find the places.



Sweet.  I'll take a look.


It would be interesting to see how Go's special benefits could be proven in a bitcoin client.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 10, 2013, 12:38:31 PM
Sweet.  I'll take a look.

It would be interesting to see how Go's special benefits could be proven in a bitcoin client.
They were. Another thing that I found very useful were maps.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: LightRider on May 11, 2013, 06:20:54 AM
Show them your work. Maybe you can get a consultancy gig.
Thanks for an advise, but I am doing well, not working for a corp that cuts a large part of my work's fruits, to pay for their stupid marketing, just so stupid people could be jumping up an down... :)

Just a "thanks, I like your client and I actually use it" from a random person - that's all I need as an incentive for my work.

This is a reasonable, rational and admirable stance.


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: kokjo on May 13, 2013, 08:21:24 PM
is it live in the network?


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: piotr_n on May 13, 2013, 08:21:54 PM
at least one :)


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: cryptograd on June 01, 2013, 03:46:26 AM
GO is awesome

great job


Title: Re: Gocoin - bitcoin client with a deterministic cold wallet
Post by: ennio.morricone on August 13, 2013, 11:51:59 AM
this seems a very good ideia. i really like your feature set.
i'm gonna to some more reading and digging around. Hopefully i'm going to try it out soon.

Thanks


Title: Re: Gocoin - bitcoin client with a deterministic cold wallet
Post by: piotr_n on August 25, 2013, 07:39:00 PM
Thanks.
I've actually made a huge progress ever since I published this topic - lots to talk about, most things I don't remember, though I try to keep the changelog (https://github.com/piotrnar/gocoin/blob/master/changelog.txt) up to date.

From the know issues part, it still uses lots of system memory, which I could probably address by moving the UTXO db to leveldb, but since I have 12GB of RAM on my PC, I just don't care about these 4GB. And knowing that the leveldb would make fetching a balance of a random address extremely slow (comparing to what I have now), it discourages me even more from optimizing the mem usage.

And there is still this EC_Verify that works very slowly while using the standard go libs, so one of the cgo wrappers should be used, but building it, especially on windows, is a bit of a hassle.

Besides that, I'm quite satisfied with this project - these days Gocoin is the only bitcoin client I use and whoever has not tried it can only regret ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on September 21, 2013, 03:54:15 PM
A quick update for people interested in this project, if such even exist :)

Wallet
Considering the Android's RNG incident and the rumors that other systems might also be "NSA friendly", I modified the wallet app in a way that its security does not rely on random number source anymore. Note that it never had for private key calculation (since it uses deterministic wallet driven by a password-seed), but it did for signing, and now it doesn't even for signing.

Client
I ported sipa's secp256k1 lib (the 10x26 option) to Go. It is now a default option for ECDSA signature checks, so there is no need to struggle with C compilers anymore to get a decent performance.
It performs better than the openssl wrapper (so also better than your current satoshi client), though is still like 3-5 times slower from the cgo wrapper using an original secp256k1 lib.
The openssl wrapper is still there, if you prefer to use it (having a security concerns). Same applies for the native ECDSA lib, though this one is still deadly slow.

There were also some fixes around accessing maps from different threads that were not properly protected, which was causing memory leaks - this should be fixed now.

Plus plenty of other things, not really worth mentioning, like a new command to purge orphaned blocks from the database, or replaced block's gzip compression with snappy (performs much better).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on October 26, 2013, 11:29:40 AM
This month's update: changes up to version 0.8.0

Wallet
It does not show characters on screen while a user is entering the seed-password.
The solution is unfortunately platform dependent and requires MinGW in case of Windows.
If you cannot compile the wallet anymore, you can switch this feature off - just delete "wallet/hidepass_*.go"

Client
From the things that only devels care about, the structure of the code in the "client/" folder has been hugely reworked.
It isn't all-in-one anymore, but contains sub-packages.

As for the useful features, starting from version 0.7.6 there is a new tab on WebUI: MakeTx.
MakeTx allows the user to select (in a GUI-like matter) the specific outputs that he wants to spend and produces the exact command line that shall be executed.
It creates the "balance/" folder for the wallet, along with "pay_cmd.txt" file containing the command to be executed at the wallet's PC in order to sign the requested tx.
An example screenshot of how the new feature looks in your browser: http://imgur.com/JyIRZJl

FetchBalance
Recently I have also created quite a useful tool that can fetch a balance of your wallet from the popular block explorers.
I tried to use only one of them, but could not find a fully satisfying API and ended up needing both; blockchain.info & blockexplorer.com
Not every transaction can be recovered this way, but most of them should work. If any transaction cannot be fetched and decoded properly, it will inform you.

I will try to add a proxy support for it later, so you could easily fetch your wallet's balance using Tor.

Using this tool you do not need an online node anymore; only the small wallet app, and you have a fully functional and secure bitcoin brain/deterministic/cold wallet solution.
It is a single file tools/fetchbal.go - compile it to an executable, or use "go run" on the source.

Not having the client, you can just use blockchain.info/pushtx (http://blockchain.info/pushtx) to broadcast the signed transactions coming from the wallet.


If anyone would like to try any of the pieces, but does not want to play with building the s/w himself, I can provide binaries for Windows or Linux.
Also, if you built and tried it on Mac, please let me know whether it works - I am curious to know, but have no apples here.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: orz.dk on November 02, 2013, 08:20:48 PM
Hi Piotr

Thank you for your work on this. I am trying it out, but getting an error on block 00000000000000560719da7088be587ea9c3018cfbbfae2dd2540682185c034b (#233046). It says:

.....
7474.8MB of data processed. We are at height 234765. Processing speed 10.507MB/sec, recent: 12853.3KB/s
7582.1MB of data processed. We are at height 235421. Processing speed 10.510MB/sec, recent: 10967.8KB/s
7710.2MB of data processed. We are at height 236155. Processing speed 10.541MB/sec, recent: 13109.1KB/s
7850.1MB of data processed. We are at height 236949. Processing speed 10.588MB/sec, recent: 14325.8KB/s
7958.2MB of data processed. We are at height 237625. Processing speed 10.586MB/sec, recent: 10700.6KB/s
8087.1MB of data processed. We are at height 238516. Processing speed 10.616MB/sec, recent: 13185.7KB/s
CheckBlock failed: CheckBlock: Block 00000000000000560719da7088be587ea9c3018cfbbfae2dd2540682185c034b hooks too deep into the chain: 233046/238760 000
00000000000e76cddac91bfdbf51a73f31ec740e07d651fba24f381289965

Do you maybe know what could be wrong. Im on windows 8, 64bit golang. I chose not to verify scripts.

Thanks ! : )


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 03, 2013, 01:22:55 PM
Hi Piotr

Thank you for your work on this. I am trying it out, but getting an error on block 00000000000000560719da7088be587ea9c3018cfbbfae2dd2540682185c034b (#233046). It says:

.....
7474.8MB of data processed. We are at height 234765. Processing speed 10.507MB/sec, recent: 12853.3KB/s
7582.1MB of data processed. We are at height 235421. Processing speed 10.510MB/sec, recent: 10967.8KB/s
7710.2MB of data processed. We are at height 236155. Processing speed 10.541MB/sec, recent: 13109.1KB/s
7850.1MB of data processed. We are at height 236949. Processing speed 10.588MB/sec, recent: 14325.8KB/s
7958.2MB of data processed. We are at height 237625. Processing speed 10.586MB/sec, recent: 10700.6KB/s
8087.1MB of data processed. We are at height 238516. Processing speed 10.616MB/sec, recent: 13185.7KB/s
CheckBlock failed: CheckBlock: Block 00000000000000560719da7088be587ea9c3018cfbbfae2dd2540682185c034b hooks too deep into the chain: 233046/238760 000
00000000000e76cddac91bfdbf51a73f31ec740e07d651fba24f381289965

Do you maybe know what could be wrong. Im on windows 8, 64bit golang. I chose not to verify scripts.

Thanks ! : )
Thanks for reporting.

It looks like it aborted importing blocks from the satoshi's db, because there was some very orphaned block inside.
But if you re-launch the client after this - it should download all the further blocks from the internet, haven't it?

You can also take a new client/init.go and see how it goes then - in the updated version it prints the error but continues with converting the db.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: orz.dk on November 03, 2013, 02:05:04 PM
Hi Piotr

Thanks for your help. If i restart it goes:

Using NewEC wrapper for EC_Verify
Gocoin client version 0.8.1
Opening blockchain... (Ctrl-C to interrupt)
Blockchain open in 35.300 seconds
open d:\data\gocoin\btcnet\wallet\DEFAULT: The system cannot find the file specified.
open d:\data\gocoin\btcnet\wallet.txt: The system cannot find the file specified.
Starting WebUI at 127.0.0.1:8833 ...
> ListenTCP listen tcp4 0.0.0.0:8333: Only one usage of each socket address (protocol/network address/port) is normally permitted.

When i go to the webui the last blockheight is 238773, so at first glance it does not seem like it's downloading anything beyond the orphaned block where it crashed.

Can you help me on the mechanisms behind one block being more orphaned than another? , just for my own understanding, thx. For example height 226794 also splits, but it is "less orphaned" than 233046. Is it because there is too many blocks between the output being created and then later referenced in a spend? If yes, why does it occur on a orphan, could it also have occured on a main chain block?

I will try commenting out the errors as in the new submit. Would everything still be in sync, theres some comment about unwind buffer not being able to handle...?

Thanks : )

 


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 03, 2013, 02:16:53 PM
Quote
open d:\data\gocoin\btcnet\wallet\DEFAULT: The system cannot find the file specified.
open d:\data\gocoin\btcnet\wallet.txt: The system cannot find the file specified.
This just tells you where to put a wallet - a text file with your public addresses (each address in new line).

Quote
Starting WebUI at 127.0.0.1:8833 ...
> ListenTCP listen tcp4 0.0.0.0:8333: Only one usage of each socket address (protocol/network address/port) is normally permitted.
This is unusual. Do you have any other app bound to TCP port 8833?
Aren't you by a chance running two instances of the client, at the same time?

Quote
When i go to the webui the last blockheight is 238773, so at first glance it does not seem like it's downloading anything beyond the orphaned block where it crashed.
When you go to the Network tab - are there any net connections established?

Quote
Can you help me on the mechanisms behind one block being more orphaned than another? , just for my own understanding, thx. For example height 226794 also splits, but it is "less orphaned" than 233046. Is it because there is too many blocks between the output being created and then later referenced in a spend? If yes, why does it occur on a orphan, could it also have occured on a main chain block?

I will try commenting out the errors as in the new submit. Would everything still be in sync, theres some comment about unwind buffer not being able to handle...?
Yes - it keeps a history of which unspent outputs were added/removed with each block, in case if there was a fork and it had to unwind the changes while switching to a different  branch.
But it is now set to 5000 blocks - I'm not aware of such a deep forks ever happening in the past.

Anyway, if you want to restart importing the DB, fetch the new init.cpp (this one does not abort on error) and delete the entire folder d:\data\gocoin\btcnet
See how it goes then.
And make sure that you are not running two instances of the client.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: orz.dk on November 03, 2013, 02:58:39 PM
Ok, now it finished.

- ok with wallet error, not using wallet yet
- network socket error message is gone now, check
- network tab shows many connections, check

And it has all the blocks now. Great !  It also has 6GB of my RAM and 30% CPU, so i might have to move it to a server : )

I plan to maybe use it for my address monitor (my hobby version of triplespeeder's bicoinmonitor.net) - he is using a bitcoind fork that hits a url on new transactions, can your tool do something similar? Also how do you recommend querying gocoins version of the utx base for address balances? (the tools/fetchbalance.go uses blockchain.info api, would like to get it all locally)

Thanks again !


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 03, 2013, 03:08:29 PM
And it has all the blocks now. Great !  It also has 6GB of my RAM and 30% CPU, so i might have to move it to a server : )

Try to exit it and restart. The memory consumption should go lower. Normally it does not go above 3GB at my PC.
As for the 30% CPU - it should not happen in between new blocks. Unless you are receiving lots of txs and the node is busy verifying them.
You can disable relying transactions by editing the config file - then the CPU woudl only be busy while verifying new blocks (every 10 minutes on average).

Quote
I plan to maybe use it for my address monitor (my hobby version of triplespeeder's bicoinmonitor.net) - he is using a bitcoind fork that hits a url on new transactions, can your tool do something similar? Also how do you recommend querying gocoins version of the utx base for address balances? (the tools/fetchbalance.go uses blockchain.info api, would like to get it all locally)
If you play with the source code, that should be easy to add.
Just put the addresses that you want to monitor inside the wallet and look into client/main.go, where it does:
Code:
	if wallet.BalanceChanged {
wallet.BalanceChanged = false
fmt.Println("Your balance has just changed")
fmt.Print(wallet.DumpBalance(nil, false))
textui.ShowPrompt()
}
This is printing some message each time a balance on any of the wallet's addresses changes.
Add there whatever you need  e.g. a call to http.Get(...) and you should have the functionality you seek.

Also remember that the wallet.BalanceChanged is set only when a new relevant txs has been mined into a block (so not for yet-unconfirmed transactions).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: orz.dk on November 03, 2013, 03:23:41 PM
Super, it's down to ~2.2GB now and ~1% CPU after restart. I will try to play around with the wallet and/or code.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 03, 2013, 03:29:41 PM
have fun :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on December 17, 2013, 04:56:53 PM
Update on the recent development.

The last one (from October) was on version 0.8.0 - now we are on 0.8.5.

Wallet
* Can now decode and sign files containing raw transaction data (either hex-dump or a raw binary format).
* Is able to sign a transaction partially - only signing the inputs that it "owns" (knows a private key for).
* Checks for GOCOIN_WALLET_CONFIG environment variable (useful for a global config file).

Client
* You can include a content of another (watch) wallet inside a wallet file (use "@filename"), so you can have like a sub-wallets and a master wallet that includes them.
* Starting from 0.8.5 switching between wallets should be much quicker, since there is a monitoring (cache) of all the addresses that are not in the currently selected wallet but have been checked for a balance ever since the node was started.
* Inside the payment.zip (the one you download from MakeTx tab) there is additional file tx2sign.txt, which caries the unsigned transaction data - so you can e.g. sign it using a different wallet or give it to someone else for his part of a so-called CoinJoin signing.
* P2SH addresses should now be properly decoded (but that only matters when you view a transaction details).
* Some changes in WebUI's look & feel.

Privacy
* Now you can tell WebUI to broadcast own (locally loaded) tx only to a single random peer.
* Never broadcast own tx to peers that have not sent an inv to us.
* Disconnect peers that are not sending any invs (they are useless for us and might just be there to spy).
* The entire 129.132.230.0/24 network is banned, since I don't know what these guys are up to (sorry).
* fetchbalance (renamed to fetchbal) now supports getting the blanace via tor's socks5 proxy
* A user can setup his node to report any User-Agent he wants (the string that goes out in the "version" message).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: adamas on December 19, 2013, 09:48:47 AM
I'm looking for a safe way to create offline LTC transactions. Could your client be ported to Litecoin to serve this purpose?
If not, do you know a way how to manage this?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on December 19, 2013, 10:21:29 AM
Hi. I'm not a programmer, but I'm looking for a safe way to create offline LTC transactions, and broadcast them. Could your client be ported to Litecoin to serve this purpose?
If not, do you know a way how to manage this?
I'm not sure about the specific differences between bitcoin and litecoin protocol, but I don't see why it could not be ported.

I believe you can use the default litecoin-qt client and its raw transaction API to sing transactions offline (by another litecoin-qt).
https://en.bitcoin.it/wiki/Raw_Transactions

Unfortunately this probably still requires moving the entire blockchain from the online to the offline PC, since I don't believe "signrawtransaction" will work otherwise.
So (after moving the blockachain), you might just as well make the offline payment using the GIU and then "getrawtransaction" to get the hexdump followed by "sendrawtransaction" in the online to broadcast it.

Remember that your actual wallet is on the offline PC - whatever wallet you have in your online PC should not matter.
Just make sure to not overwrite the wallet.dat when moving the blockchain data.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: adamas on December 19, 2013, 10:47:20 AM
Thanks for this.  :)


Title: Re: Gocoin - a bitcoin solution in Go language [TESTING]
Post by: gorgorom on December 24, 2013, 02:17:48 PM
Hey guys, that's just not fair that today many bitcoin-focused media are screaming about a "bitcoin alternative made in Go", that is planed to be released "soon", by some Conformal (whoever they are), while my yesterday's announcement has been completely ignored.

What is wrong with you?  :)
You don't believe me, that my software actually works? It really does - feel free to see for yourself.

Of course my implementation is not a "bitcoind alternative", but only because I am not a kind of person that would be spending his time trying to re-invent a wheel.
I mean: why would I need a bitcoind alternative, if I already have bitcoind?

So my implementation has not much to do with bitcoind, but instead it is focused on fulfilling my own personal needs, which might (by a chance) be similar with your needs - think about it.

And that is, for instance, why my node does not relay transactions.
I know that it is bad for the network, but I am very sorry for having only 1000kbps of upstream at my DSL, and so I am not going to waste 50% of it, plus lots of my CPU, just to relay your satoshidice bets. So I don't - and what can you do about it? ;)

Another feature that I needed, and implemented it into Gocoin, was a cold deterministic wallet, that is based on a password-seed and thus does not require any backups.
My implementation is designed for such a wallet(s), which is of course an opposite of how it is made in bitcoind.

Moreover, Gocoin has an option to limit the bandwidth usage, which was also very important for me.
I do not know if you were checking the actual bandwidth that your bitcoin client takes, but all I can tell you is that my browser stops loading pages, when I have it running and you guys have just mined a new block. So for me a bandwidth limit is not a minor feature.

To wrap it up. I really don't understand why a news about an implementation of bitcoind in Go, that is supposed to be released in some undefined feature, happens to be so much more of a headline than a news about a Go implementation of a bitcoin node with some unique features, that can already be tried. I guess it's because I just don't know the right people in the theater... :)

In my humble opinion, you're a genius.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on December 24, 2013, 09:23:11 PM
nee. sathoshi was a genius - I'm just writing code.
though, I see where you're coming from; the reference industrial benchmark for a development of a bitcoin software is so weak these days that my hobby looks like a master performance next to it ;)
but the truth is that there are thousands of kids out there who can make code even quicker - most of them are like half my age and I would not even dare to compete with them, unless on 'who has a bigger mouth'.. :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: KriszDev on January 05, 2014, 07:28:11 AM
Can i use this for any altcoin? If yes what i need to modificate?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on January 05, 2014, 10:39:10 AM
Can i use this for any altcoin? If yes what i need to modificate?
The parts that need to be different for the altcoin of your choice.

If you want a specific answer I'm gonna need a specific question.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: KriszDev on January 05, 2014, 12:06:48 PM
Can you make it to a multiwallet (you can store different coins not just bitcoin)?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on January 05, 2014, 12:11:14 PM
Can you make it to a multiwallet (you can store different coins not just bitcoin)?
I don't make things that I don't use, so I will make it if I only need it one day.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on January 27, 2014, 07:49:28 PM
0.9.0

The version 0.9.0 (after 0.8.5) brings performance improvements to the block chain parsing.
If you do "client -r", forcing it to re-index UTXO database, it should go much faster now (like below one hour to re-build the entire UTXO DB)


Block-chain downloader

Additionally I created a new tool called downloader.
It speeds up the initial block-chain download, even to one hour or less, depending on your internet speed and performance of your PC.
The main trick is to skip verification of scripts, up to the "trusted" block. Normally the trusted block gets discovered automatically, but to improve security you can use a command line switch, like e.g.:
Code:
./downloader -t 000000000000000144785afb658fbe3ad2ce9ec2c5827886934c9a678d6942fd
This would assume all the block up to #282757 as trusted and only all the scripts from further blocks will be verified.

You can also download the blocks without even applying their content to the UTXO database. In such case just use "-b" switch. Then you are basically limited only by the speed of your internet connection. If you do it this way, the UTXO database will be automatically rebuilt after you start the "client" with the new content of the blocks database. As I had said, the full re-indexing usually takes below one hour now, though it does need some system memory, so I recommend at least 8GB of RAM these days.


Other changes

As always, you can see more detailed list of changes/fixes in the README.md (https://github.com/piotrnar/gocoin/blob/master/README.md)


Open issues

Nobody reports any issues, so either nobody even uses this s/w (weird since the github repo already has 68 stars) or you find no issues.
And if you find no issues than you either suck in testing, or this is a really good piece of software ;)
But I also find no issues (except of the ones I fix on daily basis), so who am I to blame you anyway.. :)


Road-map

As for the future of this project.
I have been thinking hard about the part that would need an improvement the most and IMO that would be the UTXO database engine.
The one that I use now, I made myself, but it takes a hell lot of memory and the occupation of the disk is also far from being optimal.
But currently I do not really have any breakthrough idea in how to move it on, maybe except re-writing it from Go to C, which should at least let me to save system memory, though without improving the disk usage.

So if anyone had an idea on improving the UTXO DB engine, please share it - I will surely take it seriously and you can keep the credit for inventing it.
LevelDB is out of the question - I need to be able to browse through all the UTXO records as quickly as possible, so the entire DB index needs to always be in the memory.
Otherwise (if I loose performance just to save memory), it would not have been an improvement to me.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 11, 2014, 04:14:15 PM
Getting advantage of the recent malled transactions hysteria (not that I'm behind it), I'd like to use the opportunity to advertise my Gocoin client as a wallet that is 100% resistant for this kind of "attacks". Gocoin really doesn't give a shit of whether anyone wants to alter its transaction before it gets confirmed or not - feel free to alter them all you want!

So, since apparently there are some ongoing disturbances in the network which affect the official wallet, if you don't want to be exposed to them, just know that there are alternative wallets, for which thins kind of problems don't even exist.

To be honest, myself I don't even see it as a problem - and MtGox should be really ashamed that they caused so much panic by literally claiming that there is a problem with a bitcoin protocol. The only problem there is, is inside a lame implementation of the MtGox software. Shame on them, BTW.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on February 17, 2014, 04:03:07 AM
Hi, when I run

> ./wallet -l -v

and enter 1234 as the passphrase, I get the following addresses:

mtMzKRALsjU3QUW9f7mrNdFkKuR32rRVJk TypC 1
ms8dDiiQh92J13Sb5FGxTcLbxfeyKTXAkT TypC 2
mjUi7buZNg93whuD1qeohVm7TKeBgs1G8E TypC 3
mhYcRqxfUJkEMCNQXPZueCJpnWxuGg3m7k TypC 4
mgrkKPPFUppG9WNySxiYtPA77yPVQk4x9j TypC 5
muTGvkfyRDQ1n5otCqukPK5RX1Spnyf5qG TypC 6
n3AgSXhgVt4BuunbzLhjc2bKbdxHmUkGET TypC 7
mzvpZH8jhgYs5JGHSF7HZBnvYudP8xQwWa TypC 8
mofUnUzEJDFNHfhbY51sqRqzKARWbwuEhr TypC 9
moJ4HS4NYtDRd9KqeG282qferp4kXHbbDH TypC 10
mkTDZxJTM6oR88zTtV1gWE6qNnEQvxT5wD TypC 11
mzKNtwNaeScnY71zFqghA69iTTgZX5gh6b TypC 12
mw1JJpDtTLRdkC7akZoYt15wsSifGP89vf TypC 13
moUuYTsFA69LAuwyVSNKJiHrTkGp5XPmPm TypC 14
mpA8fNq4Qt6gd3sPNvoFne85wz7KHHsUb7 TypC 15
mxF4F2V1ySQMrR1tdsA4u5fQdmDdaVgiW5 TypC 16
mgstWQteoRTQnkAMXU2viRmHu1AYXHbBx8 TypC 17
mzkhGFopVmfeLAw84YcVx3uZgfbo3XYmGR TypC 18
mjivnvukgajoHCmJ55dXh1QyN84WhVEVD1 TypC 19
muGkLzrQ4CrBo91ecMdkcjbET4LmB6aYPw TypC 20
mnjxHuncYvNNzr71T1gTKqUE17jHMjUHqz TypC 21
n48TXP4PiRy9wDcZJFKFNNYnPgkss2WAb1 TypC 22
mjX8qm14PQntBqwa2AazzA58hqccpzmHit TypC 23
mgJJQ5QPWYqB1p1KauNtEZUawqBL7JURU5 TypC 24
n26Ncr3fKHNTsANMi1cdDfB4uNyxvXKs7A TypC 25

These are not valid bitcoin addresses. What am I doing wrong?



Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 17, 2014, 11:43:51 AM
Hi, when I run

> ./wallet -l -v

and enter 1234 as the passphrase, I get the following addresses:

mtMzKRALsjU3QUW9f7mrNdFkKuR32rRVJk TypC 1
ms8dDiiQh92J13Sb5FGxTcLbxfeyKTXAkT TypC 2
mjUi7buZNg93whuD1qeohVm7TKeBgs1G8E TypC 3
mhYcRqxfUJkEMCNQXPZueCJpnWxuGg3m7k TypC 4
mgrkKPPFUppG9WNySxiYtPA77yPVQk4x9j TypC 5
muTGvkfyRDQ1n5otCqukPK5RX1Spnyf5qG TypC 6
n3AgSXhgVt4BuunbzLhjc2bKbdxHmUkGET TypC 7
mzvpZH8jhgYs5JGHSF7HZBnvYudP8xQwWa TypC 8
mofUnUzEJDFNHfhbY51sqRqzKARWbwuEhr TypC 9
moJ4HS4NYtDRd9KqeG282qferp4kXHbbDH TypC 10
mkTDZxJTM6oR88zTtV1gWE6qNnEQvxT5wD TypC 11
mzKNtwNaeScnY71zFqghA69iTTgZX5gh6b TypC 12
mw1JJpDtTLRdkC7akZoYt15wsSifGP89vf TypC 13
moUuYTsFA69LAuwyVSNKJiHrTkGp5XPmPm TypC 14
mpA8fNq4Qt6gd3sPNvoFne85wz7KHHsUb7 TypC 15
mxF4F2V1ySQMrR1tdsA4u5fQdmDdaVgiW5 TypC 16
mgstWQteoRTQnkAMXU2viRmHu1AYXHbBx8 TypC 17
mzkhGFopVmfeLAw84YcVx3uZgfbo3XYmGR TypC 18
mjivnvukgajoHCmJ55dXh1QyN84WhVEVD1 TypC 19
muGkLzrQ4CrBo91ecMdkcjbET4LmB6aYPw TypC 20
mnjxHuncYvNNzr71T1gTKqUE17jHMjUHqz TypC 21
n48TXP4PiRy9wDcZJFKFNNYnPgkss2WAb1 TypC 22
mjX8qm14PQntBqwa2AazzA58hqccpzmHit TypC 23
mgJJQ5QPWYqB1p1KauNtEZUawqBL7JURU5 TypC 24
n26Ncr3fKHNTsANMi1cdDfB4uNyxvXKs7A TypC 25

These are not valid bitcoin addresses. What am I doing wrong?


you probably have wallet.cfg and it is configured to use testnet
just set it to false or remove wallet.cfg - the default is non-testnet for all I know.


EDIT:
oh sorry - my bad.
it was the wallet.cfg that I committed  to github that has "testnet=true"
I have just fixed it.

Thanks for reporting!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on February 19, 2014, 08:14:19 PM
Just a suggestion:

When creating transactions on the online machine, it would be great if it was possible to obtain the hash that needs to be signed directly instead of the transaction zip file. Then, a human can type it in on the offline machine, and then type the signature value back on the online computer.

This removes the need to plug usb drives into the offline device.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 19, 2014, 08:21:17 PM
That's a great idea, @Tovadnok - thanks!

I will look into it, as soon as I'm back from holiday.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 01, 2014, 04:13:49 PM
Just a suggestion:

When creating transactions on the online machine, it would be great if it was possible to obtain the hash that needs to be signed directly instead of the transaction zip file. Then, a human can type it in on the offline machine, and then type the signature value back on the online computer.

This removes the need to plug usb drives into the offline device.
After all, giving it more thought, it seems kind of tricky and I am not sure anymore about an actual usefulness of such a feature.

First of all the Gocoin's security assumes that the online machine is not secured.
This implies that the hash that needs to be signed, since created on the online machine, may be a subject to an attack, giving you a value that describes a different transaction.
That is bad, because having just the hash you cannot verify the content of the transaction at the offline machine, before signing it.

Second thing is that you would need to sign as many hashes, as there are inputs in the transaction. And moreover for each of the hashes you would need to manually specify the actual signing address that shall be used.

And then at the end, having the signature already (and the public key), you need to assemble this data back into a signed transaction, before broadcasting...

That is really a lot of hassle - just typing in the digits seems like a huge waste of time.
So I really don't see anyone using such a complex and unsecured system.
You really want to verify the actual content of the transaction that you are about to sigh at the offline machine, because this is a crucial part of the wallet's security.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: sqabeloth on March 01, 2014, 04:46:11 PM
Awesome client! You did great job! Thanks a lot for making this really cool bitcoin client  :) :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on March 05, 2014, 03:10:33 AM
@piotr_n you're right about the fact that the has could be modified. That's a very good point.
However, I still think that transferring transactions via a USB drive is very risky.

If bitcoin is valuable, stuxnet-like malware may emerge that travels to the offline machine through a thumbdrive, and then travels back on the same thumbdrive, this time carrying your private keys with it. Once the USB drive is re-inserted into the online machine, the private keys are sent out to a malicious server.

I do think that your software is pretty much the only one out there that one person can read the entire code base and convince themselves that it does what it claims to do. This is a nice side effect of Go.

I guess the real problem to solve here is how to make the transactions themselves transferable to the offline machine without risking compromise of the offline machine.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 05, 2014, 07:54:23 AM
@piotr_n you're right about the fact that the has could be modified. That's a very good point.
However, I still think that transferring transactions via a USB drive is very risky.

If bitcoin is valuable, stuxnet-like malware may emerge that travels to the offline machine through a thumbdrive, and then travels back on the same thumbdrive, this time carrying your private keys with it. Once the USB drive is re-inserted into the online machine, the private keys are sent out to a malicious server.

I do think that your software is pretty much the only one out there that one person can read the entire code base and convince themselves that it does what it claims to do. This is a nice side effect of Go.

I guess the real problem to solve here is how to make the transactions themselves transferable to the offline machine without risking compromise of the offline machine.
If you are worried of stuxnet-like malware, just copy your file several times on the way - using different devices, with completely different software.

These days there are plenty of embedded devices (cameras, GPS systems, media players, etc) that can copy data to/from USB disks or memory cards.
No way anyone would be able to create stuxnet-like malware that can infect each possible system.

Basically you can think of many kinds of countermeasures to protect this channel - copying the data at least once on its way is just the first one that comes to my mind.

It is a good idea to not have any GUI at the wallet machine, because AFAIK the stuxnet was infecting windows using an exploit in parsing shortcut/icon files, or something like that...
In other words: make sure to use a system which does not read any data from USB, except the one that you explicitly ordered it to read. Then an infection is pretty unlikely.
And also don't use root/admin account at the wallet machine - this makes infection even less likely.
You can even use an entirely read-only file system there, e.g. by booting it from a CD or a write protected USB medium.

Another trick could be to use a very small medium. For instance if you had a disk/diskette with only 16KB capacity, that should be enough for most transactions, but it's extremely unlikely that any malware (capable of stealing keys from your offline wallet) would fit into it.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on March 05, 2014, 09:42:59 PM
Hi Piotrnar,

I'm not sure that copying several times, using non-root users, etc, will solve the problem. The concern is that someone will develop a new malware targeted specifically at your software. It can then exploit whatever vulnerabilities are currently available and will not necessarily use the same techniques as stuxnet.

Your idea for using a really small storage device makes a lot of sense. That's essentially what happens if a human types the data in -- you're using a very low bandwidth channel.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 06, 2014, 10:20:07 AM
I totally don't understand how anyone could develop a malware that would be able to copy itself unnoticed through a several different systems.
The only way stuxnet could spread in the first place was through a 0-day exploit, for which only Windows was vulnerable.

But well, you wanted a functionality to sign a hash - here it comes, though as I had said it isn't quite secured and there is plenty of hassle with it.
Anyway, it is already committed into github - comes with version 0.9.2.

Here is how to use it:

1.
Having the payment.zip created at the online machine, extract it (on whichever machine you want) and being in the payment folder execute:
Code:
wallet -raw tx2sign.txt -hashes
This will print a hash that needs to be signed and the address that it shall be signed with - one pair for each of the transaction's inputs.

2. Now, on the offline wallet machine, execute such a command for each of the pairs:
Code:
wallet -sign <addrN> -hash <hashN>
Each of this commands will give you a hex dump of the public key and the canonical signature.

3. Now move the key+sig pairs to a PC where you have the unsigned transaction (tx2sign.txt) and use the tool called txaddsig, for each of the tx inputs executing:
Code:
txaddsig tx2sign.txt 0 <signature0> <pubkey0>
txaddsig <txfromprvstep>.txt 1 <signature1> <pubkey1>
...
txaddsig <txfromprvstep>.txt N <signatureN> <pubkeyN>

The file created after the last step shall contain a fully signed transaction. Before loading it to the node, for broadcasting, you can decode it's content with:
Code:
wallet -d <txfromlaststep>.txt


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on March 06, 2014, 03:06:02 PM
Thanks, Piotr_n.

I agree that the fact that hash can be substituted by an attacker on the online machine is still a problem. I'll try to think of a way around this issue.
Overall, I think your client probably has the most secure design out there.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 06, 2014, 03:38:11 PM
You're welcome.

Coming back to a malware that would eventually be able to attack the offline wallet.
The only path I see, except exploiting the OS, is some kind of stack-overflow exploit that would be smuggled to the wallet PC, inside one of the balance description files, or the raw transaction file.
If I had screwed up something (which isn't unlikely), the wallet app may crash while parsing a corrupt file, especially if it was corrupt by design...

Though I am not aware of an existence of any possible stack-overflow exploits for software written in Go.
AFAIK, Go's framework is more like Java, having a quite restricting memory manager and thus making a possibility of stack-overflow exploits very unlikely.

But nothing is impossible and I have seen many things in my life, so thanks for your valuable feedback @Tovadnok - it's been taken with a seriousness it deserves.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 13, 2014, 10:35:01 AM
A update on 0.9.3 that is going to be released soon (the previous one was about 0.9.0)

As usually a more detailed list of changes is in the changelog.txt

I believe the most important feature that the new version brings is support for multisig addresses.

I already updated the user manual with the info on how to use the new feature: http://www.assets-otc.com/gocoin/manual/multisig

Please remember that the multisig code is pretty fresh and something may not work quite well yet. So make sure to try it with testnet first and please report any issues.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 13, 2014, 03:59:30 PM
Sorry.
If your gocoin node had a breakdown today, it was because of some unique multisig txs that appeared in the chain last night.
I have just fixed it - pull the recent changes from github and it should go on with the remaining blocks now.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: bitcool on March 17, 2014, 05:08:03 PM
Thank you for providing btc community with a great alternative.

Since both are written in GO, if you don't mind, any information comparing GoCoin with Conformal will be very helpful.

it was claimed that there was well over one man-year worth of work spent in Conformal, guess GoCoin is on the same level?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 17, 2014, 05:14:06 PM
Haven't really looked at the other project.

From the description I read that it's basically bitcioind rewritten into Go - so that's at least the first difference, because Gocoin's architecture is quite different from bitcoind, especially at the "blockchain parser/db <=== online node ===> wallet" interface.

Yes, it's been a year since I started it, so you may say that it was one man-year work, though I wasn't working on any schedule, rather for fun, education and a personal necessity.
But that (according to some research I've learned) is supposedly much more efficient way of development than working for money and I think I can agree with it, comparing to how quickly I remember delivering stuff last time anyone was paying me, not to mention how much more stressful it had been  :)

So a may-year is a relative term and moreover, apparently the less you pay for it, the more you can get ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 23, 2014, 08:29:30 AM
Can you imagine that some asshole removed my entire article from the wiki, just to put an ad of his corporation in its place?
https://en.bitcoin.it/w/index.php?title=Gocoin&action=historysubmit&diff=43684&oldid=41856

We empower merchants... (https://en.bitcoin.it/w/index.php?title=GoCoin&oldid=44240) - WTF? What kind of article is this?
Vandalism and spam - that's all I know they empower for sure. :)

Anyway, I'm not going to argue with idiots, so I just recovered the content from the history and put it at a different name.
https://en.bitcoin.it/wiki/Gocoin_bitcoin_software


EDIT (2014-Apr-12):
I did not ask for it, but apparently people read my posts and someone decided that I should get the original location back:
https://bitcointalk.org/index.php?topic=560755.0
Anyway, thanks, whoever you were ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Elerntta on March 23, 2014, 04:47:47 PM
Is it really so good? What's the main advantage that made you to begin to use it?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 23, 2014, 04:54:14 PM
I think the most important thing for me, is an easy to use cold storage wallet - deterministic, based on a seed password.
It does not require me to do any backups, not even to store the actual password anywhere, except in my own brain.

Of course, for convenience and additional security (to access the cold wallet less often), I also use a wallet containing some small amounts on the online machine - obviously with a different seed password, but also not requiring any backups.

The client node can switch between my different wallets, in a fraction of a second. So I can easily choose any of them, use the web GUI to make an unsigned transaction - and then just execute the wallet app (on any PC I want; hot or cold) to sign it, simply by typing in the seed password which I keep stored only in my head.
Let's face it: it's the best security there is and none of the existing commercial hardware wallets comes even close to it.

And the recent versions also support a relatively easy to use multisig signing - which makes the security aspects even more crazy.
Personally I have not used it yet, didn't find a need for it, but I did test it, FWIW, so it should work.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on March 23, 2014, 10:11:27 PM
It's a great piece of software. I'm using it for my own bitcoin wallet.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Heater on March 26, 2014, 09:57:25 AM
This is great - well done!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on March 29, 2014, 09:53:40 PM
Meaningful commit messages would be great!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 30, 2014, 07:55:04 AM
So my implementation has not much to do with bitcoind, but instead it is focused on fulfilling my own personal needs, which might (by a chance) be similar with your needs

What do you mean ?
I said it below, in the same post (https://bitcointalk.org/index.php?topic=199306.msg2088015#msg2088015): a possibility (though back then rather a limitation:)) to disable relying transactions, convenient cold wallets, network bandwidth usage limit.

On top of that I can add: quickly switching between wallets, coin control (when bitcoind didn't have it back then), web interface (so I can operate/monitor my node via network), tuning to fastest peers (by periodically dropping the slowest one), mining pool stats... the list is long; whatever feature I found useful or even interesting during the last year - it's there.

For me as a developer it is also very important to be able to quickly rebuild a software for trying any change - bitcoind is a nightmare when it comes to that. Go is just so much more convenient and its code much smaller and readable than C++, though still performing quite similar.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2014, 03:53:21 PM
In case if anyone had wondered:
No - Gocoin isn't anyhow vulnerable to the heartbleed attack. :)

But mark my words: expect more of openssl shit hitting the fan in a future.
And in the meantime: better watch your money - Gocoin can help you with this.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 13, 2014, 07:37:51 PM
Another monthly update on the development.
The previous one was on 0.9.3 - now 0.9.7 is about to be released.

Among the changes there isn't really anything big, rather gadgets though a few useful ones, so I think I will just quote the change log:
Code:
0.9.7
* Wallets tab of WebUI has an option to move an empty address to UNUSED wallet
* A user can quickly switch wallet being at any tab of the WebUI, as well as to reload it
* SendTx tab of WebUI refreshed Address Book using Ajax and addrs.xml
* Fixes and additional test cases around parsing of alert messages
* Added unit tests for "sighash.json" from the satoshi's repo and some more unit test rework
* A link to the user manual (served at google sites) in the header of each WebUI page

0.9.6 - 2014-04-02
* Client has a hammering protection (bans peers that keep trying to reconnect)
* Miners tab of WebUI does not show crap anymore is the chain isn't up do date.
* MakeTx tab of WebUI calculates estimated transaction size after signed (assumes compressed keys)
* Downloader can work with testnet and got a fix around an empty peers db after the headers stage
* New function "tools/utils/fetchtx.go", to download raw tx data from other websites
* If neccessary, FetchBal and FetchTx try several websites to fetch a raw transaction data

0.9.5 - 2014-03-24
* "MakeTx" tab of WebUI automatically recalculates the payment values to mBTC (for verification)
* The downloader does not have a default seed node anymore (you need to find one by youself)
* Do not block connections from 129.132.230.70-100 anymore
* Some changes in wallet's decode transaction functionality to better deal with non stardard txs
* "wallet -d <txfile.txt>" ignores spaces, tabs and EOLs in the hexdump of the transaction

0.9.4 - 2014-03-20
* The default "FeePerByte" changed from 10 to 1 (like they have done it in the reference client)
* The "-d" option of the wallet can now proparly decode coinbase transactions
* The client can work with multisig address description JSON files (place them in "wallet/multisig")
* Having the files in "wallet/multisig", MakeTx tab of client's WebUI can now create "multi2sign.txt"
  ... for the wallet, even properly mixing inputs from different addresses and address types.
* For multisig payments, "payment.zip" from the client contains "multi2sign.txt" and "multi_pay_cmd"
* The wallet can now deal with mixed (multisig and regular) inputs

Actually looking for the JSON files in "wallet/multisig" (added in 0.9.4) is a good stuff - quite convenient way of preparing multisig transactions for spending.
If I'd only used it myself... :) But if you are into multisig, have a look at this - you won't regret, I promise.

From other things, there is an updated User Manual (http://www.assets-otc.com/gocoin/manual), which I have spent some time on today. I described the WebUI and the client's config file. I believe it covers now the most important things on how to use gocoin, but I am open for any suggestions. I mean, it's kind of hard to write a manual for something that you know everything about, because you built it. So if you had any questions that it doesn't cover, or some feedback about parts that are not clear, I'd be happy to address it.

Also, apparently somebody reads this topic, because even though I wasn't asking for it the mods (https://bitcointalk.org/index.php?topic=560755.0) gave me back my Gocoin (https://en.bitcoin.it/wiki/Gocoin) article on our wiki.
So if you'd like to contribute into that article, feel free. Just don't delete it to replace it with your ads, please - this time I already know where to go ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: blackvoice on April 21, 2014, 08:22:50 AM
If anyone is interested in my original implementation of a bitcoin client, feel invited to try Gocoin.

You can find the official webpage of the project at: http://www.assets-otc.com/gocoin/ - there is the User Manual and a lot of other info.

The source code is available at GitHub: https://github.com/piotrnar/gocoin

There is also a wiki article: https://en.bitcoin.it/wiki/Gocoin (feel welcome to contribute to it)

I provide no binaries, but building the client using Go compiler is quite an easy operation and unlike other bitcoin clients this one builds in a second. Just follow the instructions from README.md (https://github.com/piotrnar/gocoin/blob/master/README.md)


General info
  • The solution is fully functional, but I like working on it, so please keep in mind that the HEAD is a work in progress and will probably always be. The source code gets tagged regularly, so if anything does not work for you with the latest version, try the previous tag. The database format is not supposed to change.
  • For me it is far more convenient solution than a cold wallet based on satoshi client, because gocoin's wallet does not need a full copy of the blockchain in order to spend its coins.
  • It also works with testnet, so you would probably prefer to start your gocoin adventure from it (use "-t" switch at the command line, for both client and wallet).
  • You do not need the client in order to use the wallet. You can use use FetchBal tool to fetch the balance of the addresses you own (read more here (https://bitcointalk.org/index.php?topic=199306.msg3414806#msg3414806)).

Client (the online bitcoin node)
  • It is a console application, like bitcoind, but it does not have an RPC interface. Instead it provides a text command interface (TextUI) and a web interface (WebUI) by default available at http://localhost:8833/.
  • The blocks on your disk are compressed, which saves about 30% of space.
  • If you have an existing Bitcoin database in the default folder, it is able to import the blocks from it at the first start. To do it later, delete gocoin folder from your bitcoin's data folder. You can also have a look at the importblocks tool.
  • TextUI provides defrag command, that purges orphaned blocks from the database.
  • Make sure your PC's clock is set more or less accurately (few minutes difference should be fine).

Wallet (secure your money offline)
  • It is a separate app meant to be used as a deterministic cold wallet (on an offline PC), though if you don't mind the risks nothing can stop you from using it on the online PC.
  • It has very little system requirements and should even work on platforms like Raspberry Pi.
  • The wallet's security does not rely on any random number source.
  • It is console only and does not have any user interface. Any operations on the wallet are driven by command line switches, plus you can put some defaults in a config file.
  • The wallet's private key pool is based on a seed-password, so as long as you remember it you don't need any backups (some people call it a brain-wallet).
  • Since the seed-password is basically a straight forward private key of your coins, make sure that it is complex enough and that nobody is able to peek at it.
  • By default the wallet works with 50 deterministic addresses. If you need more, set keycnt parameter in wallet.cfg to the number you need.
  • In addition to the deterministic key pool, you can import private keys generated elsewhere (they need to be in the base58 format).
  • It supports Type-2 (https://bitcointalk.org/index.php?topic=19137.0) deterministic mode, that allows you to calculate further public keys without having an access to the seed password (see the tool type2determ).
  • From version 0.9.3 it supports multisig addresses
----------------
very nice conception

I will in it


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 09, 2014, 02:05:32 AM
Is it possible to spend an unconfirmed transaction?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 09, 2014, 09:26:05 AM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 10, 2014, 06:13:02 PM
Recently I have reorganized the entire repo quite seriously.
The latest tag is 0.9.13.
There should be some performance improvements, because I moved all the EC math to the internal lib, the one based on ported sipa's code (before only EC_Verify was handled by it).

I also added a support for the stealth addresses - feel free to check it out as well, it's a really cool feature:
http://www.assets-otc.com/gocoin/manual/stealth-addresses

As for the rest; kill me, but all I remember is that there were plenty of useful changes and the time was flying when I was making them... :P

Anyway, I think this code will soon become Gocoin 1.0.0 - finally.
But first I need to test it a bit more, because the recent changes were really huge.
Huge enough to frighten even me.
Still so far it looks well, but if anyone could help me by giving feedback on whether the latest code still works good enough for him, I will really appreciate it.
Just please don't rush it - let it work for at least a day, before saying that it's fine.

Also please be careful - there were changes everywhere, and that includes the wallet part.
Triple check your signed transaction, before broadcasting it, making sure that it actually does what you needed it to do.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: genjix on May 10, 2014, 07:57:48 PM
I tried to install snappy but the page doesn't exist:

https://code.google.com/p/snappy-go/snappy



Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 10, 2014, 08:01:30 PM
I tried to install snappy but the page doesn't exist:

https://code.google.com/p/snappy-go/snappy

code.google.com/p/snappy-go/snappy - it is some kind of weird URL that go uses to call mercurial.
I dont know how they do it, but it works.

Install Mercurial in your OS and then just execute:
Code:
go get code.google.com/p/snappy-go/snappy
It should call "hg" with a proper arguments, download the package and build it.

It works here.

Also, before "go get", you may want to set env variable GOPATH to point to some user folder (so you don't need a root access to store the files).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: genjix on May 11, 2014, 10:52:29 PM
Code:
gocoin@testnet:~$ ls src/code.google.com/p/
go.crypto  snappy-go
gocoin@testnet:~$ cd src/github.com/piotrnar/gocoin/
gocoin@testnet:~/src/github.com/piotrnar/gocoin$ cd downloader/
gocoin@testnet:~/src/github.com/piotrnar/gocoin/downloader$ ls
addr.go  blks.go  hdrs.go  main.go  netw.go  ping.go  README.md  stat.go  usif.go
gocoin@testnet:~/src/github.com/piotrnar/gocoin/downloader$ go build
# github.com/piotrnar/gocoin/secp256k1
../secp256k1/num.go:85: new(big.Int).SetUint64 undefined (type *big.Int has no field or method SetUint64)
../secp256k1/num.go:85: new(big.Int).And(&num.Int, new(big.Int).SetUint64(1 << bits - 1)).Uint64 undefined (type *big.Int has no field or method Uint64)
# github.com/piotrnar/gocoin/others/sys
../others/sys/stuff.go:119: undefined: debug.FreeOSMemory
# github.com/piotrnar/gocoin/qdb
../qdb/db.go:83: function ends without a return statement
../qdb/index_disk.go:58: function ends without a return statement
gocoin@testnet:~/src/github.com/piotrnar/gocoin/downloader$


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 11, 2014, 11:24:14 PM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 17, 2014, 02:18:52 PM
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


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 17, 2014, 02:30:07 PM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 17, 2014, 03:54:42 PM
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


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 17, 2014, 03:55:11 PM
cheers


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 17, 2014, 04:24:12 PM
Do you have any plans to allow scripts in transactions?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 17, 2014, 04:28:42 PM
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 :)

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).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 17, 2014, 04:37:46 PM
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 :)

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



Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 17, 2014, 04:48:44 PM
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 ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 17, 2014, 05:02:42 PM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 17, 2014, 05:10:45 PM
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 :)

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 (https://en.bitcoin.it/wiki/Protocol_specification#tx) that in order for it to work, you would also need to set this:
Code:
tin.Sequence = 0xffffffff
... to a different value.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Tovadnok on May 19, 2014, 12:28:26 AM
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 :)

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 (https://en.bitcoin.it/wiki/Protocol_specification#tx) 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!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 31, 2014, 08:19:00 PM
wallet -raw tx2sign.txt -hashes

wallet -sign <addrN> -hash <hashN>
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 31, 2014, 08:27:26 PM
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")


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 31, 2014, 09:19:36 PM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on June 15, 2014, 03:29:40 PM
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 :)
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 (https://bitcointalk.org/index.php?topic=199306.msg6656727#msg6656727), 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).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: aamarket on June 15, 2014, 05:43:22 PM
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 !


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on June 15, 2014, 05:50:14 PM
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.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on June 18, 2014, 02:12:31 PM
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).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 12, 2014, 11:11:23 AM
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 (http://bitcoin-otc.com/viewratingdetail.php?nick=tonikt).

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: tonikt@assets-otc.com


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: luckcolors on August 21, 2014, 10:03:16 AM
hello piotr_n! :)
i've tried your gocoin client and works perfectly well.
i'm asking if you can add to the downloader an function to select a different type of database.
because i need to download the blockchian in the normal bitcoin format for creating  my bootstrap.dat files (also my normal bitcoin client is so slow , it does like a block per minute) also go coin i think is the only bitcoin client that have an downloader for the blockchian that i've found on the webs.
i'll really appreciate if you add this function to the downloader or creating a tool for that. :)
Thanks In Advance :D
(sorry for my mispelling errors i'm not english)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 21, 2014, 10:33:10 AM
i'm asking if you can add to the downloader an function to select a different type of database.
sure I can.
the problem is that testing this would be very time consuming, so I am not very keen to start working on it, considering that it'd take lot of my time giving me back nothing I need myself.

but I will keep your request in mind and see what I can do.
cheers


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 23, 2014, 11:53:57 AM
as for the downloader producing the files for the bitcoin core.

what I can do quite easily is to add a command to write the current gocoin's block database as the bootstrap.dat file.
though, I don't know how much it would help you, since importing bootstrap.dat into bitcoin-qt is also quite painful.

playing with bitcoin-qt's chain/wallet state databases is just too much hassle for me - I won't do it, sorry.

anyway, if anyone would find such a feature (creating bootstrap.dat) useful, just let me know and I will add it.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: luckcolors on August 23, 2014, 12:37:08 PM
I need the bootstrap.dat function for creating my personal blockchian backups i'll really appreciate if you add this function.
Anyway i think the downloader needs a tweak because it uses way to much ram in my machine windows 7 64bits 4gb ram it makes the pc slow when the ram usage comes to 90%/95% . anyway the cpu usage is fine it's just 10%. :) (And yes i've compiled using the gcc in go)
Thanks in Advance


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 23, 2014, 02:42:42 PM
Check out this tool: https://github.com/piotrnar/gocoin/blob/master/tools/bootdat_qt.go
Just tell it where is the gocoin's folder with the blockchain.dat + blockchain.new files and it will create the bootstrap.dat (in the current dir).

As for the memory consumption, I am aware of this issue. And that is why I have 12 GB on of RAM :P
I could try to tweak the garbage collector settings, but it will decrease performance in systems that have more memory.
You can actually play with the settings yourself - it is "-g" command line switch.
You can also try playing with "-m" and "-n".

Although, if you need the downloader only to produce the bootstrap.dat later, just start it with "-b" - that should help.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: luckcolors on August 24, 2014, 11:17:31 AM
Ok thanks for helping me !
I'll checkout the tool and i let you know if there are problems.
i'll also check the ram settings.  :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: virtualmaster on August 31, 2014, 04:15:28 PM
Just a question.
The password-seeding uses a known algorithm like that from elektrum or armory or it is an own schema ?
Thanks.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 31, 2014, 04:59:54 PM
Just a question.
The password-seeding uses a known algorithm like that from elektrum or armory or it is an own schema ?
Thanks.

The default type 3 is my own schema. It goes like this:

Code:
seed_key = SHA256(SHA256(password)) /*the master seed*/
for n:=0; n<number_of_keys; n++ {
  priv_key[n] = SHA256(SHA256(seed_key))
  seed_key = append(seed_key, byte(n))
}

Type 1 and 2 are also my own schemas, though they use different algos.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: virtualmaster on August 31, 2014, 06:40:14 PM
Just a question.
The password-seeding uses a known algorithm like that from elektrum or armory or it is an own schema ?
Thanks.

The default type 3 is my own schema. It goes like this:

Code:
seed_key = SHA256(SHA256(password)) /*the master seed*/
for n:=0; n<number_of_keys; n++ {
  priv_key[n] = SHA256(SHA256(seed_key))
  seed_key = append(seed_key, byte(n))
}

Type 1 and 2 are also my own schemas, though they use different algos.
Thanks for the answer.
Having compatibility with a known schema has the advantage having additional security if the wallet development abruptly disappears or some bugs appear making temporary unusable the software.
It is also more flexible if I could use for ex. elektrum and combining sometimes with gocoin just generating the seed containing my coins.
For example armory is a little bit heavy but I can generate a tree quickly from my seed with a brainwallet(for ex. brainwallet.org supports it), receive payments on the generated tree addresses and later I could import the seed in armory.
A different, new schema could have sense if presents some advantages which balances the lack of compatibility.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on August 31, 2014, 06:51:29 PM
Having compatibility with a known schema has the advantage having additional security if the wallet development abruptly disappears or some bugs appear making temporary unusable the software.
It is also more flexible if I could use for ex. elektrum and combining sometimes with gocoin just generating the seed containing my coins.
For example armory is a little bit heavy but I can generate a tree quickly from my seed with a brainwallet(for ex. brainwallet.org supports it), receive payments on the generated tree addresses and later I could import the seed in armory.
A different, new schema could have sense if presents some advantages which balances the lack of compatibility.

I have the wallet's type in the config file (so far only 1,2 and 3 are used) and I can add other algos easily.
I wouldn't mind adding new types (compatible with armory, electrum, or anything else), but the main problem is that none of it seems to be documented and there isn't really one established standard for it.
The HD wallets might be a good way to go on with a standard, though they don't seem to cover the calculation of the initial vectors from the seed password.

So it is an open topic and I think the software will eventually evolve to support other types of deterministic wallets, but I just don't want to add any new types without some strong user cases, because it would only create more mess.

But the code is open and fairly simple, so if anyone wants to put in his own method, just play with the function make_wallet(), in file gocoin/wallet/wallet.go
It is a dangerous place to play with, so feel free to post your changes here for an audit.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on July 31, 2015, 01:24:21 PM
Despite of no update in this topic for almost a year, I want to assure that gocoin project is doing fine; being maintained and updated.

The last tagged version (1.2.0) already supports BIP66. Everything else is in the changelog file.
It's been my only bitcoin node for a long time so I can guarantee that it's fully functional and pretty cool. :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: max.max on February 08, 2016, 07:20:06 AM
Despite of no update in this topic for almost a year, I want to assure that gocoin project is doing fine; being maintained and updated.

The last tagged version (1.2.0) already supports BIP66. Everything else is in the changelog file.
It's been my only bitcoin node for a long time so I can guarantee that it's fully functional and pretty cool. :)

Hi, do you have any idea how many running nodes currently live?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 08, 2016, 08:51:33 AM
Hi, do you have any idea how many running nodes currently live?
No idea.

But at least mine.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 08, 2016, 09:02:05 AM
BTW, sorry for neglecting the development recently, but I've been traveling for awhile, mostly into places with shitty internet.

I'll be back home soon and I plan to work on headers-first syncing and segregated witness functionality, among others.

I've been also thinking on changing we web interface in a way that I can have the client node running on some VPS server while my wallet files would be fed to it from the browser (connecting there via sshd tunnel) whenever I need to check/fetch the balance.
During my travels I found it very inconvenient to re-synchronize the blockchain at my laptop's client, each time I was arriving at a new hotel (usually after a couple of days of no wifi access).
So I want to have a node running somewhere 24/7 but without the wallet files being stored there, as I don't like an idea that some Amazon or other company would be able to lurk at this data.

So stay tuned - Gocoin is not dead ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 03, 2016, 01:04:36 PM
So back to work and currently I'm busy testing 1.5.0 before tagging it.
There have been loads of changes.
Among them headers-first syncing with support for BIP-130.

I also added plenty of stuff related to the memory pool monitoring and calculation of proper fees - it's becoming more and more useful/needed.

So now you can e.g. see stats like this:
https://i.imgur.com/2rYwTfs.png

From the wallet's side, new transactions are by default created with a non-final sequence number (by default it's current unix time value), so their fee can be increased later (see BIP125)

I have not implemented BIP125 in at the node's memory pool yet.
I haven't seen many RBF transactions in the network, so I will just do it somewhere later, having more live stuff to test it against.

Same with Segregated Witness - I will wait for it to come live on the network and then add it to Gocoin.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 03, 2016, 05:01:49 PM
Sorry, I forgot to add that I added the Browser Wallets feature.
It does not require a wallet file to be stored within the node's file system anymore.
I use it with nodes which I run remotely, on VPS.

It takes a few seconds to load a web wallet for the first time, so expect some lags launching WebUI having had a browser wallet selected.

It is actually a pretty cool thing.

The setup I use myself is the node running on some ~20EUR/month VPS.
I connect there via ssh, tunneling the WebUI's port number (8833) through it.
Then I just the webui via http://127.0.0.1:8833

So the node is running on some external server and the wallet is in my house.
Well, actually the wallet app is in my house and the actual wallet (the seed password) is only in my head :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 30, 2016, 11:30:35 AM
I'm about to release 1.6.0 that has got some cool new features, which you can briefly read about int the changelog (https://github.com/piotrnar/gocoin/blob/master/changelog.txt).

Upgrade is highway recommended as all the versions up to (including) 1.5.0 have had a serious security issue, which I prefer to not talk about because it's just embarrassing. :)

As for the new features.

There is a basic RPC API, implementing functionality required for mining. It is compatible with bitcoind's API and so far has been tested successfully on testnet3 with ckpool mining software.

The Home, Network and Transaction pages of WebUI shows nice graphs: http://imgur.com/a/eq1AH

The node counts sigops inside transactions and blocks.

The new tool bdb allows to play (extract/add blocks, check integrity) with the block's database. Also allows to defragment the db without a need to have the double space on the disk.

UTXO database can now work in a "volatile mode" where it only writes changes to disk when exiting. Use -v switch for either client or downloader to trigger it. The qdb enginie has also changed a bit and now it writes any pending changes on disk much faster.

You can also start the client with "-undo <n>" switch, which will cause the node to undo the last n blocks (on the UTXO db) and exit.

The most recently added is the feature that looks for "libbitcoinconsensus.so" or "libbitcoinconsensus-0.dll" (depending on host OS) and if found uses the function from it to cross-verify each transaction.
So far it hasn't found any mismatches. Use TextUI command cons to see the stats of the cross-checking.


I would also like to mention that the recent versions of Gocoin have no external dependencies and should build out-of-the-box.
Just make sure to have 64 bit OS and at least 6GB of RAM (it's swapping too much slow less memory). In peaks (especially when rebuilding the UTXO db) it may even need more memory. But normal node, working on a synchronized chain, should never use more than 4GB.

I also strongly advise to use downloader to sync up the block chain - it's really fast as it doesn't verify transactions.  
Theoretically it is less secure, but there is no way to exploit it, if you only check the hash of the last block it assumed trusted.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 08, 2016, 12:44:58 PM
Hi, out of curiosity, did you check your node against the bitcoin regression tests?

https://github.com/TheBlueMatt/test-scripts

--h


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 08, 2016, 01:12:49 PM
Hi, out of curiosity, did you check your node against the bitcoin regression tests?

https://github.com/TheBlueMatt/test-scripts

--h


I would not know how to use that tool as I'm not a very big fan of java, but I can say that Gocoin is being checked against the official core's test vectors for transaction and scripts - both valid and invalid:
https://github.com/bitcoin/bitcoin/tree/master/src/test/data
https://github.com/piotrnar/gocoin/tree/master/lib/test

And recently I added a functionality that is (optionally) using the consensus lib (which came with core 0.12.0) to cross-check every transaction.
I have been using it ever since and there have been no mismatches observed so far.

The biggest potential risk of an incompatibility is in verifying of entire blocks - checks that are only executed on a block level.
Like recently I found that I wasn't checking for the maximum number of sigops - which bitcoin core limits to 20000/block.
Some other time I found that I wasn't checking for the coinbase transactions to be "mature" while verifying blocks that spend them.
Then there was no check of the timestamp against the median time of the last 11 blocks.
Few other things, some of them I don't even remember...

The odds are that there are still some check on the new blocks that bitcoin core does, which gocoin doesn't (yet), but I am unaware of any specific cases.

If anyone finds such, please report.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 02:51:05 AM
These test scripts would have exposed all the problems you mentioned. They focus on block validation and reorganization.  You don't have to be a Java expert because the tool acts as a peer to which your node connects.
I have briefly looked at your code and noticed a few odd things but I didn't do a throughout review.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 07:21:03 AM
You don't have to be a Java expert because the tool acts as a peer to which your node connects.
So how do I run it?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 09:16:14 AM
Install a jdk, compile and run.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 09:48:17 AM
I think I've got it - thank you!

Will let you know how the tests go.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 10:07:24 AM
No problem. A few things not covered by the scripts that could be worth checking:
- the best chain is not necessarily the one with the highest height but the one with the most cumulative proof of work,
- difficulty readjustments are capped by +/- n % (I don't remember how much),


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 04:07:46 PM
Sorry, maybe I'm crazy or stupid, but I think this tool is somehow broken.

I spent a couple of hours on it already; I don't see what Gocoin would be doing wrong at this specific moment...
I have no idea why the tool says BitcoindComparisonTool.main: Block "b8" completed processing - and then ends without a word.

Log from the tool:
Code:
05:47:31 1 BitcoindComparisonTool.main: Testing block b1 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771) -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Block "b1" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b2 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Block "b2" completed processing
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Testing block b2 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b2" completed processing
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 BitcoindComparisonTool.main: Testing block b3 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 AbstractBlockChain.connectBlock: Block forks the chain at height 101/block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1, but it did not cause a reorganize:
7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b3" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b3 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:31 1 BitcoindComparisonTool.main: Block "b3" completed processing
05:47:31 1 BitcoindComparisonTool.main: Testing block b4 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
05:47:31 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4) -> 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 101
05:47:31 1 AbstractBlockChain.handleNewBestChain: Old chain head: 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:31 1 AbstractBlockChain.handleNewBestChain: New chain head: 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 1 AbstractBlockChain.handleNewBestChain: Split at block: 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:31 1 BitcoindComparisonTool.main: Sent inv with block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: ERROR: bitcoind and bitcoinj acceptance differs on block "b4"
05:47:32 1 BitcoindComparisonTool.main: Block "b4" completed processing
05:47:32 1 BitcoindComparisonTool.main: Testing block b5 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 AbstractBlockChain.add: 6 blocks per second
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1) -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2) -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 AbstractBlockChain.connectBlock: Block forks the chain at height 101/block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1, but it did not cause a reorganize:
3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: ERROR: bitcoind and bitcoinj acceptance differs on block "b5"
05:47:32 1 BitcoindComparisonTool.main: Block "b5" completed processing
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 1 BitcoindComparisonTool.main: Testing block b6 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:32 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 101
05:47:32 1 AbstractBlockChain.handleNewBestChain: Old chain head: 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf
05:47:32 1 AbstractBlockChain.handleNewBestChain: New chain head: 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.handleNewBestChain: Split at block: 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8) -> 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Block "b6" completed processing
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 BitcoindComparisonTool.main: Testing block b7 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 1 AbstractBlockChain.connectBlock: Block forks the chain at height 103/block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8, but it did not cause a reorganize:
4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8) -> 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: Block "b7" completed processing
05:47:32 1 BitcoindComparisonTool.main: Testing block b8 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 AbstractBlockChain.connectBlock: Block is causing a re-organize
05:47:32 1 AbstractBlockChain.handleNewBestChain: Re-organize after split at height 103
05:47:32 1 AbstractBlockChain.handleNewBestChain: Old chain head: 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
05:47:32 1 AbstractBlockChain.handleNewBestChain: New chain head: 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 AbstractBlockChain.handleNewBestChain: Split at block: 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0) -> 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 1 DatabaseFullPrunedBlockStore.abortDatabaseBatchWrite: Warning: Rollback attempt without transaction
05:47:32 1 BitcoindComparisonTool.main: Sent inv with block 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1
05:47:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got empty header message from bitcoind
05:47:32 1 BitcoindComparisonTool.main: Block "b8" completed processing


Log from Gocoin :
Code:
Commiting block 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1 -> 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771
 - New TOP 101
Current last 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 635e870a77419af8cd8fc1a56b45d7e54846707559c61dd454c088dbf09be771   found: true
 returning header of block 101 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
sending back 1 headers


Commiting block 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - New TOP 102
Current last 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1   found: true
 returning header of block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
sending back 1 headers
GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers


Commiting block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - Orphaned 102
Orphaned block: 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB
Current last 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers


Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Commiting block 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8 -> 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2
 - Orphaned 103
Orphaned block: 103 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8 0 KB
WARNING: the fork is 2 blocks deep
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
 returning header of block 103 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
sending back 1 headers


Commiting block 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
Undo block 103 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf 0 KB
Undo block 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB
 - New TOP 104
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8   found: true
 returning header of block 104 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb
sending back 1 headers


Commiting block 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 -> 3e58cc4ad076bb0e3fb823c7e802a58119c938cd3f306a34a893a4ae01b4c1a8
 - Orphaned 104
Orphaned block: 104 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 0 KB
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb   found: true
sending back 0 headers


Commiting block 6919e48b3b892549ff1229491a82b4942ca4f6380a9bd9fbe3c953011a2bcca1 -> 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0
Undo block 104 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb 0 KB
ProcessBlockTransactionsB 4797c6105b7fa7474db3998df6e61a4dc5b164d51509cc38824f8eccd8253fa0 104 Unknown input TxID: 7bb7718103fe4dc0287b50f1aa390f9542dc3441d40c826bbc98a23bb16f2679
ParseTillBlock failed - go back to 104
Current last 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 7dbea1c7540a80c216a6b9612ce84a65302bbce95236a8ab47ac1f7bd7c580fb   found: true
sending back 0 headers


HandleError: read tcp4 127.0.0.1:18444->127.0.0.1:49999: wsarecv: An existing connection was forcibly closed by the remote host.
Disconnect from E:/DEV/GOPATH/src/github.com/piotrnar/gocoin/client/network/core.go 346
closing connection true false


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 04:21:18 PM
It's also not very stable.

Sometimes it gets stuck in some infinite loops like:
Code:
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
[...]
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149
06:17:52 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 6b81558bbf532017db214d7996339c7d798a2644265e962196eaf681c2dad149

I wish it was working, because it could indeed be very helpful, but there are just so many issues with this tool that it seems more like a waste of time, rather than a help.

But I will try to work some more on it - fix it or something... will keep you updated.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 06:12:36 PM
Search for  Error because the tool continues for a while after a failure. You got a problem at block b4. This tool is truly a pain to use though. B4 should have caused a reorganization but your node stayed on the same fork.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 06:22:40 PM
Search for  Error because the tool continues for a while after a failure. You got a problem at block b4. This tool is truly a pain to use though. B4 should have caused a reorganization but your node stayed on the same fork.

OK... that's helpful - thank you.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 07:14:39 PM
Actually, I think the problem comes from B3 (7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4).

Code:
Commiting block 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 -> 104cbafb5906c7b9fe28eba9b288eea1acec306320c53cd49ac1a5dd0e673ce1
 - Orphaned 102
Orphaned block: 102 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4 0 KB

That one shouldn't be orphaned because

Code:
        // We now have the following chain (which output is spent is in parentheses):
        //     genesis -> b1 (0) -> b2 (1)
        //
        // so fork like this:
        //
        //     genesis -> b1 (0) -> b2 (1)
        //                      \-> b3 (1)
        //
        // Nothing should happen at this point. We saw b2 first so it takes priority.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 07:25:34 PM
But is says "We saw b2 first so it takes priority."
So b3 should be orphaned...
Or not?



Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 07:39:35 PM
Oops, you are right. I thought that was b2.

How about:

Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 07:46:05 PM
Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?
I don't think so, because 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 has no children.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 09, 2016, 08:24:36 PM
Code:
Commiting block 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf -> 7cd3ee22eab70c6bc23fe7d43c19a797eb9529e9c9bc71aaca6c8b9f9c3496f4
Undo block 102 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 0 KB
 - New TOP 103
Current last 0b1c05438c178aa1976b713a0b794d705f955b99236a2bcc9cd8609b68db92bf

GetHeaders 1 up to 0000000000000000000000000000000000000000000000000000000000000000
 ? 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2   found: true
sending back 0 headers

Isn't it supposed to return the new fork?
I don't think so, because 748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 has no children.


748223dc39df65a8c88ef9af80f98cbf130a2f8cfdf1900ff84f1bcf1fcc04b2 is no longer on the main chain, so you're supposed to ignore it and try the next locator. getheaders/getblocks are used by your peers to get the main chain, they don't care about forks.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 09, 2016, 10:47:59 PM
but there is only one locator in that getheaders request
it'd print them all, but there was only one.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 10, 2016, 02:40:09 AM
In that case, the node is supposed to return headers starting from the genesis block. The relevant code of bitcoin core is in main.cpp (line 4886-)

Code:
        if (locator.IsNull())
        {
            // If locator is null, return the hashStop block
            BlockMap::iterator mi = mapBlockIndex.find(hashStop);
            if (mi == mapBlockIndex.end())
                return true;
            pindex = (*mi).second;
        }
        else
        {
            // Find the last block the caller has in the main chain
            pindex = FindForkInGlobalIndex(chainActive, locator);
            if (pindex)
                pindex = chainActive.Next(pindex);
        }

...

CBlockIndex* FindForkInGlobalIndex(const CChain& chain, const CBlockLocator& locator)
{
    // Find the first block the caller has in the main chain
    BOOST_FOREACH(const uint256& hash, locator.vHave) {
        BlockMap::iterator mi = mapBlockIndex.find(hash);
        if (mi != mapBlockIndex.end())
        {
            CBlockIndex* pindex = (*mi).second;
            if (chain.Contains(pindex))
                return pindex;
        }
    }
    return chain.Genesis();
}


I have no clue why there is a different behavior if the locator is null.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 08:49:52 AM
OK, if that's what it takes... let move on

I did the change in handling getheaders.
Now it can stop in two different ways - I will just focus on the first one.

Gocoin's debug:
Code:
Commiting block 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04 -> 2858fd7dec9ee514ef1c4dd76beb97e91f6513f1b2afe3f6f755c3843607f74f
 - New TOP 99
Current last 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
cmd headers 82
cmd inv 37
got block inv 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
InvBlockOld
cmd inv 37
got block inv 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
InvBlockOld
cmd block 179
cmd getheaders 69


Commiting block 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93 -> 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
cmd ping 8
 - New TOP 100
Current last 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
cmd headers 82
cmd inv 37
got block inv 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
InvBlockOld
cmd inv 37
got block inv 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
InvBlockOld
cmd block 323
cmd getheaders 69
cmd ping 8


Commiting block 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5 -> 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
cmd headers 82
cmd inv 37
got block inv 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
InvBlockOld
cmd block 324
 - New TOP 101
Current last 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
cmd inv 37


Commiting block 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e -> 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
got block inv 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
InvBlockOld
 - New TOP 102
Current last 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
cmd getheaders 69
cmd ping 8
cmd inv 37
got block inv 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
InvBlockOld


Tool's debug:
Code:
10:39:31 1 BitcoindComparisonTool.main: Testing block Initial Block chain output generation 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 2858fd7dec9ee514ef1c4dd76beb97e91f6513f1b2afe3f6f755c3843607f74f
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (2858fd7dec9ee514ef1c4dd76beb97e91f6513f1b2afe3f6f755c3843607f74f) -> 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 1 BitcoindComparisonTool.main: Sent inv with block 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 1 BitcoindComparisonTool.main: Block "Initial Block chain output generation" completed processing
10:39:31 1 BitcoindComparisonTool.main: Testing block Initial Block chain output generation 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04
10:39:31 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (66fe0adc6e2043ebd68d0f17cc1b96a5dc8f75dfa5ffa2ec126c8348a8e3ea04) -> 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:31 1 BitcoindComparisonTool.main: Sent inv with block 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:32 1 BitcoindComparisonTool.main: Block "Initial Block chain output generation" completed processing


10:39:32 1 BitcoindComparisonTool.main: Testing block b1 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (4aa43a46282751bf1a875bfc0c3a8c05da948736253f87e9846a556bf7588d93) -> 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 1 BitcoindComparisonTool.main: Sent inv with block 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 1 BitcoindComparisonTool.main: Block "b1" completed processing


10:39:32 1 BitcoindComparisonTool.main: Testing block b2 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Sending header (1fd4823e456bb6bb9bcc757c67ec3456dee4bc6119eea94f09ff24a2afd8c1c5) -> 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Requested 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 1 BitcoindComparisonTool.main: Sent inv with block 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Got header from bitcoind 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 1 BitcoindComparisonTool.main: Block "b2" completed processing
10:39:32 1 BitcoindComparisonTool.main: Testing block b2 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 1 AbstractBlockChain.add: 6 blocks per second
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 1 BitcoindComparisonTool.main: Sent inv with block 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:32 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:33 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:34 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:35 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:36 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:37 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:38 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 1 BitcoindComparisonTool.main: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
10:39:39 17 BitcoindComparisonTool$1.onPreMessageReceived: Found header 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
It gets stuck in a loop like this.


Basically what is happening:
*) I receive "header" with "b2" (797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e) and I issue "getdata" for it
*) I receive "inv" for "b2" - 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e and ignore it (as the block is being downloaded)
*) I receive "block" for 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
*) I process the block and accept it as the new head: Current last 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e
*) I receive "inv" for "b2" - 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e and ignore it (as the block is already known)
*) The tool gets stuck in the loop, printing: bitcoind still hasn't requested block b2 with hash 797f9966e1d76b53b41167e4d05134f9216da0b941feed3578f1a446bdc9828e


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Colt22 on April 10, 2016, 09:30:12 AM
nice old wallet... from 2013 :D it means is a stable one?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 09:33:19 AM
nice old wallet... from 2013 :D it means is a stable one?
Most of the tags are stable :)

See by yourself.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 09:51:35 AM
OK, if that's what it takes... let move on

I did the change in handling getheaders.
Now it can stop in two different ways - I will just focus on the first one.

When I add some delays, here and there, I can work around this first issue, so let's fast forward..

I changed the behaviour of "getheaders" - now it gets blocks from the genesis when locator isn't found.
Still the end result is similar to what I had before.
It report error after "b4" and "b5" and terminates after "b8".

test tool: http://pastebin.com/YpkHJMeW

gocoin: http://pastebin.com/QdUCHZrH

I honestly don't know what is its problem with b4 - I think the branch is swapped just as it should be.
I believe the issues I'm experiencing are not related to the consensus rules, but only to the network protocol's behaviour.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 10, 2016, 09:57:55 AM
The tool uses an ugly hack to work around timing issues. Bitcoind processes commands in sequence so the tool sends a ping and waits for a pong. At that time bitcoind has finished processing previous commands and reorgs have taken place. This won't work if your implementation handles ping/pong in parallel.

The pastbins are truncated. Actually the first 100 blocks are not interesting. You could edit that part out.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 10:08:55 AM
Thank you. That's very useful information. I guess I can somehow imitate it, for a purpose of the test.

I's also sending empty invs - I'm assuming this is also supposed to serve some purpose..

Either way, I think now my biggest mistery is what it doesn't like about the "b4"

test tool: http://pastebin.com/YpkHJMeW

gocoin: http://pastebin.com/QdUCHZrH


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 10:16:05 AM
Do you know if it is possible to just make this tool output the sequence of blocks and do not talk to my node at the network?



Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 10, 2016, 10:24:37 AM
It creates such a file every time your run it. That's why it takes a while to startup.

Code:
        File blockFile = File.createTempFile("testBlocks", ".dat");
        blockFile.deleteOnExit();

Change these lines and you can keep the file around.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 10, 2016, 10:25:28 AM
The pastbins are truncated. Actually the first 100 blocks are not interesting. You could edit that part out.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 10:30:17 AM
The pastbins are truncated. Actually the first 100 blocks are not interesting. You could edit that part out.
Sorry - haven't noticed.

Thanks, I find the blocks file - will try to feed it to node and see...
Think it's an easier approach, as achieving network compatibility with this tool is not my goal.
But I want to get the block consensus tests out of it.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 10, 2016, 12:53:10 PM
Ok. It's a bit tricky because the block file doesn't have the expected state of the blockchain, just the block data.

In a previous project, I actually did the same thing. You may want to take a look at https://github.com/hhanh00/bitcoin-akka-tutorial
I patched the test generator so that it writes out the chain state and hook up a test driver.




Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 10, 2016, 02:46:07 PM
It's a bit tricky because the block file doesn't have the expected state of the blockchain, just the block data.
Yes, I know.
I have been testing it manually, going down the source code.
The code says whether a specific block is expected bo be accepted or rejected (the second parameter to BlockAndValidity)

At this moment all up to block #55 is OK.
Then there are some timestamp tests and things get complicated..
But so far so good.

Cheers


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 11, 2016, 10:55:52 AM
OK... After a several changes in Gocoin, currently it does everything up till (including) b89.

Two blocks do not return the expected result:

b48 - block with the time stamp more than 2 hours in the future.
I cannot properly against the blocks data from the disk, but I trust I didn't screw up this check.

b61 - same ID of a coinbase TX.
I'm not going to be adding a check for this, as it can only happen with v1 bocks, which are long gone.

In a future, when I find some more time, I will try to somehow fix the tests tool; make it stable and test all my further gocoin releases against it.
Will also do the remaining "massive reorgs" tests...


Thank you once again, @hhanh00 - I really appreciate your input.
It helped me to find (and fix) another few compatibility issues, on the blocks checking.
Some of the checks in Gocoin were too strict (e.g. b64), others (e.g. b66) were not strict enough.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: hhanh00 on April 11, 2016, 02:27:03 PM
No problem, you're welcome.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: fronti on April 13, 2016, 09:33:25 AM
nice client and the downloader is really fast, cool work!

but a question, i see that you "only" support ipv4 in the client. will you plan to support ipv6 also?
Then I can setup some more nodes :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 13, 2016, 05:38:08 PM
thanks. ipv6 suport will eventually come. it just hasn't' got high enough priority so far.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 14, 2016, 01:45:36 PM
OK... After a several changes in Gocoin, currently it does everything up till (including) b89.

Two blocks do not return the expected result:

b48 - block with the time stamp more than 2 hours in the future.
I cannot properly against the blocks data from the disk, but I trust I didn't screw up this check.

b61 - same ID of a coinbase TX.
I'm not going to be adding a check for this, as it can only happen with v1 bocks, which are long gone.

In a future, when I find some more time, I will try to somehow fix the tests tool; make it stable and test all my further gocoin releases against it.
Will also do the remaining "massive reorgs" tests...


Thank you once again, @hhanh00 - I really appreciate your input.
It helped me to find (and fix) another few compatibility issues, on the blocks checking.
Some of the checks in Gocoin were too strict (e.g. b64), others (e.g. b66) were not strict enough.

A friend of mine modified the original tool (https://github.com/TheBlueMatt/test-scripts) for me.
Now it's feeding the test blocks (one-by-one) to an external command.

This allowed me to make a simple wrapper for the gocoin library in order to test the blocks compatibility.
All test pass, except for b61, which I am not going to fix as it would decrease performance of the lib, just for the sake of the test. So I implemented a work-around in the wrapper, for this specific test.
All the rest is passing - up till the block "b1004", which is the last one in the test suite.

If anyone would like to test it by himself, or use the java tool my friend made to test their own software, it's all in here:
https://github.com/piotrnar/btc_block_validator

Start the tool using
Code:
java -jar bitcoin.jar 
.. it will be executing a command next_block.exe in the current folder for each new block.
The block is always in file named dupa.bin - just ignore the first 8 bytes.
Additionally next_block.exe is called with 5 command line arguments. One of them is the hash of the top block expected to be after the block processing is done - that's how you verify whether the block from dupa.bin is properly processed/rejected.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on June 28, 2016, 12:27:12 PM
Just want to let everyone know that with the new HEAD (to become version 1.7.0) there is kind of a major change in the node.       

The node client does not keep any wallet data anymore - not in the file system, nor it RAM.
Instead the wallets' public addresses are stored in the LocalStorage, on the browser that operates node's WebUI.
The improvement is that a balance of any (P2SH or P2KH) address can be fetched instantly.
Balances of specific wallets are now fetched by the browser while loading a relevant page (Wallet or SendTx) of the WebUI.
The content of the HTTP request (list of addresses) is not stored at the node's side.

At this moment you can only fetch balance of P2SH and P2KH addresses - the support for stealth addresses has been turned off.
Additionally, all the wallet features have been disabled in TextUI.

Because it needs to build the database of all the addresses and their balances, the node launches significantly longer now.
It also requires more RAM - I changed the RAM requirement to 8GB.

Please note that (to save memory and improve performance) by default the balance database does not account for unspent outputs with less than 0.001 BTC.
You can change that by modifying the config value "AllBalances.MinValue" (set it to 1 to have everything listed).


I believe this is a change in a good direction.
It allows multiple users (wallet owners) to share the same gocoin node; improves performance of fetching the balances, as well as the privacy by not storing the content of the requests.

If you like the old functionality (with stealth addresses and wallet files stored at the server), checkout version 1.6.4


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on September 28, 2016, 12:59:48 PM
Just a quick update on the latest development, to let you know that I am still alive and the project is being maintained :)

The latest release 1.7.2 comes with some nice features.

I've been happy to learn that the core team finally did something to speed up the blocks' propagation - that came with 0.13.
Therefore with pleasure, I have implemented BIP-152 into Gocoin - I love this new method.

I've also optimised the algorithm of dropping worse (slowest) peer, in order to be connected to the best performing ones.
Now it considers not only the ping, but mostly the number of a new blocks we have received from a peer.

The full list of changes, as always, in the changelog.

https://i.imgur.com/qqdtP1k.png

https://i.imgur.com/mICVNR3.png

https://i.imgur.com/DWA4XL7.png


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: r.o.o.t on September 29, 2016, 03:34:58 PM
Great work you are doing here !
What would you think about decred.org (http://decred.org) from the developers of other golang bitcoin client ?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on September 30, 2016, 03:34:34 PM
What would you think about decred.org (http://decred.org) from the developers of other golang bitcoin client ?

Sorry, I don't have an opinion.

I'm too much involved in my bitcoin stuff and have no time to look into alternative-crypto projects.
I rarely even look in other bitcoin projects - mostly if they have something I might want for myself :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on February 06, 2017, 08:13:23 PM
Sorry for not updating for so long.

I've been travelling for the last couple of months, so no development, just field testing.
It should last for a couple of more months and then I will be back.

Before I left, I made version 1.8.0 - I've just tagged it, as it's been quite stable.
I have it running on my windows laptop and a linux VPS and it has been working fine for the last couple of months.
Once I had to restart it, as it hanged after over 50 days of uptime - I have some ideas why, will try to fix it, but first would like to see it happening again.
Also it well rejected the invalid block mined recently by BU node, although there was also something I will have to look at, as I found one debug of when it happened weird.

Anyway, the current 1.8.0 has segwit support and a few other cool things, and it's stable.
I got rid of the downloader, as the client is now able to sync the chain just as fast (with some additional command line switches).


As for the future development.

When I come back home, I want to make it possible to bootstrap (and further run) the node with only the block headers and a corresponding UTXO snapshot.
Basically it will be possible to run the full node without downloading and keeping the blockchain on the disk.
It will only keep the headers and the UTXO db. At this moment it's about 3GB of data.
Obviously it will be an optional feature and you will still be able to keep (and serve) all the blocks, if you please.

I've been thinking to establish some industry-wide standard for distributing a secured (first by the community signatures, later ideally by the chain protocol itself) UTXO snapshots, but it's not going to happen any soon, as it seems to be involving shit loads of politicking.
So I will just start with my own little solution and see from there, because I find this feature quite necessary already, as new people are very reluctant to try full nodes since they need so much time to bootstrap. Plus the blocks on my travel laptop have already taken so much space that I had to start removing porn, and that's really disturbing ;)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 05, 2017, 03:33:21 PM
I have a new update, but first of all I'd like to know if anyone is actually reading this.
Please let me know if you do and if you'd like to read some updates in this topic, or I won't be wasting my energy on this forum thread.

The 1.9.0 release has some reorgs inside the source code and the architecture in general.
It should perform even better.

Since the UTXO db only gets updated on new blocks, I decided to simply the approach and just keep a snapshot of it on the disk.
It's being flushed to disk after each update (new block), but at a vert low priority so it doesn't take too much system resources.

Now the whole UTXO database is caried by the single UTXO.db file, which is about 2.4 GB big.
When you start the new client, it should convert your old "unspent4" DB to the new format automatically.

Also, if you want to bootstrap a new node, you only need this file and the block headers file (about 60MB).
I can distribute the quick bootstrap files, if anyone is interested.

Which brings me to the point that the recent versions of gocoin node can work with purged blocks database.
If your blocks happen to be taking too much space, just close the client and execute:
Code:
bdb -purgeall
Or:
Code:
bdb -purgeto <block_height>
This will either purge all blocks or only up ot the given height.
Follow the instructions on the screen as you need some extra copying/deleting, just to be safe and not delete you blocks DB by accident.

Again: make sure to not have the client node running while using the bdb tool.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: sgbett on July 02, 2017, 12:45:02 PM
Brilliant presentation at Future of Bitcoin. Your client looks really good, hopefully it will get you some more recognition!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on July 02, 2017, 04:41:25 PM
thank you


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: xcsler on July 03, 2017, 05:51:08 PM
Great presentation at the Future of Bitcoin!


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: LightRider on July 09, 2017, 01:14:46 PM
How can I unban a peer?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on July 09, 2017, 03:50:55 PM
How can I unban a peer?
You can start the client with -unban to unban all peers.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Jace on July 11, 2017, 01:47:02 PM
Hi Piotr, I saw your presentation at The Future of Bitcoin in Arnhem last week (I'm one of the Arnhem Bitcoincity organisers :)) and that was awesome! Very interesting, you're doing great work!

I'd love to set up a new Bitcoin node using Gocoin. Would a Raspberry Pi 3 with Ubuntu be sufficient? I assume it would need to have 16 GB of ram? (is that even possible?) And perhaps a 256 or 512 GB SDcard? Or do you recommend something more powerful, e.g. a barebone miniPC?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on July 12, 2017, 03:34:40 PM
Thanks.

You need at least 8 GB of RAM.
I'm unaware of any raspberry pi having that much.

As soon as you have a Linux board with that much ram, there should be no problem to run gocoin there.
It is possible, but I'm not sure if anything like this (cheap arm cpu board with 8+GB of RAM) is available on the market.

As for the storage space requirement, you can purge blocks database regularly,  in which case 16 GB of storage should be enough.

If you want to keep the entire block chain though, you need about 120 GB, as of today.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on October 30, 2017, 03:53:18 PM
An important announcement, concerning the possible 2x fork next month.

Unlike the other self proclaimed bitcoin experts, my professional opinion is that miners do rule the bitcoin protocol.
A chain with the most POW is the one to follow - that's how the system has been designed and that's the only way it can work securely.
Whether I like this fact or not is irrelevant.

It is somehow likely that starting from block #494784 the majority of the miners will choose to mine 2x bigger blocks.
That is why the current version of Gocoin (not yet tagged, but see the HEAD) is already made to accept 2x bigger blocks, starting from #494784.

If the fork does happen, the node will use the branch with a bigger POW - without discriminating any of the two consensus choices.
If the fork doesn't happen or in a longer term the 2x branch will not get the mining majority, the code consensus change will eventually get removed from the source code.

If anyone does not like it and want to stick to the old rules, you need to edit the file "lib/chain/chain.go" and comment out (remove) the line with:
[q]ch.Consensus.S2XHeight = 494784[/q]

Now, excuse me, I have to go buy some popcorn :)



Edit 11th Nov 2017:
Fork cancelled - consensus changes removed.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Polygora on October 31, 2017, 03:59:34 PM
Thanks for this, really helping me decipher the internals of these technologies.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: bengems on November 23, 2017, 07:56:15 AM
What's up with xgox? Is the development still alive?....because people are dumping their stash without looking back as if there is a bad news on xgox.

What news is causing all the panic sell?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on January 14, 2018, 01:18:53 AM
If anyone is interested, the (not yet tagged) version 1.9.4 of gocoin supports native segwit addresses (the ones in bech32 format).

I've used them for a couple of weeks already and they seem to have been working just fine.
Still, make sure to verify your signed transaction before broadcasting it.

Spending from a native segwit address might cut your transaction fee by as much as half - that's when you have your coins already deposited at a native segwit address.

Let me know if you need a help using it.
Basically "Segwit Deposit Addresses" for your existing (traditional) wallet are automatically shown in the Wallet tab of the web interface.
And you can enter bech32 encoded addresses in the MakeTX tab for output addresses.
Use the new version of wallet app to sign the transaction that either spends from or to a new (bech32 encoded) address.

Obviously, the backward compatible P2SH segwit address types are working as well, but that's a very old news (I think 1.9.0)
Still better to use the native segwit addresses (in bech32 format) as they make fairly cheaper transactions.

As for the moment you need the gocoin client to spend from your native segwit addresses.
It's because none of the block explorers used by balio tool supports fetching their balances yet.

Some screenshots:
https://imgur.com/ACWUAh8
https://imgur.com/gqGYXUY

Cheers


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on March 29, 2018, 01:46:59 PM
Someone on r/BitcoinDiscussion (https://www.reddit.com/r/BitcoinDiscussion/comments/83wpxb/raspberry_pi_cold_storage/) suggested I use your tool Gocoin to make a cold storage wallet with my Raspberry Pi Zero. Oddly enough I have been learning Go recently so have a basic understanding of the language (which I assume will help). What are the first steps I need to take to get the relevant files on my Pi Zero? Is all I need Rasbian and a Go compiler? I assume I'll also need to get the wallet Github files on there? What's the best way of doing this? Sorry if these are pretty basic questions just looking for some pointers on getting started.

Thanks for making the tool it looks really useful and Go seems to be a versatile programming language.

Thanks in advance,

Adam


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on March 29, 2018, 02:00:37 PM
You don't need to build the wallet for your Raspberry Pi on Rasbian.
You can build it on any PC with a working go compiler.

Normally, when you do "go build" inside the wallet/ folder, it makes binary file for the host platform.

In order to build for another platform (Rasbian, in this case), just set the following environment variables:
Code:
GOOS=linux
GOARCH=arm
Then execute again "go build" inside the wallet/ folder - it should make "wallet" file that you can run on raspberry pi.

Simply copy the binary to your raspberry pi file system and it should be ready to go.
Just mind that you may need to do "chmod +x wallet" on it, before running it for the first time.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 05, 2018, 02:02:03 PM
Thanks for your help with this. I have been able to get an executable file called wallet onto the raspberry pi. How would I initialise this wallet on the device? When I click it it says file is executable and I can click execute, execute in terminal or cancel.Having tried both execute and execute in terminal nothing seems to be happening.

Thanks again for your help and development of this program.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 05, 2018, 03:05:32 PM
It is command line only - you need to run it inside a terminal.
Don't run it from the desktop as you won't see what it prints.

For instructions on how to setup the wallet, read the manual: http://gocoin.pl/gocoin_manual_wallet.html


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 05, 2018, 08:54:28 PM
So I have tried to run wallet -h in the command line and it says wallet:command not found. Does this mean I have done something incorrectly? Sorry if these questions seem basic I'm quite new to go and just wondering how to open or run the actual wallet. Thanks


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 05, 2018, 09:26:43 PM
it's a lot of explaining if you are on such level.
maye you have someone around who could help you with it.
it's pretty straight forward when you know basics about unix shell. or even DOS, for the matter.


I can only guess what's wrong.
Try
Code:
chmod +x wallet

and then
Code:
./wallet -h

make sure to first change dir (cd) to the folder where the wallet file is

but if you don't know what cd is, that's going to be a problem :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 06, 2018, 08:41:00 AM
lol I do know what cd is  ;)

I guess I don't have much linux experience, I have cd'd onto the desktop (where the wallet is) I ran chmod +x wallet and it didn't print anything. I then ran ./wallet -h and it printed illegal instruction.

Thanks again for all help here would really like to get this working


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 06, 2018, 08:52:48 AM
I then ran ./wallet -h and it printed illegal instruction.
Well, then you did not build it for arm architecture

Try this one: http://gocoin.pl/devads/gocoin-wallet-1.9.4-arm.tar.gz

Just to see if it works.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 06, 2018, 02:26:14 PM
Thanks for that.

I just tried the command chmod +x wallet and it printed changing permissions of wallet: Operation not pertmitted however when I tried ./wallet -h I did get a list of commands.

I tried to run wallet -l to see if I could export a public address but it printed wallet: command not found.

Should I try and make the wallet again from my mac with the environment variables to get this working?

Thanks again


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 06, 2018, 03:32:05 PM
I tried to run wallet -l to see if I could export a public address but it printed wallet: command not found.
Because you should be doing "./wallet -l"


Should I try and make the wallet again from my mac with the environment variables to get this working?
sure


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 06, 2018, 03:49:57 PM
Sorry again if this is a basic question but what is the best way of running a go build in the wallet folder with environment variables on mac? Is this done in the command line?
Thanks


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 06, 2018, 03:53:15 PM
I really don't know, never had a mac.

But I imagine it has bash shell, in which case it should work if you just "cd" to the "gocoin/wallet" folder and execute there:
Code:
GOOS=linux GOARCH=arm go build

otherwise:
Code:
export GOOS=linux
export GOARCH=arm
go build


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: devads on April 06, 2018, 04:19:16 PM
So I ran GOOS=linux GOARCH= arm go build and it built a wallet.

I put it on the pi and all the commands are saying illegal instruction. I then tried export GOOS=linux export GOARCH=arm go build and it didn't build anything. Sorry this is such a pain, thanks again


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on April 06, 2018, 04:22:17 PM
Sorry, I don't know.

As I said, I don't have a mac, so maybe just ask someone who does.

Otherwise, use the binary I gave you - if it prints the help, everything else should also work.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: nhaquethamvong on April 30, 2018, 07:11:30 AM

 
Show them your work. Maybe you can get a consultancy gig.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: lokiverloren on May 13, 2018, 07:49:10 PM
Firstly, I just want to say, what a beautiful piece of software you have made Piotr! I never heard about it and I had already looked at btcd and as soon as I saw yours running I wanted no more of btcd.

I am forking the code quite heavily, a bit more than a regular altcoin fork, the reward formula will be based on exponential decay, and because of this also I can eliminate transaction fees, but I have to massively increase the precision of the coin denomination (I think it will have 12 whole number places and 64 decimals) and I am switching out siphash for highwayhash, and secp256k1 for ed25519 and a block time of 1 minute and bigger blocks.

I noticed that the code makes golint put a lot of squiggly green lines on my VScode editor display, I suppose Go's idiom has changed significantly since 2013. I will be reworking a lot of the code, but compared to working with regular C++ based cryptocurrency nodes your code is a pleasure to read, and the web interface is beautiful, and so informative. I will be watching the repository for when you complete segwit multisig, and probably it will be a month or two before I am testing it. I will also probably add a gRPC interface to it to make it easier to plug into other applications also.

I am quite sure that it will be greatly changed compared to the original but you will be most welcome to use any changes or additions I make outside of the core protocol parts. I think the web interface could be expanded to the point where it is as feature laden as bitcoin-qt, at  option, with a nice Angular/Material skin on it.

In case you are concerned about my intended use, it will not be for a business, but rather as a base token for a larger protocol based on the SporeDB BFT database replication protocol, including a DEX, forum, chat system, git repository and hopefully from there it becomes a way for programmers to get paid without having really a boss (using a reputation system and rewards distribution similar to Steem). I thought it would be a nice, and fair way, to make it open yet provide enough possible money available for developing my larger project further. I am changing the proof of work algorithm also, and I have mostly designed the underlying sort/search protocol for a variant of Cuckoo Cycle, that massively exploits data cache locality and memory block alignment which potentially could mean not much possible improvement compared to a CPU because of cache memory being a very large component of the cost of production of processors. So hopefully it will be a coin that people can mine without sudden increases in network hashrate as recently happened to Sia, Monero and all the equihash coins.

Anyway, very nice work, and I wish more programmers wrote code like you, it would make the cryptocurrency space so much more vibrant.

You may have already noticed, if github tells you when someone has forked your repository, but this is what I have done so far, though I have been busy with other work for a few days and haven't finished yet writing the ultra precision math library that will be needed for my changes, hopefully tomorrow I can start again. https://github.com/calibrae-project/spawn


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 14, 2018, 08:32:56 AM
No worries - I'm rather an anarchist and I think that "intellectual property" is a scam invented by corporation to monopolise their profits.
You don't need to have moral issues and I'm not going to sue you for changing my code and making a few bucks on it.
The non-for-business-use license is solely there to prevent big IT corporations from taking my work, repackaging and reselling it to big financial corporations for billions while leaving me no credit.

I'm glad you found my work helpful and good luck with your project.

p.s.
The repo has 103 forks - I wouldn't have time to follow them :)


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: lokiverloren on May 15, 2018, 03:21:25 AM
Wow, 103 forks! Yeah, as a golang fiend your code was a breath of fresh air after so much tangled C++.

If there is money for the project my fork is building up from this base with, I will definitely contact you if you would be interested in helping maintain and expand the codebase of the fork and pay you for it, I am very impressed.

I have been studying the situation with proof of work and ASICs intensively lately and it's my opinion the problem is simply that nobody has been writing puzzles that require the strengths of CPU or GPU processors. The PoW for the fork of Gocoin will be one that is designed to require strong database processing capabilities, which is exactly what a CPU is good for (lists and trees). Also I am precisely following an issuance model that mimics precious metals.

Oh and yes, there will never be any registered Calibrae corporation. People will probably need to for setting up liquidity pools for the distributed exchange but that is peripheral and for this my project is intended to be a protocol for doing business, not a business in itself.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Kazimir on May 30, 2018, 09:21:10 PM
I have been running GoCoin for a while but I my server has been down for a few weeks. Now I'm restarting everything, but GoCoin says:

Quote
Database corrupt - missing file: ~/.bitcoin/gocoin/btcnet/peers3/8c14fbfe.dat

I haven't changed anything or deleted any files whatsoever. I already updated to the lastest revision (head) from github but still the same problem.

Is there anything I can do? Can I tell GoCoin to just re-download that particular file, whatever it may be? I assume it's something from the blockchain so it should be able to get that data from the network?


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on May 31, 2018, 08:33:36 AM
try deleting the peers3 folder.

it keeps the database of your known peers, but the node will find new ones as soon as it's up.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: lokiverloren on May 31, 2018, 08:08:10 PM
I just wanted to report on my experiences forking. I actually searched through all the 100 other forks and nobody really did anything. So I basically really was doing something that had not been done before.

I was able to change the majority of chain parameters and use different DNS seeds but for a reason I have not yet been able to determine, the peers on the other network refuse to grant auth to my modified gocoin node. I mean, it is significantly different, there is two PoW types in the network I am trying to join it to. The gocoin client doesn't even report the IP addresses in the interface of the nodes it's trying to connect to in the network section. I added extensive trace logging to many functions and these revealed the IP addresses but to be honest I don't know for sure if they were even correct from the DNS seed.

I kinda had hoped that configuration would be more centralised but instead there is about 3 or maybe more different places in the source that have to be changed and those that I have identified, and changed to match the other network were not enough to get peers seeding blocks to my node.

It's not a complaint, per se, or a request or anything like that. It's just a very nice bitcoin client and I thought it would not be so difficult to make it talk to a network based very closely on bitcoin (parallelcoin) and really quite old, so old that building the binary is a maze of ancient dependencies.

I understand that you build this mainly for your own benefit, so your needs are necessarily quite different being a well seasoned blockchain dev. Anyway, it's a very nice thing you made, just seems to be a bit too different for me to be able to figure out how to get it to connect to a different but basically bitcoin-based network.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Kazimir on June 01, 2018, 12:56:50 PM
try deleting the peers3 folder.

it keeps the database of your known peers, but the node will find new ones as soon as it's up.
Thanks, it seems to be working again!

Maybe it would be a good addition to auto delete or re-generate this file or dir if it's corrupt or missing? That way, if this situation would ever occur for some reason, Gocoin can still continue.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on June 01, 2018, 01:00:14 PM
try deleting the peers3 folder.

it keeps the database of your known peers, but the node will find new ones as soon as it's up.
Thanks, it seems to be working again!

Maybe it would be a good addition to auto delete or re-generate this file or dir if it's corrupt or missing? That way, if this situation would ever occur for some reason, Gocoin can still continue.

It's just never happened to me that this DB would get corrupt.

If you can find a way to reproduce the issue, I can investigate then and find the best fix for the problem.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: lokiverloren on June 04, 2018, 06:34:14 AM
Ok, I have returned to working on it... I got a full node of another chain running and set this node as sole peer of the altered prototype. Now it reports bad header formats and PoW, as it should since the coin I am altering the client to work with has two - and an extra byte in the block header to signify which PoW is used on a block.

I have to do some forensics on the blocks of the foreign chain, split the logic so there is two PoW difficulty consensus values and the recognition of valid PoWs, but I am making significant progress. I most likely will, at the end of this process, be able to precisely point at which parts have to be changed to cope with a different network, and which for different chains, I have the idea of shifting all those functions and settings into a separate library so it becomes possible to quickly target a new PoW coin using the Gocoin codebase.

https://github.com/ParallelCoinTeam/duod

There is a working docker version of the circa 2014 parallelcoin in there, likely you could easily substitute any other for this purpose. I set the configuration from the gocoin side to connect only to this docker instance. After it grabs 20 incorrectly formatted blocks it complains and stops syncing for a bit, tries again, complains again... If you changed which coin was built in this you could make it work, change genesis block info, PoW verification, difficulty adjustment policies, etc.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: Kazimir on June 20, 2018, 09:00:55 AM
try deleting the peers3 folder.

it keeps the database of your known peers, but the node will find new ones as soon as it's up.
Thanks, it seems to be working again!

Maybe it would be a good addition to auto delete or re-generate this file or dir if it's corrupt or missing? That way, if this situation would ever occur for some reason, Gocoin can still continue.

It's just never happened to me that this DB would get corrupt.

If you can find a way to reproduce the issue, I can investigate then and find the best fix for the problem.
I haven't been able to reproduce it, the problem did not show up anymore. Possibly it was due to a sudden system shutdown (electricity failure), perhaps on a very unlucky moment, which caused a DB corruption.

Anyway if I encounter the problem again I will see if I can investigate anything. So far Gocoin is working great! https://i.imgur.com/v28zS6h.png


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: bitcurve on November 28, 2024, 06:48:02 AM
This is a very nice project, I started working on it and adding features by the way, like verification of blocks (currently newly mined block hashes aren't being checked but just trusted), cleaner code and multi-chain functionalities, (for creating altcoins, etc).

I wonder if i can get an official statement about the current project status from its creator,

Thanks in advanced


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 28, 2024, 02:05:27 PM
It is being actively maintained, occasionally some new features are added.

See the changelog.txt (https://github.com/piotrnar/gocoin/blob/master/changelog.txt) for the recent changes.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: bitcurve on November 28, 2024, 02:42:02 PM
It is being actively maintained, occasionally some new features are added.

See the changelog.txt (https://github.com/piotrnar/gocoin/blob/master/changelog.txt) for the recent changes.


Thanks, but i meant more a status of the completness of it versus bitcoin core. What features it has implemented, and what it lacks.


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 28, 2024, 02:53:41 PM
It's never going to have identical features as Bitcoin Core - that was never the point.

There are some BC features that will likely never be implemented (e.g. bloom filters)
And there are some original Gocoin features the BC will likely never implement (e.g. trusted peers)

At the other hand, there are some feature BC has that are still supposed to be added (e.g. IP v6 support), although there is no roadmap for them.

The mining API is certainly a big missing feature, but since there is nobody interested in mining with Gocoin, it's pointless to add and then maintain it.


EDIT:
That said, all the blockchain consensus/verification rules are 100% implemented and up to date, and there are no known compatibility differences there between gocoin and bitcoin core. All the differences are not consensus related (e.g. P2P protocol or UI features).


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: bitcurve on November 28, 2024, 03:13:58 PM
It's never going to have identical features as Bitcoin Core - that was never the point.

There are some BC features that will likely never be implemented (e.g. bloom filters)
And there are some original Gocoin features the BC will likely never implement (e.g. trusted peers)

At the other hand, there are some feature BC has that are still supposed to be added (e.g. IP v6 support), although there is no roadmap for them.

The mining API is certainly a big missing feature, but since there is nobody interested in mining with Gocoin, it's pointless to add and then maintain it.


EDIT:
That said, all the blockchain consensus/verification rules are 100% implemented and up to date, and there are no known compatibility differences there between gocoin and bitcoin core. All the differences are not consensus related (e.g. P2P protocol or UI features).


Got it. I made some improvments to the mining, if you want i can send it to you


Title: Re: Gocoin - totally different bitcoin client with deterministic cold wallet
Post by: piotr_n on November 28, 2024, 03:22:48 PM
No, thanks.
Because I have no good way to do an actual mining, so I wouldn't be able to maintain it with an acceptable quality.

I did add some simple mining API to cheat-mine testnet coins with the old GPU miners, but that's not something I want to advertise or encourage people to use.
One cyber punk already fucked up testnet3 trying to impress people with his testnet hacking skills and I would like testnet4 to stay useful for a bit longer, before another genius decides to shit all over it. :)