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

Add fingerprint to assets (cf: CIP-0014) #2512

Merged
merged 2 commits into from
Feb 11, 2021
Merged

Add fingerprint to assets (cf: CIP-0014) #2512

merged 2 commits into from
Feb 11, 2021

Conversation

KtorZ
Copy link
Member

@KtorZ KtorZ commented Feb 11, 2021

Issue Number

ADP-703

Overview

Motivation, design and rationale explained in: CIP-0014

Comments

@KtorZ KtorZ requested review from Anviking and rvl February 11, 2021 16:28
@KtorZ KtorZ self-assigned this Feb 11, 2021
@KtorZ KtorZ changed the title add fingerprint to all asset models next to the policy_id and asset_name add fingerprint to assets (cf: CIP-0014) Feb 11, 2021
@KtorZ KtorZ changed the title add fingerprint to assets (cf: CIP-0014) Add fingerprint to assets (cf: CIP-0014) Feb 11, 2021
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👌looks neat

toText = unTokenFingerprint

instance FromText TokenFingerprint where
fromText txt = case Bech32.decodeLenient txt of
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add a textRoundtrip test I take?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added

@Anviking
Copy link
Member

Anviking commented Feb 11, 2021

That said, it's arguably a bit complicated that:

  • assetName = not per se a presentable name
  • assetId = hex(policyId) <> hex(assetName) (needed in metadata, but not in wallet api)
  • assetFingerprint = bech32(someHash(policyId <> assetName))

@KtorZ
Copy link
Member Author

KtorZ commented Feb 11, 2021

That said, it's arguably a bit complicated that:

Isn't it? But there isn't much we can do about it unfortunately.

@KtorZ
Copy link
Member Author

KtorZ commented Feb 11, 2021

bors merge

iohk-bors bot added a commit that referenced this pull request Feb 11, 2021
2512: Add fingerprint to assets (cf: CIP-0014) r=KtorZ a=KtorZ

# Issue Number

<!-- Put here a reference to the issue that this PR relates to and which requirements it tackles. Jira issues of the form ADP- will be auto-linked. -->



# Overview

<!-- Detail in a few bullet points the work accomplished in this PR -->

Motivation, design and rationale explained in: [CIP-0014](cardano-foundation/CIPs#64)


# Comments

<!-- Additional comments or screenshots to attach if any -->

<!--
Don't forget to:

 ✓ Self-review your changes to make sure nothing unexpected slipped through
 ✓ Assign yourself to the PR
 ✓ Assign one or several reviewer(s)
 ✓ Jira will detect and link to this PR once created, but you can also link this PR in the description of the corresponding ticket
 ✓ Acknowledge any changes required to the Wiki
 ✓ Finally, in the PR description delete any empty sections and all text commented in <!--, so that this text does not appear in merge commit messages.
-->


Co-authored-by: KtorZ <[email protected]>
Co-authored-by: Johannes Lund <[email protected]>
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

Build failed:

#2500

@KtorZ
Copy link
Member Author

KtorZ commented Feb 11, 2021

bors retry

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Feb 11, 2021

Build succeeded:

@iohk-bors iohk-bors bot merged commit 655b7f4 into master Feb 11, 2021
@iohk-bors iohk-bors bot deleted the KtorZ/CIP-0014 branch February 11, 2021 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants