Aareon / ChickenTicket

Pure Python implementation of a cryptocurrency blockchain
MIT License
15 stars 2 forks source link

Create miner #28

Open Aareon opened 2 years ago

Aareon commented 2 years ago

Figure out target threshold calculation based on calculate_difficulty()

Aareon commented 2 years ago

target = max_target / difficulty target = coefficient * 2 ^ (8 * (index – 3)) (from bits)

Reference

Aareon commented 2 years ago

For us we base target off of desired block time. Haven't settled on an interval yet.

Aareon commented 2 years ago

Probably going to work around using PoW at all because I hate the inefficiency. Might set up a means to start with few validators at the start and gradually increase requirements to confirm PoS.

NewtonJr4108 commented 2 years ago

Honestly, I think PoW is just fine as long as its memory and energy usage makes sense economically and ecologically.

Aareon commented 2 years ago

@NewtonJr4108 problem being, no implementation I can scheme up would be efficient enough to justify it. I’m fine with slower blocks at the start if it means having a smaller overall footprint.

Aareon commented 2 years ago

Proof of work is inherently inefficient, which is part of the reason it’s so secure. However, it has a huge impact ecologically and I’d prefer to not have a hand in the damage that would ensue.

NewtonJr4108 commented 2 years ago

Fair enough.

NewtonJr4108 commented 2 years ago

Is mining functional yet? If not, at what point are you in dev. I'd love be to test it out.

Aareon commented 2 years ago

If I do implement mining, I have to decide on when exactly it will be phased out (block height). It’ll be dead simple, but I want it to be correct. As of right now I’m working on fleshing out the GUI. Until I get everything functioning correctly in the GUI, I’m gonna hold off on mining. I also plan on implementing a functioning faucet and some other services before we go live.

NewtonJr4108 commented 2 years ago

So far the wallet gui looks good. Once your done with that, I think adding mining could allow the project to go into beta or at least a semi stable release. Can't wait to test it.

Aareon commented 2 years ago

@NewtonJr4108 have you had a chance to test simplegui.py on your machine? I’ll likely build the miner into the UI at some point, but my main focus is the future staking. An issue I’m facing now is having the node update the progress bar on the main wallet window with the syncing progress and setting the block height label and connections label. It sorta works on Windows but when I tested it on Ubuntu, connections wasn’t updating.

NewtonJr4108 commented 2 years ago

Im on a windows machine and that's what I used to test out the pysimplegui. I don't think the progress bar was implemented but I'll have to check again.

Aareon commented 2 years ago

@NewtonJr4108 It's there, but it doesn't do anything. When I figure out the bug with the connections label, I'll be able to implement the progress bar. I'll likely move all of simplegui.py into an App class, so that I can pass the class as an event listener to Node.

NewtonJr4108 commented 2 years ago

Is there like a discord or anything for this project. That'd be a good place to discuss these things in a more open ended manner

Aareon commented 2 years ago

@NewtonJr4108 https://discord.gg/6RFyh6S49F