robinmonjo / coincoin

Blockchain based cryptocurrency proof-of-concept in Elixir. Feedback welcome
402 stars 54 forks source link

Pluggable proof-of-* #8

Open robinmonjo opened 6 years ago

robinmonjo commented 6 years ago

from @yorgis in a comment of this PR https://github.com/robinmonjo/blockchain/pull/7

What would happen if we want to support something like PoW + PoT together, IF I am not mistaking Dash coin does that, it split it up into 50% 50% work.

Also, let say tomorrow I want to create ProofOfSharing (PoSH) how would that look like?

When I told you to move it into some module I was actually thinking on create some config with the module (not called proof_of_work because defeat the idea πŸ˜„ ) where we can setup either a list or just a module and you will call the compute function on it, which is why I told you about the protocol.

So that way you can have as many implementations of how you reward or do any computation of this kind.

Something like

config :blockchain,
  some_better_name_key: [ProofOfWork, ProofOfStake, ProofOfShares]

# or

config :blockchain,
  some_better_name_key: [
    pow: ProofOfWork, # <- for the sack of the demo whatever key value pair
    pos: ProofOfStake,
    posh: ProofOfShares
  ]

the last example could be useful when you want to control that you HAVE to use specific module for X reason. I would even stick with the array for now πŸ˜„ we need study what other coins do differently and more important where the crypto world is moving to

wayann commented 6 years ago

hard to say where it moves, here are two newcomers that are interesting imo. https://blog.cosmos.network/consensus-compare-tendermint-bft-vs-eos-dpos-46c5bca7204b it is of course biased since cosmos run on tendermint.... but to give a general idea I think it's a good starting point for a deeper research.... just my 2c