<blockquote>
<p>Question 1) why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.</p>
</blockquote>
<p>As Murch said, Omni uses Bitcoin as its immutable database. So Omni is like a separate blockchain, since the contents of Omni transactions embedded in the Bitcoin blockchain are not relevant to Bitcoin nodes. If there's an invalid Omni transaction, then BTC nodes would still accept it.</p>
<p>Omni doesn't have a directly-connecting peer-to-peer network. It relies on data pushes on Bitcoin.</p>
<blockquote>
<p>Question 2) let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: P2SH Scripts, but wanted to make sure.</p>
</blockquote>
<p>They could use P2SH - I have a website that uses P2SH to embed data in the blockchain, and it works perfectly. However, currently Omni uses bare OP_RETURN scripts. Most likely, they never thought about using P2SH when they first designed it so they might not afford a breaking change (for Omni, not for BTC) introducing P2SH data pushes. P2SH pushes - are actually currently more <a href="https://github.com/bitcoin/bitcoin/issues/12033" rel="noreferrer">feasible</a>.</p>
<blockquote>
<p>Question 3) if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related P2SH Scripts from bitcoin itself . right ?</p>
</blockquote>
<p>Omni has its own software - a fork of Bitcoin Core. They listen to the Bitcoin network and update their blockchain. If they pulled data from P2SH every time, that would be a waste of computing resources.</p>
<p>So every time a new Omni update on Bitcoin occurs, they update <em>their</em> blockchain, then use their blockchain as their data source.</p>

CC BY-SA 4.0
2021-01-12T17:25:39.530Z
Thanks for answering. The thing I don't understand is the following: Okay, omni is a separate blockchain. it has the smart contract feature or something like this, so we can create assets on it and be able to transfer it. So, when I make a transaction, it goes to omni nodes. Now, what does omni node do ? doesn't it put and store the actual in its own ledger and share it to every other node ? why does it need the bitcoin blockchain at all ?
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T17:49:43.560Z
@NikaKurashvili Your transaction doesn't go to omni nodes. Your transactions is processed by the Bitcoin network. Once it is included in a block, the omni nodes which receive the new block write the new transaction, if it's valid, to their database. This saves Omni from needing to have its own network miners.
MCCCS
CC BY-SA 4.0
2021-01-12T18:12:03.383Z
let's say i am a normal user and going to transfer 3 asset from my address to someone else.  I make a transaction, it goes to the omni blockchain, which does some stuff on it so that bitcoin nodes would accept it.after bitcoin nodes have this transaction, they include it in a block. I guess,omni listens to the new block so that it can also add this new block to its own database. Am I all correct? It turns out then that omni blockchain seems to have one single database. and the only purpose of it is to modify transactions into OP_RETURN code or something so that it would get accepted by bitcoin
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T18:17:33.237Z
@NikaKurashvili No no, your wallet creates your Omni transaction and adds it to a your new Bitcoin transaction's OP_RETURN (those two transactions are constructed at the same time since the Bitcoin transaction too needs to follow the Omni specification). The Bitcoin nodes receive and Bitcoin miners accept your transaction. Every time a new block is accepted, Omni nodes, who connect to Bitcoin nodes, also receive the block and scan it for Omni transaction. Valid ones are added to their Omni blockchain.
MCCCS
CC BY-SA 4.0
2021-01-12T18:20:40.863Z
aha, so basically omni nodes do exist and they store the copy of the ledger too.  It's just omni uses bitcoin blockchain so that transaction confirmations, verification of signatures, longest blockchain rule and many more happen on the bitcoin. Omni seems to be just a redirection mechanism and is just a very simplified than the bitcoin. correct ?
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T18:22:47.130Z
@NikaKurashvili Yes, exactly! It's Bitcoin's job to determine the accepted, immutable order of transactions. The rest is handled by Omni, which doesn't have a separate network but they just listen for new Bitcoin blocks. (So yes, 100% of what you said)
MCCCS
CC BY-SA 4.0
2021-01-12T18:23:50.607Z
Any idea why they implemented/created OMNI at all ? it seems like it's good to create assets. Ethereum is just there. why use omni at all ?
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T18:25:09.340Z
Because Ethereum didn't exist when Omni was created.
MCCCS
CC BY-SA 4.0
2021-01-12T19:06:16.897Z
I have two questions if you don't mind. 1) So, wallet creates bitcoin transaction with OP_RETURN, and passes its own omni data. I think, in order for a user to use OMNI, he first has to be the user of the bitcoin and has some unspent transactions, because when omni wallet creates a btc transaction and sends it, it first needs to be signed by the private key that owns some money on bitcoin network since transactions are costly. agree ?
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T19:06:22.303Z
2) https://gist.github.com/caffeinum/f64a51ce55d5ac9075bb2f5f2f439c0d there is a line -   `tx.addOutput(recipient_address, fundValue)`.  since we are talking about tokens, why do we actually send btc to the recipient too ?
Nika Kurashvili
CC BY-SA 4.0
2021-01-12T19:15:38.360Z
@NikaKurashvili 1 is correct, that's why Omni Core [shows](https://camo.githubusercontent.com/2244be2f89bf3fb70580a94913276a0d6f0658be0c79bc5b970e2dad9d0904db/687474703a2f2f692e696d6775722e636f6d2f5a3079713675462e706e67) the Bitcoin balance as well. 2 because that's what the specification [requires](https://github.com/OmniLayer/spec/blob/master/OmniSpecification.adoc#711-transfer-coins-simple-send). (And the destination address is called the *reference*). 546 satoshis is used since it's the smallest amount while Bitcoin considers it to be a *standard* transaction and
MCCCS
CC BY-SA 4.0
2021-01-12T19:16:22.127Z
the real transferred token value is in OP_RETURN. Sending very little BTC to the reference allows saving bytes by not also having to add the reference to OP_RETURN.
MCCCS
CC BY-SA 4.0
2021-01-10T19:19:16.543Z
2021-01-10T19:19:16.543Z
MCCCS
<p>I was looking into omni protocol and couldn't quite figure out some things. I'd really appreciate your opinions. I tried to look into all the bitcoin stachexchange answers, but nothing that much related to what I am asking.</p>
<p>At first, I thought that Omni was a whole new blockchain(they forked it from bitcoin), and then added some more code to implement contracts so that assets could be transferred.</p>
<p>At second, I read that omni does write data to bitcoin blockchain itself.</p>
<p><strong>Question 1)</strong> why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.</p>
<p><strong>Question 2)</strong> let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: <code>P2SH Scripts</code>, but wanted to make sure.</p>
<p><strong>Question 3)</strong> if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related <code>P2SH Scripts</code> from bitcoin itself . right ?</p>

<protocol><omni>
does bitcoin have omni layer?
Nika Kurashvili
# does bitcoin have omni layer?

(Asked by: username_0 on 2021-01-10)

I was looking into omni protocol and couldn't quite figure out some things. I'd really appreciate your opinions. I tried to look into all the bitcoin stachexchange answers, but nothing that much related to what I am asking.

At first, I thought that Omni was a whole new blockchain(they forked it from bitcoin), and then added some more code to implement contracts so that assets could be transferred.

At second, I read that omni does write data to bitcoin blockchain itself.

**Question 1)** why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.

**Question 2)** let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: `P2SH Scripts`, but wanted to make sure.

**Question 3)** if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related `P2SH Scripts` from bitcoin itself . right ?

**Tags:** protocol, omni


---

## 1 answers

### Answer by username_1 on 2021-01-10. Score: 6 | Accepted answer

> Question 1) why is not the omni a new blockchain at all if they forked it from bitcoin ? we can see that on github.

As Murch said, Omni uses Bitcoin as its immutable database. So Omni is like a separate blockchain, since the contents of Omni transactions embedded in the Bitcoin blockchain are not relevant to Bitcoin nodes. If there's an invalid Omni transaction, then BTC nodes would still accept it.

Omni doesn't have a directly-connecting peer-to-peer network. It relies on data pushes on Bitcoin.

> Question 2) let's assume, it's not a new blockchain - then this means that my second thought is correct. How does it write data to bitcoin blockchain ? I can think of one way: P2SH Scripts, but wanted to make sure.

They could use P2SH - I have a website that uses P2SH to embed data in the blockchain, and it works perfectly. However, currently Omni uses bare OP\_RETURN scripts. Most likely, they never thought about using P2SH when they first designed it so they might not afford a breaking change (for Omni, not for BTC) introducing P2SH data pushes. P2SH pushes - are actually currently more [feasible](https://github.com/bitcoin/bitcoin/issues/12033).

> Question 3) if the omni is not a new blockchain at all, then how does its explorer work ? I guess, their explorer fetches all their related P2SH Scripts from bitcoin itself . right ?

Omni has its own software - a fork of Bitcoin Core. They listen to the Bitcoin network and update their blockchain. If they pulled data from P2SH every time, that would be a waste of computing resources.

So every time a new Omni update on Bitcoin occurs, they update *their* blockchain, then use their blockchain as their data source.

> **Comments:**
> **username_0**: Thanks for answering. The thing I don't understand is the following: Okay, omni is a separate blockchain. it has the smart contract feature or something like this, so we can create assets on it and be able to transfer it. So, when I make a transaction, it goes to omni nodes. Now, what does omni node do ? doesn't it put and store the actual in its own ledger and share it to every other node ? why does it need the bitcoin blockchain at all ?  
> **username_1**: @username_0 Your transaction doesn't go to omni nodes. Your transactions is processed by the Bitcoin network. Once it is included in a block, the omni nodes which receive the new block write the new transaction, if it's valid, to their database. This saves Omni from needing to have its own network miners.  
> **username_0**: let's say i am a normal user and going to transfer 3 asset from my address to someone else.  I make a transaction, it goes to the omni blockchain, which does some stuff on it so that bitcoin nodes would accept it.after bitcoin nodes have this transaction, they include it in a block. I guess,omni listens to the new block so that it can also add this new block to its own database. Am I all correct? It turns out then that omni blockchain seems to have one single database. and the only purpose of it is to modify transactions into OP_RETURN code or something so that it would get accepted by bitcoin  
> **username_1**: @username_0 No no, your wallet creates your Omni transaction and adds it to a your new Bitcoin transaction's OP_RETURN (those two transactions are constructed at the same time since the Bitcoin transaction too needs to follow the Omni specification). The Bitcoin nodes receive and Bitcoin miners accept your transaction. Every time a new block is accepted, Omni nodes, who connect to Bitcoin nodes, also receive the block and scan it for Omni transaction. Valid ones are added to their Omni blockchain.  
> **username_0**: aha, so basically omni nodes do exist and they store the copy of the ledger too.  It's just omni uses bitcoin blockchain so that transaction confirmations, verification of signatures, longest blockchain rule and many more happen on the bitcoin. Omni seems to be just a redirection mechanism and is just a very simplified than the bitcoin. correct ?  
> **username_1**: @username_0 Yes, exactly! It's Bitcoin's job to determine the accepted, immutable order of transactions. The rest is handled by Omni, which doesn't have a separate network but they just listen for new Bitcoin blocks. (So yes, 100% of what you said)  
> **username_0**: Any idea why they implemented/created OMNI at all ? it seems like it's good to create assets. Ethereum is just there. why use omni at all ?  
> **username_1**: Because Ethereum didn't exist when Omni was created.  
> **username_0**: I have two questions if you don't mind. 1) So, wallet creates bitcoin transaction with OP_RETURN, and passes its own omni data. I think, in order for a user to use OMNI, he first has to be the user of the bitcoin and has some unspent transactions, because when omni wallet creates a btc transaction and sends it, it first needs to be signed by the private key that owns some money on bitcoin network since transactions are costly. agree ?  
> **username_0**: 2) https://gist.github.com/caffeinum/f64a51ce55d5ac9075bb2f5f2f439c0d there is a line -   `tx.addOutput(recipient_address, fundValue)`.  since we are talking about tokens, why do we actually send btc to the recipient too ?  
> **username_1**: @username_0 1 is correct, that's why Omni Core [shows](https://camo.githubusercontent.com/2244be2f89bf3fb70580a94913276a0d6f0658be0c79bc5b970e2dad9d0904db/687474703a2f2f692e696d6775722e636f6d2f5a3079713675462e706e67) the Bitcoin balance as well. 2 because that's what the specification [requires](https://github.com/OmniLayer/spec/blob/master/OmniSpecification.adoc#711-transfer-coins-simple-send). (And the destination address is called the *reference*). 546 satoshis is used since it's the smallest amount while Bitcoin considers it to be a *standard* transaction and  
> **username_1**: the real transferred token value is in OP_RETURN. Sending very little BTC to the reference allows saving bytes by not also having to add the reference to OP_RETURN.  

---

