ZeWIF is Ready for Testing

I just posted the following update to the ZCG board. Here’s what we’ve been doing with ZeWIF in the last week:

Wolf has been making good progress on the updated milestone #3.5. The main goal here is to produce the Gordian Envelope file format to allow easy interchange of data between machines.

Since the ZeWIF in-memory format was already closed out (in current draft) with milestone #3, the Envelope format just requires round-tripping from the in-memory format to the file format and back. Wolf is attacking the data structures one at a time. Once everything round trips, writing out to the file, then reading back into the file, with the data structures looking the same, we’re set. At that point, all wallet developers need to do is read their data into the in-memory format or convert the in-memory format back to their wallet, all using the API docs already in the source files.

Here’s a sneak peak at what the Envelope file format looks like. (This is “Envelope notation” so it presents everything as human-readable as possible, with the actual CBOR representation one layer lower.)

45839946 [
    'isA': "SaplingOutputDescription"
    "commitment": Bytes(32)
    "enc_ciphertext": Bytes(580)
    "ephemeral_key": Bytes(32)
    "memo": Bytes(64)
    "note_commitment_tree_position": 522950011
    "witness": Bytes(32) [
        'isA': "SaplingAnchorWitness"
        "witness": [Bytes(32), null] [
            'isA': "IncrementalMerkleTree"
            'isA': "SaplingWitness"
            "cursor": [Bytes(32), null] [
                'isA': "IncrementalMerkleTree"
                "right": Bytes(32)
            ]
            "filled": [Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32)]
        ]
    ]
]
1106195738 [
    'isA': "SaplingOutputDescription"
    "commitment": Bytes(32)
    "enc_ciphertext": Bytes(580)
    "ephemeral_key": Bytes(32)
    "note_commitment_tree_position": 597373669
    "witness": Bytes(32) [
        'isA': "SaplingAnchorWitness"
        "witness": [Bytes(32), null] [
            'isA': "IncrementalMerkleTree"
            'isA': "SaplingWitness"
            "filled": [Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32), Bytes(32)]
            "left": Bytes(32)
            "right": Bytes(32)
        ]
    ]
]

Obviously, this is for Sapling output descriptors, but there will be similar outputs/storage for everything.

As you can see, Wolf has also settled on our internal type system (using isA) to define the various structures, basically because of their quantity and the specificity of many of them for Zcash. (Our other options were CBOR tags and our own Known Value tags, but he settled on this one as the best for extensibility rather than burdening the structure with the need to define everything in an external registry.)

Some upcoming notes:

  1. We’re basically past any technical risks implicit to the project at this point, and just grinding through the final iterations of the work.

  2. I think we’re going to have new releases of the zewif and other repos, with this work, toward the end of this week.

  3. We will be holding a demo on August 16th, likely at 11am PT of using zmigrate and round-tripping data through the file format. I need to double-check the exact time with the principals and then I’ll post the specifics. You’re welcome if you want to joing, but we’ll also have a video available afterward.

4 ) Wolf and I will still be closing out documentation at that point, but in the couple of weeks that close out the month, we’ll be very happy to work with wallet developers to make sure ZeWIF is suiting your needs, so I encourage wallet folks to start looking at what we have so far so that you can take advantage of Wolf’s availability for the last couple of weeks of the month.

As a reminder, here’s the zewif repo that’s the heart of the project: GitHub - BlockchainCommons/zewif: ZeWIF: The Zcash Wallet Interchange Format

Here’s the zmigrate repo that makes use of that for a CLI: GitHub - BlockchainCommons/zmigrate: ZCash wallet migration framework

4 Likes