github OmniLayer/omnicore v0.12.0
Omni Core v0.12.0

latest release: v0.12.0.1
21 months ago

v0.12.0 is a major release and adds the ability to send tokens from one address to multiple receivers within one transaction.

This release is mandatory and changes the rules of the Omni Layer protocol. An upgrade is required.

Upgrading from Omni Core 0.11 does not require a rescan and can be done very fast with minimal interruption.

Please report bugs using the issue tracker on GitHub:

https://github.com/OmniLayer/omnicore/issues

Table of contents

  • Omni Core v0.12.0
  • Upgrading and downgrading
    • How to upgrade
    • Downgrading
    • Compatibility with Bitcoin Core
  • Improvements
    • Send to many
    • Blocktime in RPCs
  • Change log
  • Credits

Upgrading and downgrading

How to upgrade

If you are running Bitcoin Core or an older version of Omni Core, shut it down. Wait until it has completely shut down, then copy the new version of omnicored, omnicore-cli and omnicore-qt. On Microsoft Windows the setup routine can be used to automate these steps.

When upgrading from a version older than 0.8.0, the database of Omni Core is reconstructed, which can easily consume several hours. During the first startup historical Omni Layer transactions are reprocessed and Omni Core will not be usable for several hours up to more than a day. The progress of the initial scan is reported on the console, the GUI and written to the debug.log. The scan may be interrupted and can be resumed.

Upgrading from 0.11 does not require a rescan and can be done very fast with minimal interruption.

Downgrading

Downgrading to an Omni Core version prior to 0.12.0 is not supported.

Compatibility with Bitcoin Core

Omni Core is based on Bitcoin Core 0.20.1 and can be used as replacement for Bitcoin Core. Switching between Omni Core and Bitcoin Core is supported.

However, it is not advised to upgrade or downgrade to versions other than Bitcoin Core 0.18. When switching to Omni Core, it can be necessary to reprocess Omni Layer transactions.

Improvements

Send to many

This change adds the ability to construct and send send-to-many transactions.

Please note, this transaction type is not available on mainnet until after its activation. A notice will be posted on Twitter and the Omni Layer mailing list. Testing on testnet and regtest mode is available from the start.

What can you do?

  • Send send-to-many transactions
  • Construct payloads for send-to-many transactions
  • Parse and retrieve data of send-to-many transactions

What's new?

A new transaction type 7 is introduced to transfer multiple tokens of one property id to multiple receivers. Check out this link for a more detailed view.

Two new RPCs were added to facilitate the new feature:

  • omni_sendtomany to send send-to-many transactions via the user's wallet.
  • omni_createpayload_sendtomany to construct the plain payload. Note however, the rest of the transaction, in particular actually adding outputs for each receiver is still necessary.

What else is affected?

  • omni_gettransaction can be used to retrieve information about send-to- many transactions. The new fields receivers, which provides a list for every receiver, and totalamount are most relevant for this transaction. See the examples below.
  • The change output of Omni transactions is no longer random, but added to the end of the transaction. This affects all Omni transactions generated by this version of Omni Core.
  • The transaction history window of the Qt client properly shows send-to-many transactions.

Example 1:

You are a low level developer and want to manually craft transactions, then you can use the raw transaction interface of Omni Core. To construct the payload for a send-to-many transaction:

omni_createpayload_sendtomany 31 '[{"output": 2, "amount": "10.5"}, {"output": 3, "amount": "0.5"}, {"output": 5, "amount": "15.0"}]'
000000070000001f0302000000003e95ba80030000000002faf080050000000059682f00

Example 2:

You have tokens in your wallet, which you want to transfer to two receivers, three units to one, five units to the other one:

omni_sendtomany "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C" 3 '[{"address": "mnM5bS3qQTxZSHkgpp2LDcKYL5thWtqCD6", "amount": "3"}, {"address": "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C", "amount": "5"}]'
55d9f3eb56a5de5afef6b1d5dcdc2300d26d0aafcacbbfe387cba0983e0644fa

Example 3:

To then retrieve information about the transaction, you can use omni_gettransaction, which has the new fields receivers and totalamount.

omni_gettransaction 55d9f3eb56a5de5afef6b1d5dcdc2300d26d0aafcacbbfe387cba0983e0644fa
{
  "txid": "55d9f3eb56a5de5afef6b1d5dcdc2300d26d0aafcacbbfe387cba0983e0644fa",
  "fee": "0.00002420",
  "sendingaddress": "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C",
  "ismine": true,
  "version": 0,
  "type_int": 7,
  "type": "Send To Many",
  "propertyid": 3,
  "divisible": false,
  "receivers": [
    {
      "output": 1,
      "address": "mnM5bS3qQTxZSHkgpp2LDcKYL5thWtqCD6",
      "amount": "3"
    },
    {
      "output": 2,
      "address": "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C",
      "amount": "5"
    }
  ],
  "totalamount": "8",
  "valid": false,
  "invalidreason": "Not enough funds in user address",
  "blockhash": "1ca23be7bee5dc915e76292e78aa1b42d75e4a3819d91871e69b24d292930687",
  "blocktime": 1648120618,
  "positioninblock": 2,
  "block": 112,
  "confirmations": 1
}

Example 4:

Say you are a developer again and want to take a look at the above created transaction on a Bitcoin protocol level, then:

getrawtransaction 55d9f3eb56a5de5afef6b1d5dcdc2300d26d0aafcacbbfe387cba0983e0644fa 1
{
  "txid": "55d9f3eb56a5de5afef6b1d5dcdc2300d26d0aafcacbbfe387cba0983e0644fa",
  "hash": "d74b35b379f4796c918cc2475d4942f0a2e3caf9ae345488f56bac92384145ef",
  "version": 2,
  "size": 323,
  "vsize": 242,
  "weight": 965,
  "locktime": 0,
  "vin": [
    {
      "txid": "2a89b07484fe8aa2b3038d32e2888b9b30de4553e23136e324502a0f049ed6b1",
      "vout": 3,
      "scriptSig": {
        "asm": "00149cae6190b0802e646e93b9006b7239b036002ca0",
        "hex": "1600149cae6190b0802e646e93b9006b7239b036002ca0"
      },
      "txinwitness": [
        "30440220651224e5c625d8163cb6e2971f58b191109b5dc02fb821694ada765ab424b23602206cd8787258b3538f78f157ac6d1d520a21d3e1febda9477d77120e171d0225a301",
        "02d0c8e0f374949dae9c0855d56af23b4d64c3c128fe336cd36a5270b2898a9964"
      ],
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_RETURN 6f6d6e69000000070000000302010000000000000003020000000000000005",
        "hex": "6a1f6f6d6e69000000070000000302010000000000000003020000000000000005",
        "type": "nulldata"
      }
    },
    {
      "value": 0.00000546,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 4aead0759e716330b6c76ffaa4be6d27124efcef OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9144aead0759e716330b6c76ffaa4be6d27124efcef88ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mnM5bS3qQTxZSHkgpp2LDcKYL5thWtqCD6"
        ]
      }
    },
    {
      "value": 0.00000540,
      "n": 2,
      "scriptPubKey": {
        "asm": "OP_HASH160 b213aa3f6789fa2dca904d41d2bc4877d8437aa4 OP_EQUAL",
        "hex": "a914b213aa3f6789fa2dca904d41d2bc4877d8437aa487",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C"
        ]
      }
    },
    {
      "value": 4.99981210,
      "n": 3,
      "scriptPubKey": {
        "asm": "OP_HASH160 b213aa3f6789fa2dca904d41d2bc4877d8437aa4 OP_EQUAL",
        "hex": "a914b213aa3f6789fa2dca904d41d2bc4877d8437aa487",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N9UopnCBgbC6wAjMaiqrBZjmgNFiZccY7C"
        ]
      }
    }
  ],
  "hex": "02000000000101b1d69e040f2a5024e33631e25345de309b8b88e2328d03b3a28afe8474b0892a03000000171600149cae6190b0802e646e93b9006b7239b036002ca0feffffff040000000000000000216a1f6f6d6e6900000007000000030201000000000000000302000000000000000522020000000000001976a9144aead0759e716330b6c76ffaa4be6d27124efcef88ac1c0200000000000017a914b213aa3f6789fa2dca904d41d2bc4877d8437aa4879a1bcd1d0000000017a914b213aa3f6789fa2dca904d41d2bc4877d8437aa487024730440220651224e5c625d8163cb6e2971f58b191109b5dc02fb821694ada765ab424b23602206cd8787258b3538f78f157ac6d1d520a21d3e1febda9477d77120e171d0225a3012102d0c8e0f374949dae9c0855d56af23b4d64c3c128fe336cd36a5270b2898a996400000000",
  "blockhash": "1ca23be7bee5dc915e76292e78aa1b42d75e4a3819d91871e69b24d292930687",
  "confirmations": 1,
  "time": 1648120618,
  "blocktime": 1648120618
}

The above examples were created locally in regtest mode.

Blocktime in RPCs

The attribute "blocktime" was added to the matches of MetaDEx trades, when using the RPCs "omni_gettrade", "omni_gettradehistoryforaddress" and "omni_gettradehistoryforpair".

Change log

The following list includes relevant pull requests merged into this release:

Credits

Thanks to everyone who contributed to this release, especially to Peter Bushnell, Sean Gilligan and Marv Schneider.

Don't miss a new omnicore release

NewReleases is sending notifications on new releases.