Quantcast
Channel: Hacker News
Viewing all articles
Browse latest Browse all 25817

Show HN: Very basic blockchain-free cryptocurrency PoC in Python

$
0
0

README.md

Crackcoin is a very basic blockchain-free cryptocurrency PoC in Python. It's a project for discovering cryptocurrencies.

Note that this is a PoC that runs only on local networks and does not provide proper security. The code should only be used to get familiar with the building blocks for a cryptocurrency.

This project was created as an exercise after reading "Mastering Bitcoin: unlocking digital cryptocurrencies".

Material covered

  • Transaction-based mining as a PoC for a blockchain-free cryptocurrency
  • Threading in Python
  • Working with sockets in Python (UDP)
  • ECC crypto / ECC public key compression/decompression
  • Base58 encoding like bitcoin
  • Having the whole thing work (wallet, crypto, validation, networking, mining, etc)

Blockchain-free cryptocurrencies

Most cryptocurrencies use a blockchain to validate transactions among other things. After years of running these networks it's beginning to look like blockchain-based currencies naturally evolve into a centralised network, because it's in the best interest of the participants to combine computing power to calculate solutions for blocks.

An interesting framework for a blockchain-free protocol is discussed in the paper "Blockchain-Free Cryptocurrencies: A Framework for Truly Decentralised Fast Transactions", which can be found here:

https://eprint.iacr.org/2016/871.pdf

Do note that crackcoin doesn't implement nearly as complex a protocol as described in the paper. But the transaction-based mining method was used as an inspiration for implementing the 'core' for crackcoin.

Usage

Running it normally

  • First run python crackcoin.py
  • Then type h to see options and communicate with other crackcoin-nodes on the network

Generating and working with your own genesis transaction

  • Run python generateGenesis.py until a cool address pops up
  • Edit crackcoinBase.sql: replace the address for the transaction with transactionHash d34db33f in transactions_outputs with your generated address
  • Run crackcoin and wait until a confirmation is generated for d34db33f with a higher difficulty (>6) than the one in crackcoinBase.sql
  • Replace the confirmation for d34db33f
  • Share code on other nodes
  • Manually replace your wallet keys and address with the address and keys generated by generateGenesis.py. This will allow you to 'spend' the genesis cash.

Viewing all articles
Browse latest Browse all 25817

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>