The new approach could enable farmers to produce ammonia on-site, and also reduce CO2 emissions from fertilizer production.