1

I've been trying to use the stellar-archivist command 'dumpxdr' to unpack transactions files that are stored in the stellar core history

However the in the results asset codes and addresses appear in an unusual format:

"Asset": {
                                    "Type": 1,
                                    "AlphaNum4": {
                                        "AssetCode": [
                                            66,
                                            84,
                                            67,
                                            0
                                        ],
                                        "Issuer": {
                                            "Type": 0,
                                            "Ed25519": [
                                                63,
                                                240,
                                                248,
                                                202,
                                                234,
                                                182,
                                                83,
                                                235,
                                                9,
                                                242,
                                                59,
                                                84,
                                                254,
                                                175,
                                                46,
                                                84,
                                                240,
                                                194,
                                                151,
                                                210,
                                                16,
                                                45,
                                                49,
                                                56,
                                                1,
                                                35,
                                                9,
                                                153,
                                                40,
                                                229,
                                                92,
                                                245
                                            ]
                                        }
                                    },

I would like to see it as a regular stellar address (56 letters, starts with G)

1

2 Answers 2

4
  • Start with 32 bytes
  • Add a byte of 0x30 as prefix 'G' (now you have 33 bytes)
  • Calculate the checksum (two bytes)
  • Add the checksum as suffix (now you have 35 bytes)
  • Convert them to base32
  • That's your public key

Apply the same but using 'S' (byte 0x90) as prefix for secret keys

3
  • Which type of checksum? Is it CRC32? If so, doesn't that provide four bytes?
    – Zhami
    Commented Feb 27, 2018 at 14:01
  • Ah, I believe the checksum is CRC16-CCITT (based on looking at the Python code referenced below).
    – Zhami
    Commented Feb 27, 2018 at 14:38
  • ChecksumXmodem from what I've read
    – Kuyawa
    Commented Feb 27, 2018 at 22:38
0

Found an answer using the stellar python library

from stellar_base import utils
x = bytearray(Ed25519 array here)  
account = utils.encode_check('account',x)

However I still have no idea what exactly is happening here, so I would appreciate any answer regardless :)

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.