Blockchain attack defense mechanism learning