Trade-off between security and scalability in blockchain design: A dynamic sharding approach