When Blockchain Meets Artificial Intelligence