Writing blockchain download algorithm