Zcash ZIPs
Theme
Appearance
Contents

ZIP 270

Key Rotation for Tracked Signing Keys

Draft

Terminology

The key words “MUST”, “REQUIRED”, “MUST NOT”, “SHOULD”, and “MAY” in this document are to be interpreted as described in BCP 14 1 when, and only when, they appear in all capitals.

The term “full validator” in this document is to be interpreted as defined in the Zcash protocol specification 2.

The term “network upgrade” in this document is to be interpreted as described in ZIP 200. 3

The character § is used when referring to sections of the Zcash Protocol Specification. 4

The terms “Mainnet” and “Testnet” are to be interpreted as described in § 3.12 ‘Mainnet and Testnet’. 5

Abstract

This ZIP describes a mechanism for users to rotate their signing keys.

Motivation

There are two facilities proposed to be added in the NU7 Network Upgrade that define authorization keys in consensus:

It would be beneficial for this mechanism to support rotation of both of these key types, and any similar key types defined by future facilities of the Zcash consensus protocol.

Use cases

Small-scale single issuer (e.g. toy usage)

ZSA asset bridges

Issuer merging

An issuer can choose to transfer all of their controlled assets to another issuer, by creating a single key rotation bundle that:

Privacy Implications

The mechanisms defined in this ZIP are only suitable for rotation of keys that are publically visible in the state of the consensus protocol.

Requirements

Non-requirements

Specification

Tracked signing keys

A tracked signing key is a signing key that is tracked by full validators, and provided by them as part of verifying changes to the global chain state made by any relevant transaction.

Theses are distinct from untracked (normal) signing keys, which are provided by transactions themselves, and are only used within the context of validating that single transaction.

Each tracked signing key has an associated protocol_type, identifying the signing protocol that the key is for. Tracked signing keys MUST use a protocol type defined in this ZIP.

The following protocol types are currently valid in consensus:

Protocol typecode Description
0 RedPallas
1 BIP340

Additional protocol types MAY be added to this ZIP via modifications specified in other ZIPs.

Rotation keys

Every tracked signing key has, in any given chain state, a corresponding “rotation key” that authorizes key rotation operations that change the tracked signing key.

Rotation keys are themselves tracked signing keys, and thus can also be rotated. As of the current revision of this ZIP, a rotation key is always its own rotation key; there are no “depth-2” rotation keys.

Rotation keys MAY be any valid protocol type.

Key usage

Each tracked signing key has an associated “usage”, specifying which sub-protocol (within the overall Zcash protocol) it is used within.

The set of defined key usages for tracked signing keys is as follows:

Usage typecode Description
1 ZIP TBD: Lockbox disbursements
2 ZIP 227: ZSA Issuance

Additional key usages MAY be added to this ZIP via modifications specified in other ZIPs.

Particular key usages MAY require a strict subset of the defined protocol types.

Note that no Rotation usage type is defined.

Key identifiers

Each tracked signing key has a corresponding “key identifier” key_id that represents it in the global chain state.

key_id is treated as an opaque byte string within the context of this ZIP. The format for any particular key_id is defined by the corresponding key usage in its relevant ZIP.

Consensus rule: (key_usage, key_id) MUST be globally unique.

Key Rotation Bundle

The transaction format for transaction version 6 is modified to contain an additional section:

+————————-+———————+—————–+————————————————————–+ | varies | nKeyRotations | compactSize | The number of KeyRotationAction entries in vKeyRotations | +————————-+———————+—————–+————————————————————–+ | ??? * nKeyRotations | vKeyRotations | ??? | A sequence of key rotation action descriptions | +————————-+———————+—————–+————————————————————–+

Global state

A key_pointer is the tuple (key_usage, key_id). - key_usage is defined above - key_id is a byte string defined at key registration or by consensus

The global chain state tracks:

Key registration

When registering a new key, the initial rotation key MAY be the same as the signing key. This will be the case for ZSA issuance keys.

Key rotation

A Key Rotation operation modifies the global state, by replacing the current key for a given key pointer with a new key.

A key rotation operation proceeds as follows:

WIP alternate encoding:

Key Rotation Actions

struct KeyRotation {
  /// The purpose of the key that is being rotated. Key purpose cannot change.
  key_purpose: KeyPurpose,
  /// The original key in the chain of keys that we're rotating. This implies the current rotation key.
  orig_key_pubkey: Vec<u8>,
  /// The protocol type of the new key being registered. Allowed changes to the protocol type are controlled by consensus;
  /// at present, this must always correspond to the protocol type for the existing key being rotated.
  new_key_protocol: KeyProtocol,
  /// The pubkey that will replace the current key for the given purpose in the chain descending from `orig_key_pubkey`.
  new_key_pubkey: Vec<u8>,
  /// The signature that validates against the rotation key for the key being replaced. This should sign the txid.
  rotation_auth_sig: Vec<u8>,
  /// A signature that proves control over the signing keys for `new_key_pubkey`. This should also sign the txid.
  evidence_sig: Vec<u8>,
}

+——————————-+———————+—————–+————————————————————–+ +——————————-+———————+—————–+————————————————————–+ +——————————-+———————+—————–+———————————————————————+ +——————————-+———————+—————–+———————————————————————+ +——————————-+———————+—————–+———————————————————————+

A new Key Rotation bundle

Consensus keys & Rotation Keys

Rotation keys

A rotation key provides the keyholder with the capability to create a valid signature authorizing the effects of a key rotation bundle.

Notes / Open Questions

Previously considered global state alternative (WIP)

The global chain state tracks maps of:

If a the key_state of an original_key has no parent_original_key, it may mutate itself.

Rationale

Deployment

This ZIP is proposed to activate with Network Upgrade 7. 8

Reference implementation

TBD

References