How to decode the Application response from Golang SDK

Hi guys, I need help.

So I have an application where inside of it, my colleagues store the global state of an escrow address. I can easily fetch the global state using the goal command:

goal app read --app-id 206 --global --guess-format

The response:

 "Creator": {
  "tt": 1
 "Escrow": {
  "tt": 1

But, I need to get the escrow address from the golang SDK, using this API:


but the returned escrow address seems to be encoded.

        "extra-program-pages": 1,
        "global-state": [
               "key": "RXNjcm93",
               "value": {
                          "bytes": "XqC3xjtJp+7hfx2BBSuVEU3OQICBvevFzc6waewDot8=",
                          "type": 1,
                          "uint": 0

So how do I decode it so I can get the escrow address inside the “bytes”? Thank you

This is base64.
Decode the base64 into a 32-byte string.
This is the public key.

Then you need to convert it to an Algorand address by adding a checksum.
With the Go SDK, just cast the 32-byte string into an Address and use the String method: go-algorand-sdk/address.go at develop · algorand/go-algorand-sdk · GitHub

See also Overview - Algorand Developer Portal

Great! Thanks for the explanation.