Implement envelope based on the format discussed at #2