Introducing funded Omni Layer transactions or “how exchanges can save money”

dexx
omnilayer
Published in
4 min readSep 25, 2018

Because Omni Layer transactions are Bitcoin transactions, transaction fees nominated in Bitcoin must be paid.

So far, when using a new destination to receive digital tokens, the receiver therefore usually also needs to transfer some additional Bitcoin, so he or she can make another transfer from the new destination at some point later.

This is especially cumbersome for exchanges and integrators, who provide different destinations for every user, because they first need to fund the destination with Bitcoin to sweep incoming tokens, which results in additional transaction fees.

The usual case

Say Alice sends 100 Omni to Bob’s altcoin exchange, which generated a new address for this deposit. Attached to this transaction, Bob’s exchange also receives a tiny amount of bitcoins, usually 0.0000543 BTC, which are there to “tag” the receiver of the 100 Omni tokens. When Bob now wants to move the tokens, for example to pay out another customer, or to move the tokens to a cold storage, then he needs to fund the destination with some bitcoins to cover the transaction fees for the next transaction, because the tiny amount sent by Alice isn’t enough to also cover the transaction fee. So for two token transfers, three transactions are created:

  • Alice sends 100 Omni to Bob’s exchange
  • Bob sends some extra bitcoins to Alice deposit destination, to cover upcoming transaction fees of the next transaction
  • Bob creates another transaction, to transfers the 100 Omni to the exchange’s cold storage (or anywhere else)

With up to 25.000 Omni Layer transactions per day — many of them being transfers from and to exchanges — this is rather inefficient and cost-intensive for exchanges and integrators.

To optimize this and similar use cases, we’ve added funded Omni Layer transactions to our latest release of Omni Core.

Funded Omni Layer transactions

Omni Core v0.3.1 introduces two new commands, which allow the creation of Omni Layer transactions that are funded and paid for by different sources.

The first new command “omni_funded_send” can be used to transfer a specific amount of tokens, while paying for the Bitcoin fees from a different source:

Description of the new RPC “omni_funded_send”

The other command “omni_funded_sendall” can be used to sweep all tokens of a source of one “ecosystem”, while paying transaction fees from another. Tokens on the Omni Layer are categorized in two ecosystems, which are specified during the token creation. Tokens that are used in production environments, like Omni, MaidSafeCoin, or TetherUS, use the “main” ecosystem, while test tokens should use the “test” ecosystem. This is merely a label and it’s up to each token’s issuer to place their token into one of these. With the “sendall” command, all tokens of the given ecosystem are transferred, which allows to sweep the whole available balance of multiple tokens in one step:

Description of the new RPC “omni_funded_sendall”

Details you should keep in mind

When using and integrating the new commands, a few notes about their behavior may be highlighted:

(1) While Bitcoin transaction fees can be paid from another source, these commands don’t allow to spend tokens from multiple sources at the same time. Tokens are only spent from the specified “fromaddress”.

(2) Bitcoins from the “feesource” are only consumed, if needed. If the sender has enough bitcoins to cover the transaction, then no bitcoins are spent from the fee source.

(3) Even if the sender has enough bitcoins to cover the transaction, the whole Bitcoin balance is spent. Any leftover is sent to the “change” destination. The underlying idea is that when tokens are swept, bitcoins should be swept as well, so there is no need to retrieve any leftovers at some point later.

(4) Change, the leftover amount of bitcoins that was not spent for transaction fees and to tag the recipient of the transaction, is send to the given “change” destination, which is also specified by the “feesource”.

Please feel free to reach out to us, if you need help with an integration of the new commands. We also encourage all integrators and exchanges to list Omni, the native token of the Omni Layer protocol.

If you are curious about how the Omni Layer protocol works, or have a question in general, please also don’t hesitate to get in touch.

You can follow us on Twitter, Reddit or join our Telegram group, and if you like this article, please feel free to share it or click the 👏 button below!

--

--

dexx
omnilayer

Maintainer of Omni Core, the reference client for the Omni Layer, and contributor to a variety of Bitcoin related projects, such as Bitcoin Core and bitcoinj.