Add a protocol specification.

This fixes #4.