Omni is not a second layer but Omni works pretty much the same way :P. The blockchain just used to store the code. Omni can switch blockchain technically(never done yet though they did plan to transfer to litcoin). Bitcoin nodes do nothing nor do miner on those "omni" tx.
As such Omni/Counterparty(another omni type) had made a way possible to do smartcontracts(they used their token as gas not bitcon) without needing the blockchain. They later stopped as one bitcoin tx got super high and the plan was to go second layer and that it wasn't really "bitcoin" smart contracts as they couldn't work with bitcoin in them just used the data to store. Much like hive engine in order to get "hive" to trade in the dex you need a "proxy" token.
Omni is not considered second layer but a layer 1.5. As they are onchain and use onchain txs but don't affect how the main chain works.
Omni/Counterparty uses "opt code" kinda the same was as "json format"; heck bitcoin nodes could just prune the data. They are kept in "consensus" by the special opt code that is share in every tx. Basically as long as you use the same "reading" software, you have the same network. So no one needs to make a tx they just make a bitcoin tx, though you do trust more for those txs as you need to have the right "reading software" for you to be on the same network but otherwise it pretty trustless.
Words
251
Reading
2 min
Listen
Play
6y
RE: A Look At Hive Smart Contract Possibilities And SMTs