Search code examples
wavesplatform

How to decode attachment in Waves?


How can I decode waves tx attachment with javascript?

"attachment": "3vqXJBWJCU"

Need to decode in 1d1c0f375c646b70


Solution

  • This attachment is base58 encoded. If you need fast decoding you can use any online base58 encoding/decoding service, but it's not recommended to encode/decode seed phrase online. By the way, I'm using this one JavaScript base58 decoder: https://github.com/cryptocoinjs/bs58

    Here is an example of decoding:

    const bs58 = require('bs58')
    
    const attachment = '3vqXJBWJCU'
    const bytes = bs58.decode(attachment)
    console.log(bytes.toString('hex'))
    // => MESSAGE