On Public and Private Blockchains