The Duality Code