We discuss a general-purpose virtual infrastructure for wireless sensor networks and show how it can be leveraged for the purpose of designing lightweight and secure protocols.