mafdet protocol + reference implementation