Highlights Cattle dung can be effectively managed through vermicomposting Biochar showed both positive and negative effects on earthworms’ performance 5% biochar addition promoted compost quality by stimulating earthworms’ activity Higher doses of biochar were not suitable for vermicomposting Available N and functional genes drove compost quality and N2O emissions Biochar increased AOB but decreased nirS gene numbers in fresh cast of earthworms