Skip to content

Commit 01084ad

Browse files
authored
CIP-0014 | Adjust preamble and structure w.r.t CIP-0001 (cardano-foundation#658)
* first draft remediation of CIP-0014 * spelled NA instead of standard N/A
1 parent c7bb682 commit 01084ad

File tree

1 file changed

+45
-35
lines changed

1 file changed

+45
-35
lines changed

CIP-0014/README.md

+45-35
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
11
---
22
CIP: 14
33
Title: User-Facing Asset Fingerprint
4-
Authors: Matthias Benkort <[email protected]>, Rodney Lorrimar <[email protected]>
5-
Comments-Summary: A common format for displaying a user-facing identifier for assets.
6-
Comments-URI: https://github.com/cardano-foundation/CIPs/wiki/Comments:CIP-0014
74
Status: Active
8-
Type: Standards
5+
Category: Tokens
6+
Authors:
7+
- Matthias Benkort <[email protected]>
8+
- Rodney Lorrimar <[email protected]>
9+
Implementors: N/A
10+
Discussions:
11+
- https://github.com/cardano-foundation/CIPs/pull/64
912
Created: 2020-02-01
1013
License: CC-BY-4.0
1114
---
1215

13-
# Abstract
16+
## Abstract
1417

1518
This specification defines a user-facing asset fingerprint as a bech32-encoded blake2b-160 digest of the concatenation of the policy id and the asset name.
1619

17-
# Motivation
20+
## Motivation: why is this CIP necessary?
1821

1922
The Mary era of Cardano introduces the support for native assets. On the blockchain, native assets are uniquely identified by both their so-called policy id and asset name. Neither the policy id nor the asset name are intended to be human-readable data.
2023

2124
On the one hand, the policy id is a hash digest of either a monetary script or a Plutus script. On the other hand, the asset name is an arbitrary bytestring of up to 32 bytes (which does not necessarily decode to a valid UTF-8 sequence). In addition, it is possible for an asset to have an empty asset name, or, for assets to have identical asset names under different policies.
2225

2326
Because assets are manipulated in several user-facing features on desktop and via hardware applications, it is useful to come up with a short(er) and human-readable identifier for assets that user can recognize and refer to when talking about assets. We call such an identifier an _asset fingerprint_.
2427

25-
# Specification
28+
## Specification
2629

2730
We define the asset fingerprint in pseudo-code as:
2831

@@ -39,35 +42,13 @@ assetFingerprint := encodeBech32
3942

4043
where `|` designates the concatenation of two byte strings. The `digest-length` is given in _bytes_ (so, 160 bits).
4144

42-
# Rationale
45+
### Reference Implementation
4346

44-
## Design choices
45-
46-
- The asset fingerprint needs to be _somewhat unique_ (although collisions are plausible, see next section) and refer to a particular asset. It must therefore include both the policy id and the asset name.
47-
48-
- Using a hash gives us asset id of a same deterministic length which is short enough to display reasonably well on small screens.
49-
50-
- We use bech32 as a user-facing encoding since it is both user-friendly and quite common within the Cardano eco-system (e.g. addresses, pool ids, keys).
51-
52-
## Security Considerations
53-
54-
- With a 160-bit digest, an attacker needs at least 2^80 operations to find a collision. Although 2^80 operations is relatively low (it remains expansive but doable for an attacker), it
55-
is considered safe within the context of an asset fingerprint as a mean of _user verification_ within a particular wallet. An attacker may obtain advantage if users can be persuaded
56-
that a certain asset is in reality another (which implies to find a collision, and make both assets at the reach of the user).
57-
58-
- We recommend however that in addition to the asset fingerprint, applications also show whenever possible a visual checksum calculated from the policy id and the asset name as specified in [CIP-YET-TO-COME](). Such generated images, which are designed to be unique and easy to distinguish, in combination with a readable asset fingerprint gives strong verification means to end users.
59-
60-
# Backwards Compatibility
61-
62-
N/A
63-
64-
# Reference Implementation
65-
66-
## Javascript
47+
#### Javascript
6748

6849
[cip14-js](https://www.npmjs.com/package/@emurgo/cip14-js)
6950

70-
## Haskell (GHC >= 8.6.5)
51+
#### Haskell (GHC >= 8.6.5)
7152

7253
<details>
7354
<summary>Language Extensions</summary>
@@ -130,7 +111,7 @@ mkAssetFingerprint (PolicyId policyId) (AssetName assetName)
130111
hrp = [humanReadablePart|asset|]
131112
```
132113

133-
## Test Vectors
114+
### Test Vectors
134115

135116
> :information_source: `policy_id` and `asset_name` are hereby base16-encoded; their raw, decoded, versions should be used when computing the fingerprint.
136117
@@ -168,6 +149,35 @@ mkAssetFingerprint (PolicyId policyId) (AssetName assetName)
168149
asset_fingerprint: asset1pkpwyknlvul7az0xx8czhl60pyel45rpje4z8w
169150
```
170151
171-
# Copyright
152+
## Rationale: how does this CIP achieve its goals?
153+
154+
### Design choices
155+
156+
- The asset fingerprint needs to be _somewhat unique_ (although collisions are plausible, see next section) and refer to a particular asset. It must therefore include both the policy id and the asset name.
157+
158+
- Using a hash gives us asset id of a same deterministic length which is short enough to display reasonably well on small screens.
159+
160+
- We use bech32 as a user-facing encoding since it is both user-friendly and quite common within the Cardano eco-system (e.g. addresses, pool ids, keys).
161+
162+
### Security Considerations
163+
164+
- With a 160-bit digest, an attacker needs at least 2^80 operations to find a collision. Although 2^80 operations is relatively low (it remains expansive but doable for an attacker), it
165+
is considered safe within the context of an asset fingerprint as a mean of _user verification_ within a particular wallet. An attacker may obtain advantage if users can be persuaded
166+
that a certain asset is in reality another (which implies to find a collision, and make both assets at the reach of the user).
167+
168+
- We recommend however that in addition to the asset fingerprint, applications also show whenever possible a visual checksum calculated from the policy id and the asset name as specified in [CIP-YET-TO-COME](). Such generated images, which are designed to be unique and easy to distinguish, in combination with a readable asset fingerprint gives strong verification means to end users.
169+
170+
## Path to Active
171+
172+
### Acceptance Criteria
173+
174+
- [x] Asset fingerprints as described have been universally adopted in: wallets, blockchain explorers, query layers, token minting utilities, NFT specifications, and CLI tools.
175+
176+
### Implementation Plan
177+
178+
- [x] Reference implementations available in both Javascript and Haskell.
179+
- [x] Public presentation with confirmed interest in adopting this standard in advance of Mary ledger era.
180+
181+
## Copyright
172182
173-
CC-BY-4.0
183+
This CIP is licensed under [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/legalcode).

0 commit comments

Comments
 (0)