Principles and Applications of Blockchain Systems