Gocoin: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Tonikt (talk | contribs)
Tonikt (talk | contribs)
 
(20 intermediate revisions by 4 users not shown)
Line 9: Line 9:
===Libraries===
===Libraries===


====btc====
====btc / chain / script ====
The core of the software is a library that essentially provides the blockchain protocol parser. That includes script parsing, ECDSA signature verification, but also things like address encoding, parsing of canonical signatures or extracting hashes that need to be signed for specific inputs of a given transaction.
The core of the software is a library that essentially provides the blockchain protocol parser. That includes script parsing, ECDSA signature verification, but also things like address encoding, parsing of canonical signatures or extracting hashes that need to be signed for specific inputs of a given transaction.


Line 16: Line 16:
Inside the package, there is also a blocks persistent storage database (blockdb.go) - it is just a simple plain storage (that can only grow), with an index. It uses snappy compression, allowing to save about 30% of the disk space.
Inside the package, there is also a blocks persistent storage database (blockdb.go) - it is just a simple plain storage (that can only grow), with an index. It uses snappy compression, allowing to save about 30% of the disk space.


====qdb====
====utxo====
The core library interfaces directly with a UTXO database backed.
The core library interfaces directly with a UTXO database backed.
For this purpose Gocoin uses its own database engine, that has been designed to deal with the specific characteristics of bitcoin's UTXO database.  
For this purpose Gocoin uses its own database engine, that has been designed to deal with the specific characteristics of bitcoin's UTXO database.


====newec====
====secp256k1====
To speed up the ECDSA operations [https://github.com/bitcoin/secp256k1 the secp256k1 library by sipa] has been ported to Go.
To speed up the Elliptic Curve operations [https://github.com/bitcoin/secp256k1 the secp256k1 library by sipa] has been ported to Go.
It is used as a default ECDSA library by the online node (client).


===Online client===
===Online client===
The online client is a kind of a server software that is meant to be running all the time.
The online client is a kind of a server software (or a peer-to-peer node) that is meant to be running all the time.


It handles the network related communication, feeds the core lib with new incoming blockchain data, monitors balances on the wallets' addresses,  manages transaction memory pool and the peers database. It also provides an interactive user interface.
It handles the network related communication, feeds the core lib with new incoming blockchain data, monitors balances on the wallets' addresses,  manages transaction memory pool and the peers database. It also provides an interactive user interface.
Line 35: Line 34:
Unlike the client, the wallet is not an app that is meant te be running continuously.  
Unlike the client, the wallet is not an app that is meant te be running continuously.  
A user runs it with the requested task - the wallet does the job and exits (back to the command prompt).
A user runs it with the requested task - the wallet does the job and exits (back to the command prompt).
===Blockchain downloader===
For optimized initial blockchain download, Gocoin has a dedicated application called '''downloader'''.
Among other optimizations, the downloader allows a user to skip verification of all the blocks up to a certain one that he defines as trusted. This can speed up the bootstrap process significantly (e.g. from days to hours).
After it finishes downloading of all the blocks, it will exit automatically. In that moment the client should be started and it will keep up with all the new blocks, that will  appear in the network.


===Other tools===
===Other tools===
Line 49: Line 41:


The tool '''type2determ''' can, at the other hand, calculate Type-2 deterministic addresses, without a need to access the wallet (the private keys).
The tool '''type2determ''' can, at the other hand, calculate Type-2 deterministic addresses, without a need to access the wallet (the private keys).


==Features==
==Features==
Line 55: Line 46:
Gocoin has a several unique features, that distinguish it from the original bitcoin client.
Gocoin has a several unique features, that distinguish it from the original bitcoin client.
===Node / Client===
===Node / Client===
* All the unspent outputs are kept in memory, which makes switching between different wallets, as well as checking a balance of any address, relatively fast (few seconds max).
* All the unspent outputs are kept in system memory.
* Allows a user to limit the upload and download network bandwidth used by the client.
* A current balances of any P2PKH, P2SH or P2WPKH address is kept in memory for a quick access.
* Can be monitored and controlled through a web interface (from a web browser).
* Can be monitored and controlled through a web interface (from a web browser).
* Works with its own implementation of a cold storage wallet.
* Works with its own implementation of a cold storage wallet.
* Web interface allows a user to create raw transactions from specific inputs ([[Coin Control]]), as well as multisig transactions ([[P2SH]])
* Web interface allows a user to create raw transactions from specific inputs ([[Coin Control]]), as well as multisig transactions ([[P2SH]])
* The blocks are stored on the disk in a compressed form (using [https://code.google.com/p/snappy/ snappy] compression) which saves about 30% of space.
* The blocks are stored on the disk in a compressed form (using [https://code.google.com/p/snappy/ snappy] compression) which saves ~20% of space. They can also be purged (entirely or partially) from the disk.
* Supports monitoring and fetching balance of own stealth addresses (the ones implemented in Dark Wallet)
* Up till version '''1.6.4''' it supported monitoring and fetching balance of stealth addresses (the ones implemented in [[Dark Wallet]])
* From version 1.9.4 onward, both the wallet and the client, support native segwit addresses (P2WPKH encoded as bech32)


===Wallet===
===Wallet===
Line 69: Line 61:
* Has very low hardware requirements. Can be run on i.e. Raspberry Pi
* Has very low hardware requirements. Can be run on i.e. Raspberry Pi
* Can generate [https://bitcointalk.org/index.php?topic=19137.0 Type-2] deterministic keys/addresses
* Can generate [https://bitcointalk.org/index.php?topic=19137.0 Type-2] deterministic keys/addresses
* Supports signing of [[P2SH]] multisig transactions (the ones that use [[Script#Crypto | OP_CHECKMULTISIG opcode]]).
* Supports (partial) signing of [[P2SH]] multisig transactions (the ones that use [[Script#Crypto | OP_CHECKMULTISIG opcode]]).
* Supports spending to stealth addresses as implemented in Dark Wallet
* Supports spending to stealth addresses as implemented in Dark Wallet


===Node-less mode===
===Node-less mode===
It is possible to use Gocoin's wallet, without a need to have a running client node, which may come handy since the node requires quite a decent hardware and the block chain takes  a lot of time for the initial download.
It is possible to use Gocoin's wallet, without a need to have a running client node. This may come handy since the node requires quite an advanced hardware and a large amount of time for the initial bootstrap.
 
In such a case the required balance files are fetched with a tool called '''FetchBal''', from two popular block explorer services. The list of unspent outputs is first fetched from [[BlockChain.info]] and then the raw transaction data (for these outputs) are downloaded from either [http://webbtc.com webbtc.com], [http://btc.blockr.io/ blockr.io]  or [[BlockExplorer.com]] (in that order).


Using this tool you will not be able to monitor balance on your own stealth addresses.
In such a case the required balance files are fetched with a tool called '''balio''', from popular block explorers.


==Requirements==
==Requirements==
===Client===
===Client===
Requires 64-bit platform and at least 4GB of system memory, though these days rather 8GB is recommended.
Requires 64-bit platform and at least 8GB of system memory.


The file system that stores the blockchain data must be able to handle files larger than 4GB.
The file system that stores the blockchain data must be able to handle files larger than 4GB.
Line 88: Line 78:
The wallet app has very little hardware requirements. As long as you can build it for a specific architecture, it should work there.
The wallet app has very little hardware requirements. As long as you can build it for a specific architecture, it should work there.


There is no knowledge of Gocoin wallet to be tested on platforms like Raspberry Pi, but theoretically there is no reason why it would not work there.
Gocoin wallet has been even used on Raspberry Pi model A.


For security reasons it is strongly recommended to run the wallet on an encrypted file system, with an encrypted swap file.
For security reasons it is strongly recommended to run the wallet on an encrypted file system, with an encrypted swap file.


==Limitations==
==Limitations==
* No GUI, though the online node has web interface
* No GUI, though the online node has web interface which acts like a GUI
* No RPC API
* No IPv6
* No IPv6
* No UPnP
* No UPnP
Line 113: Line 102:
==External Links==
==External Links==


* [http://www.assets-otc.com/gocoin Homepage]
* [http://gocoin.pl Homepage]
* [https://github.com/piotrnar/gocoin Github repo]
* [https://github.com/piotrnar/gocoin Github repo]
* [https://bitcointalk.org/index.php?topic=199306.0 Bitcointalk forum topic]
* [https://bitcointalk.org/index.php?topic=199306.0 Bitcointalk forum topic]
Line 124: Line 113:
[[Category:Open Source]]
[[Category:Open Source]]
[[Category:Wallets]]
[[Category:Wallets]]
[[Category:Google Go]]

Latest revision as of 21:56, 28 December 2017

An open-source Bitcoin solution written in Go language (golang). It can be built for every platform that has a working Go compiler. It uses a proprietary license, though is free to use for non-commercial purposes.

Architecture

Gocoin's architecture is quite different from the reference implementation (of the Satoshi client).

Libraries

btc / chain / script

The core of the software is a library that essentially provides the blockchain protocol parser. That includes script parsing, ECDSA signature verification, but also things like address encoding, parsing of canonical signatures or extracting hashes that need to be signed for specific inputs of a given transaction.

It is a relatively big library, that contains many useful bitcoin function.

Inside the package, there is also a blocks persistent storage database (blockdb.go) - it is just a simple plain storage (that can only grow), with an index. It uses snappy compression, allowing to save about 30% of the disk space.

utxo

The core library interfaces directly with a UTXO database backed. For this purpose Gocoin uses its own database engine, that has been designed to deal with the specific characteristics of bitcoin's UTXO database.

secp256k1

To speed up the Elliptic Curve operations the secp256k1 library by sipa has been ported to Go.

Online client

The online client is a kind of a server software (or a peer-to-peer node) that is meant to be running all the time.

It handles the network related communication, feeds the core lib with new incoming blockchain data, monitors balances on the wallets' addresses, manages transaction memory pool and the peers database. It also provides an interactive user interface.

Offline wallet

The wallet application is responsible for creating private keys (from a seed password) and for signing transactions with them. It can also sign text messages with private keys and decode raw transactions.

Unlike the client, the wallet is not an app that is meant te be running continuously. A user runs it with the requested task - the wallet does the job and exits (back to the command prompt).

Other tools

There is also a set of more and less useful tools (github.com/piotrnar/gocoin/tools) that are an integral part of the Gocoin bitcoin software.

For instance btcversig can verify a validity of a bitcoin signature - it is the substitute of the reference client's verifymessage RPC-API.

The tool type2determ can, at the other hand, calculate Type-2 deterministic addresses, without a need to access the wallet (the private keys).

Features

Gocoin has a several unique features, that distinguish it from the original bitcoin client.

Node / Client

  • All the unspent outputs are kept in system memory.
  • A current balances of any P2PKH, P2SH or P2WPKH address is kept in memory for a quick access.
  • Can be monitored and controlled through a web interface (from a web browser).
  • Works with its own implementation of a cold storage wallet.
  • Web interface allows a user to create raw transactions from specific inputs (Coin Control), as well as multisig transactions (P2SH)
  • The blocks are stored on the disk in a compressed form (using snappy compression) which saves ~20% of space. They can also be purged (entirely or partially) from the disk.
  • Up till version 1.6.4 it supported monitoring and fetching balance of stealth addresses (the ones implemented in Dark Wallet)
  • From version 1.9.4 onward, both the wallet and the client, support native segwit addresses (P2WPKH encoded as bech32)

Wallet

  • For security reasons, it is supposed to be used with a PC that has never been (and will never be) connected to a network.
  • The wallet is deterministic and a seed-password based. As long as you can remember the password, there is no need for any backups.
  • Additionally it can import private keys from an existing bitcoin wallet (must be in Base 58 Wallet Import format format).
  • Has very low hardware requirements. Can be run on i.e. Raspberry Pi
  • Can generate Type-2 deterministic keys/addresses
  • Supports (partial) signing of P2SH multisig transactions (the ones that use OP_CHECKMULTISIG opcode).
  • Supports spending to stealth addresses as implemented in Dark Wallet

Node-less mode

It is possible to use Gocoin's wallet, without a need to have a running client node. This may come handy since the node requires quite an advanced hardware and a large amount of time for the initial bootstrap.

In such a case the required balance files are fetched with a tool called balio, from popular block explorers.

Requirements

Client

Requires 64-bit platform and at least 8GB of system memory.

The file system that stores the blockchain data must be able to handle files larger than 4GB.

Wallet

The wallet app has very little hardware requirements. As long as you can build it for a specific architecture, it should work there.

Gocoin wallet has been even used on Raspberry Pi model A.

For security reasons it is strongly recommended to run the wallet on an encrypted file system, with an encrypted swap file.

Limitations

  • No GUI, though the online node has web interface which acts like a GUI
  • No IPv6
  • No UPnP
  • No support for non-confirmed transactions (they are invisible in the balance)
  • No support for bloom filters protocol (BIP 0037) and the mempool command
  • No routing of alert messages
  • No support for multisig stealth addresses (yet)

History

Gocoin was written by a single person for a private purposes.

The software's first public release was announced in May 2013 on Bitcointalk forum.[1] Ever since then, the software has been actively maintained and further developed, being armed with new features, further optimized and cleaned up from issues.

It happened twice that the client wasn't able to catch up with the blockchain, because of the implementation difference of the chain parsing protocol that was causing it to reject a block (transaction) that the reference implementation would accept. In both cases the issue was fixed within single days. The fist case happened in July 2013 and the fix was introduced in version 0.5.7. The second time was in March 2014 - the fix came with release 0.9.3.

External Links

References