1

lets say i have the following address for recieving funds: addr_test1qzu70xm8hsez6nvmpgk4gjf48ev0y2hw5w7nf8xaxc658lzwczusckqvzzg630pxnzwj3pqza5q4c8r504ffq6v2zh6qgznxt7

when i try and get the wallet address (by using Berry-Pool nami wallet) i get: 00b9e79b67bc322d4d9b0a2d5449353e58f22aeea3bd349cdd363543fc4ec0b90c580c1091a8bc26989d288402ed015c1c747d5290698a15f4

how can i go from 00b9e79b67bc322d4d9b0a2d5449353e58f22aeea3bd349cdd363543fc4ec0b90c580c1091a8bc26989d288402ed015c1c747d5290698a15f4 to addr_test1qzu70xm8hsez6nvmpgk4gjf48ev0y2hw5w7nf8xaxc658lzwczusckqvzzg630pxnzwj3pqza5q4c8r504ffq6v2zh6qgznxt7

Thank you

2 Answers 2

2

Also you can use Cardano Serialization Lib https://github.com/Emurgo/cardano-serialization-lib

with the class Adress and the method Address.toBech32() :

let HexAddress = "00b9e79b67bc322d4d9b0a2d5449353e58f22aeea3bd349cdd363543fc4ec0b90c580c1091a8bc26989d288402ed015c1c747d5290698a15f4"

console.log(Address.from_bytes(Buffer.from(HexAddress,"hex")).to_bech32())
1
  • this is exactly what i was looking for. is there a way to use this library in vuejs?
    – Ofek Ron
    Commented Dec 27, 2021 at 17:08
1

They are encoded in different formats as the followings:

Bech32 Format:

addr_test1qzu70xm8hsez6nvmpgk4gjf48ev0y2hw5w7nf8xaxc658lzwczusckqvzzg630pxnzwj3pqza5q4c8r504ffq6v2zh6qgznxt7

Hex Format:

0b9e79b67bc322d4d9b0a2d5449353e58f22aeea3bd349cdd363543fc4ec0b90c580c1091a8bc26989d288402ed015c1c747d5290698a15f4

IOHK provides an executable and haskell lib for that in this repo.

To Hex,

bech32 <<< addr_test1qzu70xm8hsez6nvmpgk4gjf48ev0y2hw5w7nf8xaxc658lzwczusckqvzzg630pxnzwj3pqza5q4c8r504ffq6v2zh6qgznxt7

To Bech32,

bech32 addr_test <<< 00b9e79b67bc322d4d9b0a2d5449353e58f22aeea3bd349cdd363543fc4ec0b90c580c1091a8bc26989d288402ed015c1c747d5290698a15f4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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