On the security and performance of next-generation blockchains