# \[secp256r1\] What hash is used to generate address?

**URL:** <https://forums.sui.io/t/secp256r1-what-hash-is-used-to-generate-address/2175>\
**Category:** Technical Support\
**Created:** [January 9, 2023, 12:49pm UTC](https://forums.sui.io/t/secp256r1-what-hash-is-used-to-generate-address/2175 "2023-01-09T12:49:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [January 9, 2023, 12:49pm UTC](https://forums.sui.io/t/secp256r1-what-hash-is-used-to-generate-address/2175/1 "2023-01-09T12:49:29Z")

</div>

I know that for ed25519 and secp256k1 a sha3\_256 is used to hash keys to produce address.

My question is what hash is used for **secp256r1** keys?

---

<div class="post-metadata">

**Author:** ![joyqvq](https://avatars.discourse-cdn.com/v4/letter/j/85f322/32.png) [@joyqvq](https://forums.sui.io/u/joyqvq)\
**Post date:** [January 9, 2023, 6:51pm UTC](https://forums.sui.io/t/secp256r1-what-hash-is-used-to-generate-address/2175/2 "2023-01-09T18:51:45Z")

</div>

a SuiAddress is defined as the last sha3\_256 of a 1-byte signature scheme flag and a public key. The flag is 0x00 for Ed25519, 0x01 for Secp256k1 and 0x02 for Secp256r1.

> <https://github.com/MystenLabs/sui/blob/65efcc17564cdcc3b7d97bb11f767c0ccd6cc770/crates/sui-types/src/base_types.rs#L213-%23L224>

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [January 9, 2023, 8:25pm UTC](https://forums.sui.io/t/secp256r1-what-hash-is-used-to-generate-address/2175/3 "2023-01-09T20:25:00Z")

</div>

Ok, so it is the same for secp256r1 then. Great.

I’m implementing in python and wanted to check.

Thanks
