Git Product home page Git Product logo

denaro's Introduction

denaro

denaro, 'money' in italian, is a cryptocurrency written in Python.
Maximum supply is 30.062.005.
Maximum decimal digits count is 6.
Blocks are generated every ~3 minutes, with a size limit of 2MB per block.
Assuming an average transaction to be composed by 5 inputs and 2 outputs, that are 250 bytes, a block can contain ~8300 transactions, which means ~40 transactions per second.

Setup with Docker

  • Build the base image with make build
  • $ docker-compose up -d

Installation

Before installing denaro, you need to create the postgresql database.
You can find the schema in schema.sql.
You have to set environmental variables for database access:

  • DENARO_DATABASE_USER, default to denaro.
  • DENARO_DATABASE_PASSWORD, default to an empty string.
  • DENARO_DATABASE_NAME, default to denaro.
  • DENARO_DATABASE_HOST, default to 127.0.0.1.
# install postgresql
createdb denaro

Then install denaro.

git clone https://github.com/denaro-coin/denaro
cd denaro
psql -d denaro -f schema.sql
pip3 install -r requirements.txt
uvicorn denaro.node.main:app --port 3006

Node should now sync the blockchain and start working

Mining

denaro uses a PoW system.

Block hash algorithm is sha256.
The block sha256 hash must start with the last difficulty hex characters of the previously mined block.
difficulty can also have decimal digits, that will restrict the difficulty + 1th character of the derived sha to have a limited set of values.

from math import ceil

difficulty = 6.3
decimal = difficulty % 1

charset = '0123456789abcdef'
count = ceil(16 * (1 - decimal))
allowed_characters = charset[:count]

Address must be present in the string in order to ensure block property.

Blocks have a block reward that will half itself til it reaches 0.
There will be 150000 blocks with reward 100, and so on til 0.390625, which will last 458732 blocks.
The last block with a reward will be the 458733th, with a reward of 0.3125.
Subsequent blocks won't have a block reward.
Reward will be added the fees of the transactions included in the block.
A transaction may also have no fees at all.

denaro's People

Contributors

canhmai avatar grumpy-miner avatar sineverba avatar skrtdev avatar the-sycorax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

denaro's Issues

What is the correct values for the address parameter?

python3 miner.py 123456
INFO:denaro:ic| 'sync blockchain'
INFO:denaro:ic| difficulty: Decimal('6.0')
521977.2952393586 hash/s
INFO:denaro:ic| i: 1000000
523573.2909438763 hash/s
INFO:denaro:ic| i: 2000000
521719.70132090384 hash/s
INFO:denaro:ic| i: 3000000
521440.30478519545 hash/s
INFO:denaro:ic| i: 4000000
520208.4286775026 hash/s
INFO:denaro:ic| i: 5000000
520507.49193837866 hash/s
INFO:denaro:ic| i: 6000000
520564.94910197187 hash/s
INFO:denaro:ic| i: 7000000
520317.60702107154 hash/s
INFO:denaro:ic| i: 8000000
520364.72357925103 hash/s
INFO:denaro:ic| i: 9000000
520258.4309129691 hash/s
INFO:denaro:ic| i: 10000000
519935.2588602538 hash/s
INFO:denaro:ic| i: 11000000
520152.0143620452 hash/s
INFO:denaro:ic| i: 12000000
519766.0066038589 hash/s
INFO:denaro:ic| i: 13000000
519658.6428831817 hash/s
INFO:denaro:ic| i: 14000000
517755.7227193395 hash/s
INFO:denaro:ic| i: 15000000
517484.1946772903 hash/s
INFO:denaro:ic| i: 16000000
517653.3308287877 hash/s
INFO:denaro:ic| i: 17000000
517879.16030931054 hash/s
INFO:denaro:ic| i: 18000000
INFO:denaro:ic| 'sync blockchain'
Traceback (most recent call last):
File "/home/fgbombardelli/learning/criptocoin/denaro/miner.py", line 54, in
loop.run_until_complete(run())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/fgbombardelli/learning/criptocoin/denaro/miner.py", line 47, in run
res = await push_block(None, _hex.hex(), [tx.hex() for tx in txs], False)
File "/home/fgbombardelli/learning/criptocoin/denaro/denaro/node/main.py", line 266, in push_block
txs = body['txs']
TypeError: 'Body' object is not subscriptable

Cannot download large blocks

Cannot complete downloading the blockchain. The issue is with requests to the following url:

https://denaro-node.gaetano.eu.org/get_blocks?offset=72307&limit=1

INFO:denaro:ic| e: RemoteProtocolError('peer closed connection without sending complete message body (incomplete chunked read)')

It was stopping at an earlier block. I modifed the code to reduce the limit paramater and each time it would go a little further. Finally I changed to limit 1 and it failed at block 72307. You can enter the above URL into a browser and see that the request never completes.

Even if you enter that block into the explorer it never loads:

https://explorer.denaro.is/block/72307

already a coin called denaro?

There is already a listed coin called Denaro with some PR material put out. They did an ICO in 2018. might be worth considering a name change if you're interested in going further with this.

Need in depth description of how to build

Not quite experienced with docker and stuff like this but this is really interesting. Could you make like a video or leave a link for the downloads I need to run denaro? Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.