def METHOD_NAME(self, timestamp: int, tx_hash: Optional[bytes] = None) -> bytes:
    """Make a key for a timestamp and optionally tx_hash, the key represents the membership itself."""
    import struct
    key = bytearray()
    key.extend(struct.pack('>I', timestamp))
    if tx_hash is None:
        assert len(key) == 4
        return bytes(key)
    assert len(tx_hash) == 32
    key.extend(tx_hash)
    assert len(key) == 4 + 32
    return bytes(key)