Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imp CIP-1855: complement with CIP-0005 prefixes #194

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CIP-0005/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ We define the following set of common prefixes with their corresponding semantic
| `addr_shared_xvk` | CIP-1854's address extended verification key | Ed25519 public key with chain code |
| `kes_sk` | KES signing key | KES signing key |
| `kes_vk` | KES verification key | KES verification key |
| `policy_sk` | CIP-1855's policy private key | Ed25519 private key |
| `policy_vk` | CIP-1855's policy public key | Ed25519 public key |
| `pool_sk` | Pool operator signing key | Ed25519 private key |
| `pool_vk` | Pool operator verification key | Ed25519 public key |
| `root_sk` | CIP-1852's root private key | Ed25519 private key |
Expand Down Expand Up @@ -75,6 +77,7 @@ We define the following set of common prefixes with their corresponding semantic
| `script` | Script hash | blake2b\_224 digest of a serialized transaction script |
| `addr_vkh` | Address verification key hash | blake2b\_224 digest of a payment verification key |
| `addr_shared_vkh` | Shared address verification key hash | blake2b\_224 digest of a payment verification key |
| `policy_vkh` | Policy verification key hash | blake2b\_224 digest of a policy verification key |
| `stake_vkh` | Stake address verification key hash | blake2b\_224 digest of a delegation verification key |
| `stake_shared_vkh` | Shared stake address verification key hash | blake2b\_224 digest of a delegation verification key |
| `vrf_vkh` | VRF verification key hash | blake2b\_256 digest of a VRF verification key |
Expand Down
27 changes: 23 additions & 4 deletions CIP-1855/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
CIP: 1855
Title: Forging policy keys for HD Wallets
Authors: Samuel Leathers <[email protected]>, John Lotoski <[email protected]>, Michael Bishop <[email protected]>
Authors: Samuel Leathers <[email protected]>, John Lotoski <[email protected]>, Michael Bishop <[email protected]>, David Arnold <[email protected]>
Comments-Summary: Multi-party transaction signing and key management for HD wallets.
Comments-URI: https://github.com/cardano-foundation/CIPs/wiki/Comments:CIP-1855
Status: Draft
Expand All @@ -25,7 +25,8 @@ HD | Hierarchical Deterministic, refers to wallets as described in [BIP-00

## Overview

Forging tokens is derived from a script policy. The script policy includes hashes of keys needed to forge new tokens and must be witnessed by the keys with hashes listed.
Forging tokens is derived from a script policy. The script policy includes hashes of keys needed to forge new tokens and must be witnessed by these keys in such a way as the script stipulates.
This CIP defines the derivation path at wich parties are expected to derive such keys.

# Specification

Expand All @@ -38,19 +39,37 @@ m / purpose' / coin_type' / policy_ix'
```


To associate policy keys to a wallet, we reserve however `purpose=1855'` to reserve for policy keys for forging tokens. The coin type remains `coin_type=1815'` to identify Ada as registered in [SLIP-0044]. We use a hardened index for each policy key as derivation is not needed.
To associate policy keys to a wallet, we reserve however `purpose=1855'` for policy keys for forging tokens. The coin type remains `coin_type=1815'` to identify Ada as registered in [SLIP-0044]. We use a hardened index for each policy key as derivation is not needed.

We can summarize the various paths and their respective domain in the following table:

| `purpose` | `coin_type` | `policy_ix` |
| --- | --- | --- |
| `1855'` | `1815'` | `[2^31 .. 2^32-1]` |

## CIP-0005 prefixes

### Rationale
To distinguish such keys & derived material in the human readable prefix of the bech32 representation, we introduce the following prefixes for insertion into CIP-0005:

#### Keys

| Prefix | Meaning | Contents |
| --- | --- | --- |
| `policy_sk` | CIP-1855's policy private key | Ed25519 private key |
| `policy_vk` | CIP-1855's policy public key | Ed25519 public key |

#### Hashes

| Prefix | Meaning | Contents |
| --- | --- | --- |
| `policy_vkh` | CIP-1855's Policy verification key hash | blake2b\_224 digest of a policy verification key |

### Rationale
- ERC20 Converter IOHK is developing needs to keep track of policy keys. Rather than having randomly generated policy keys, a policy key can be associated with a mnemonic which is easier to backup.
- A 3rd party may want to have multiple tokens tied to same mnemonic, so we allow an index to specify the token.
- Contrary to CIP 1852, we don't use the `role` and `index` levels of the derivation path, since index is expressed at the 3rd level and no roles for policy signing keys are currently anticipated.

- No prefixes are defined for extended keys, since currently this CIP does not define further derivations.

- We use a different purpose for mainly two reasons:

Expand Down