While examining the json rpc response I encountered a transaction inside of "internal_operation_results" which has parameters (its inside of a tokenToCash contract call). Addresses specified in those parameters do not have the standard readable format (015d3457613be02737706699883bf10f8f079be70400 in this example). While inspecting the transaction in a blockexplorer (https://tzkt.io/ooBtrjSSPuRijLpQhktxrHWR4X8auavYHCnero45vqpud39miER in this case) it shows the readable format (tz1acb9QgYWqt13WUmkXSaaM2bXwZyQthcnT).
How do I convert from the seemingly hex representation to the readable one? Explanation of the format and or code snippets in C# or python please.
Edit: (i have found a solution)
solution in form of C# code snippet
static string convert(string hexstring) { var bytes = System.Convert.FromHexString(hexstring); var prefix = (bytes[0], bytes[1], bytes[21]) switch { (0, 0, _) => new byte[] { 6, 161, 159 }, // tz1 (0, 1, _) => new byte[] { 6, 161, 161 }, // tz2 (0, 2, _) => new byte[] { 6, 161, 164 }, // tz3 (1, _, 0) => new byte[] { 2, 90, 121 } // KT1 }; var pkh = bytes[0] == 0 ? bytes[2..22] : bytes[1..21]; var arr = new byte[pkh.Length + prefix.Length]; prefix.CopyTo(arr, 0); pkh.CopyTo(arr, prefix.Length); var address = Base58Check.Base58CheckEncoding.Encode(arr); // tz1XrwX7i9Nzh8e6UmG3VnFkAeoyWdTqDf3U return address; } Base58Check is from nuget package (Base58Check --version 0.2.0)