I had asked a question earlier about compressing the transaction hex as it was used in a project that involved sending text messages (160 characters limit per message):

Compress transaction hex string

So I have used a different approach and here's the project details: https://github.com/prayank23/OfflineTx

Converting transaction hex to words is working as expected. I have issues decoding the words to transaction hex using python code mentioned here: https://gist.github.com/grubles/41a8ab74afe2cee6ef7128b07438455b

It doesn't return the last 4 characters when trying to decode the words.

Values used in this example:

Tx hex:



answer frost position wrote message message actually calm energy iron dust valley music rock core blink regret frighten wife moonlight weave shove pride add mystery veil press gentle collapse aunt like like like skin tool patient dirt muscle holy like like like apple also also goodbye bone raise women along rainbow approach caught drag radio concern rose hate great yell worse forever stuck like like like alive bid tool shy flood truly house knock fade blow paint forest street stain mock never murder plant void history sentence rant often loose often utter book explain born point throughout hero gone worship closet canvas please sanctuary too although upon truly shimmer wow rather laugh simply twenty creation take garden innocent bench kiss companion reveal nine shall stolen angel dark candle dew anymore disguise darling happiness bound treat morning group weave stand grown ourselves rhyme bowl consider grace worse other torment like half law shower fruit reality dread third barely enough nail match rare manage tower honor ready


2 Answers 2


Grubles shared the reason why this didn't work and I had issues while decoding in this tweet thread: https://twitter.com/notgrubles/status/1336709747756724227

Required the hex to be divisible by 8 basically. If it wasn't the encoder would chop off the remainder. So when you would go to decode the words, you would end up with more or less the same result as you began with but with some bytes missing at the end.

New and improved hex to mnemonic encoder/decoder based on Joe Reuther's script. Mainly useful for camouflaging bitcoin stuff (addresses, PSBTs, etc) or for moving transaction data between online and offline computers w/o using QR.



The last word is a checksum and contains no entropy or key material. When you go from hex to words, it adds a checksum at the end. When you go from words to hex it drops the checksum as it is only there as a safety check and is not needed for converting into a public key or signing transactions.

  • That is a good hint I guess. But I am still trying to figure out how to resolve this and what should I change in decode()
    – user103136
    Commented Oct 28, 2020 at 16:32
  • The issue is resolved using a different script: twitter.com/notgrubles/status/1336743010068000768
    – user103136
    Commented Dec 9, 2020 at 19:18

Your Answer

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