7

I have an question about the asset fingerprint.

For example here: https://pool.pm/333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b.ExtraHate067 it shows asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm

here it shows the same: https://cardano-tools.io/latest?q=ExtraHate067

but the explorer https://explorer.cardano.org/en/transaction?id=0d560535733237eaafa4f3c25e648d147dc93a048e3dc66e5199cd86986b5a2c shows asset1q7c0qhulpty4tcdp3cwt8eg5edws9c8lqyldlr did they change the hash algorithm?

1
1

Wow, good catch. You can see fingerPrint function here. It's located in cardano-graphql project.

export const assetFingerprint = (asset: Pick<Asset, 'assetName' | 'policyId'>) =>
  new AssetFingerprint(
    Buffer.from(asset.policyId, 'hex'),
    asset.assetName !== '' ? Buffer.from(asset.assetName, 'hex') : undefined)
    .fingerprint()

After running this code

const fingerPrint = ({ policyId, assetName }) => {
  const af = new AssetFingerprint(
    Buffer.from(policyId, 'hex'),
    Buffer.from(assetName, 'hex'),
  ).fingerprint()

  return af
}

const combinations = [
  {policyId:'333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b',
   assetName:'457874726148617465303637'},
  {policyId: "",
   assetName:'457874726148617465303637'},
  {policyId: '333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b',
   assetName: ""},
]

combinations.map(fingerPrint)

I got

[
  'asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm',
  'asset1q7c0qhulpty4tcdp3cwt8eg5edws9c8lqyldlr',
  'asset19nqnahcv54krdv8mcc0ne60wlkealw5qaztzvp'
]

Which means that policyId is missing in the explorer but the fingerprint function is the same.

You can rerun my code in replit.

I also created an issue for cardano-explorer-app.

2

This looks like a bug in explorer.cardano.org.

You can use the JS package @emurgo/cip14-js to check for yourself.

import AssetFingerprint from '@emurgo/cip14-js'

const assetFingerprint = new AssetFingerprint(
    Buffer.from('333427e94971f530653bb945f34f914252ad570c0b84dfd8c8e8c97b', 'hex'),
    Buffer.from('457874726148617465303637', 'hex'),
  )
assetFingerprint.fingerprint()
// returns asset1yjj6l5ude4gf274ya0exk4vymaaj0464yxmnvm
1

Fixed in https://github.com/input-output-hk/cardano-graphql/pull/526. Thanks for the investigation.

Edit: Released in 5.0.0, adopted by cardano-explorer-app in 1.6.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.