Blockchain core algorithms explained