A full-stack study of blockchains on security, performance, and incentive