https://bit24.cash/blog/consensus-algorithm/