# How to get coin's name?

**URL:** https://chiaforum.com/t/how-to-get-coins-name/732
**Category:** Chia Development
**Created:** [July 21, 2025, 8:44am UTC](https://chiaforum.com/t/how-to-get-coins-name/732 "2025-07-21T08:44:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![pisa](https://avatars.discourse-cdn.com/v4/letter/p/0ea827/32.png) [@pisa](https://chiaforum.com/u/pisa)
#### Post date: [July 21, 2025, 8:44am UTC](https://chiaforum.com/t/how-to-get-coins-name/732/1 "2025-07-21T08:44:46Z")

</div>

hi, all, from the chia docs:coin name = sha256(parent\_coin + puzzle\_hash + amount).  
here is my python util, but the result is not right:

```auto
import hashlib, struct

parent_coin_info = bytes.fromhex("fdc7526bfc5107e000b4f710c8c5944f11f4e7ce9711c522b6040bc473266313")
puzzle_hash = bytes.fromhex("5198fccb3ca8f14c32a5f05ac50c98209defd2d3ed3ee2a17789a9f6fd7d433b")
amount = 82488031983 # in mojos   
payload = parent_coin_info + puzzle_hash + struct.pack("<Q", amount)

coin_name = "0x" + hashlib.sha256(payload).hexdigest()
print(coin_name)

# The output is : 0x1d04cf77cefc246ca0333e04c691b75e427b856f09cf02d3bc53b5c46552b8d5
# But the right result is : 0x7a639649fa2b6b4233cab7bf98b3da01be182afba622eb377011ac0940cd83c8

```

---

<div class="post-metadata">

### Author: ![clydewallace22](https://yyz1.discourse-cdn.com/flex031/user_avatar/chiaforum.com/clydewallace22/32/10_2.png) [@clydewallace22](https://chiaforum.com/u/clydewallace22)
#### Post date: [July 25, 2025, 8:11pm UTC](https://chiaforum.com/t/how-to-get-coins-name/732/2 "2025-07-25T20:11:46Z")

</div>

It looks like you are using little endian which does not create the correct hash. This is the source used by chia-blockchain for calculating ids (note the special handling for the amount):

> <https://github.com/Chia-Network/chia_rs/blob/8703d67d83f513c90321f656ce5db2ee3544ecef/crates/chia-protocol/src/coin.rs#L24>

If further questions arise feel free to jump into the chia discord where I and others are available to help:

> **[Join the Chia Network Discord Server!](https://discord.com/invite/chia)**
>
> Delivers software for enterprises to tokenize, custody, and trade any asset with auditable authenticity and provenance. | 4922 members
