Move.

Post

Share your knowledge.

Bolke .
Jan 26, 2025
Expert Q&A

How to convert a public key to a Sui address?

I'm trying to convert a public key to a Sui address, but I'm unsure how to do this with Sui Move. I found some information about using BLAKE2b hashing function, but I'm not clear on why Sui Move doesn't provide a straightforward function for such an important task. How can I go about this conversion?

  • Move CLI
3
2
Share
Comments
.

Answers

2
Xavier.eth.
Jan 27 2025, 05:55

To convert a public key to a Sui address, you need to hash the signature scheme flag byte concatenated with the public key bytes using the BLAKE2b hashing function. The Sui address will be a 32-byte hash. You can find the BLAKE2b hashing function in the sui lib. If you're looking for a Rust example, you can check it out here.

3
Best Answer
Comments
.
skywinder.
Jan 26 2025, 10:09

While Sui Move does not provide this function directly, using the BLAKE2b hashing function as described should get you the desired Sui address. Concatenating the flag byte with your public key bytes is a crucial step in this process.

2
Comments
.

Do you know the answer?

Please log in and share it.

We use cookies to ensure you get the best experience on our website.
More info