As far as I understand from reading a specification and this blogpost, creating Omnilayer transactions is a rather tough thing to do yourself, because format is quite intricate. Are there any examples on how to create and decode omni transactions in javascript/python? Or maybe there is even some lightweight library for this?

What I'm trying to do is to send my custom omni transactions to blockchain.info testnet and later discover them by another app. That's why I need to be able to both create and decode them. However I couldn't find any helpful resources on how to accomplish this.

1 Answer 1


A was able to do that. I posted a small snippet:


If you're familiar with bitcoinjs-lib, the omni-specific piece of code for tx creation:

  const simple_send = [
    "6f6d6e69", // omni
    "0000",     // version
    "00000000001f", // 31 for Tether
    "000000003B9ACA00" // amount = 10 * 100 000 000 in HEX

  const data = Buffer.from(simple_send, "hex")

  const omniOutput = bitcoin.script.compile([
    // payload for OMNI PROTOCOL:

  tx.addOutput(recipient_address, fundValue) // should be first!
  tx.addOutput(omniOutput, 0)

  tx.addOutput(alice_address, skipValue)

If you're insterested in working towards publishing small library, feel free to tap me at https://bykhun.com


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.