There is a code on this link (https://tezos.stackexchange.com/a/5908/8795) that decodes a packed address using code that is taken from PyTezos .

I am trying to achieve the same using smartpy inside a contract . Here is the link of smartpy code that I have been working on, https://smartpy.io/ide?cid=QmRhrsKfaBmEvogNKcN86CNTxr8Sdcy81YbG82XKMrSDBn&k=044736497db8cdf491c7

But I got stuck at last part , base58.b58encode_check(encoding[2] + v).decode() (this is kept on todo of smartpy code). basically I am stuck on the part where the byte is being sent to b58encode_check function and then the result is being decoded.

I am trying to decode only those address that starts from tz1, tz2, tz3, tz4 and KT1 .

Can anyone helps me complete this code ? Any idea would work too ?

  • 1
    Hi Kin, multiple people have asked you to explain your usecase for trying to get addresses as strings. This isn't something thats supported currently and there are many other ways to work around this that might be better suited to what you are trying to achieve. Please take the time to explain what it is you are trying to build and members of the community might be able to help you find a different/easier approach to accomplish what you need
    – Simon McLoughlin
    Apr 17, 2023 at 9:55


Your Answer

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

Browse other questions tagged or ask your own question.