Skip to content
A simple decentralized peer-to-peer ledger implementation
Go C++ Cuda C CMake
Branch: master
Clone or download
asdvxgxasjab Merge pull request #49 from asdvxgxasjab/peer-fix
only add missing port to non-empty peer value
Latest commit 06b0e39 Aug 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client only add missing port to non-empty peer value Aug 16, 2019
cuda cuda: hash the first (largest) part of the header only once Jul 22, 2019
docs add some docs Jul 16, 2019
inspector Update README.md Jul 15, 2019
opencl Update README.md Jul 31, 2019
vendor first commit Jun 22, 2019
wallet Use default port for peer if not provided Aug 16, 2019
.travis.yml wallet: fix floating point rounding error Jul 4, 2019
LICENSE first commit Jun 22, 2019
README.md Update README.md Jul 31, 2019
balance_cache.go first commit Jun 22, 2019
block.go add CUDA mining support Jul 20, 2019
block_header_hasher.go cleanup device mining hooks Jul 31, 2019
block_header_hasher_test.go fix test Jul 20, 2019
block_queue.go naming+logging Jun 26, 2019
block_storage.go first commit Jun 22, 2019
block_storage_disk.go first commit Jun 22, 2019
block_storage_disk_test.go first commit Jun 22, 2019
checkpoints.go add checkpoints Aug 14, 2019
constants.go add checkpoints Aug 14, 2019
cuda.go update LDFLAGS; reset device+set flags Jul 21, 2019
cuda_stubs.go add CUDA mining support Jul 20, 2019
dns.go Favor domain name for seeder Aug 15, 2019
genesis.go only connect to 1 peer until synced; cleanup connection logic Jun 25, 2019
go.mod first commit Jun 22, 2019
go.sum wallet: fix floating point rounding error Jul 4, 2019
irc.go first commit Jun 22, 2019
ledger.go first commit Jun 22, 2019
ledger_disk.go fix iterating public key history in reverse Jul 26, 2019
miner.go add support for get_work Jul 23, 2019
opencl.go add opencl support Jul 30, 2019
opencl_stubs.go add opencl support Jul 30, 2019
peer.go add checkpoints Aug 14, 2019
peer_manager.go add checkpoints Aug 14, 2019
peer_storage.go only connect to 1 peer until synced; cleanup connection logic Jun 25, 2019
peer_storage_disk.go add comment Jul 10, 2019
processor.go add checkpoints Aug 14, 2019
processor_test.go first commit Jun 22, 2019
protocol.go just some typos Jul 25, 2019
tls.go update tls ciphersuites Jul 3, 2019
transaction.go first commit Jun 22, 2019
transaction_queue.go don't re-process a transaction if it's in the queue Jul 2, 2019
transaction_queue_memory.go don't re-process a transaction if it's in the queue Jul 2, 2019
transaction_test.go first commit Jun 22, 2019
upnp.go first commit Jun 22, 2019
wallet.go wallet: add 'verify' command Jul 11, 2019
wallet_test.go first commit Jun 22, 2019

README.md

cruzbit

A simple decentralized peer-to-peer ledger implementation

Build Status

cruzbit is very similar to bitcoin with the following notable differences:

  • Newer crypto - The Ed25519 signature system is used for signing transactions. This system has a number of nice properties to protect users from security risks present with naive usage of ECDSA. The 256-bit version of the SHA-3 hashing algorithm is used for all hashing operations in the application, including the proof-of-work function but excluding hashing performed internally by the signature system. It's reported to be blazing fast when implemented in hardware. NaCl Secretbox is used to encrypt wallet private keys (not part of the protocol.)
  • Simplified transaction format - No inputs and outputs. Just public key sender and receiver with a time, amount, explicit fee, memo field, pseudo-random nonce, series and signature. The series is incremented network-wide roughly once a week based on block height to allow for pruning transaction history. Also included are 2 optional fields for specifying maturity and expiration, both at a given block height.
  • No UTXO set - This is a consequence of the second point. It considerably simplifies ledger construction and management as well as requires a wallet to know only about its public key balances and the current block height. It also allows the ledger to map more directly to the well-understood concept of a double-entry bookkeeping system. In cruzbit, the sum of all public key balances must equal the issuance at the current block height. This isn't the first ledger to get rid of the UTXO set model but I think we do it in a uniquely simple way.
  • No scripting - This is another consequence of the second point. Signatures are simply signatures and not tiny scripts. It's a bit simpler and arguably safer. It does limit functionality, e.g. there is no native notion of a multi-signature transaction, however, depending on your needs, you can come close to accomplishing that using mechanisms external to cruzbit.
  • No fixed block size limit - Since transactions in cruzbit are more-or-less fixed size we cap blocks by transaction count instead, with the initial limit being 10,000 transactions. This per-block transaction limit increases with "piecewise-linear-between-doublings growth." This means the limit doubles roughly every 2 years by block height and increases linearly between doublings up until a hard limit of 2,147,483,647. This was directly inspired by BIP 101. We use block height instead of time since another change in cruzbit is that all block headers contain the height (as well as the total cumulative chain work.)
  • Reference implementation is in Go - Perhaps more accessible than C++. Hopefully it makes blockchain programming a bit easier to understand and attracts a wider variety of developer interest.
  • Web-friendly peer protocol - Peer communication is via secure WebSockets. And the peer protocol and all primitives are structured in JSON. This should make working with the protocol easy for just about every modern development environment.

Why does cruzbit exist?

I noticed most people focusing on making more complex ledgers capable of executing "smart" contracts and/or crypto-magically obscuring transaction details and such. And I think those projects are pretty cool, but I'd always wanted to attempt to do the opposite and implement the simplest decentralized ledger I possibly could given lessons learned from bitcoin. I think that's what cruzbit is. Anything that I thought wasn't strictly necessary in bitcoin, or was otherwise weird, I got rid of. I wanted the design to be conceptually simple and extremely developer-friendly. I finally had some personal time on my hands so I decided, why not. And now cruzbit exists.

License

cruzbit is released under the terms of the MIT license. See LICENSE for more information or see https://opensource.org/licenses/MIT.

Warning

cruzbit is experimental alpha-quality software. There may be bugs.

Getting started mining

If you missed out on the opportunity to mine other cryptocurrencies you could give cruzbit a try!

  1. Install Go
  2. Install the wallet
  3. Run the wallet and issue a newkey command. Record the public key.
  4. Install the client
  5. Run the client using the public key from step 4. as the -pubkey argument.

Complete steps for installation of Go and the cruzbit binaries on Linux can be found here.

Steps to enable mining with CUDA for Nvidia GPUs can be found here.

Steps to enable mining with OpenCL (for all GPUs, including AMD) can be found here.

Like bitcoin, any blocks you mine will need to have an additional 100 blocks mined on top of them prior to the new cruzbits being applied to your balance. This is to mitigate a potentially poor user experience in the case of honest blockchain reorganizations.

Also note, instead of mining with a single public key, you can use the wallet to generate many keys and dump the public keys to a text file which the client will accept as a -keyfile argument. The wallet commands to do this are genkeys and dumpkeys.

Not interested in mining but want to play with cruzbit?

No problem! You can run the client with -numminers 0 so that it can function as your wallet peer.

Discussion

You can’t perform that action at this time.