Towards a better understanding of Bitcoin : from system analyses to new protocol designs