5

I'm looking for a good example and explanation from a software architecture perspective BUT for general audience about the benefits of solving and having blockchain features on Layer 1 not disregarding any Layer 2 solution or blockchain but in fact comparing.

In example any scaling solution for off-chain transaction will definitely face speed issues in comparison to one that was solved on the original design of the blockchain.

It's not a fair comparison because both have their reasons, their strengths and their fame but if you take lightning or æternity state channels you will have some design flaws that should be talked about to help people to understand and decide based on more than just marketing.

Again this isn't in any way a critic towards any of the solution but an example to talk about design and architecture and not about which had better marketing.

5
  • I think it's in essence a great question that deserves a decent answer to link to it. I'm thinking of a wanna-be decent answer and i find some terms of your question confusing. First, i think you mean "technological perspective" rather than "software architecture perspective"? Then you state "any scaling solution for off-chain transaction will definitely face speed issues in comparison to one that was solved on the original design of the blockchain". I can't help but say it's plainly objectively wrong. Could you shed some light on this one so i can take a shot at writing an answer ? :)
    – darosior
    Mar 24 at 9:45
  • 1
    Thanks for reading my question @darosior . For the first statement I think it's right as I'm speaking about the architecture of the software piece/s rather than technological perspective as a broader concept. For the second statement that's exactly what I'm trying to get an answer, if you planned such features while you were designing your software and you did it well it should run better and faster that if you put something on top tomorrow to get those features. Mar 24 at 10:36
  • 1
    Oh, then you were talking about pace in software development ? I misinterpreted it for "The speed of /Bitcoin usage/". Then i think i can write an appropriate answer, thanks!
    – darosior
    Mar 24 at 10:39
  • 1
    I'm putting concrete examples of developed technologies that show exactly my concern and question. This is not a theoric question but a practical one on based on architecture practices and software engineering. Mar 31 at 10:49
  • 1
    Sorry completely forgot about it, will write a response soon with practical examples.
    – darosior
    Mar 31 at 11:23
3

From the point of view of an application developer, it is for now much easier to use layer 1 features.
This is due to being able to externalize your burden on the network.

1. Hey nodes, will you do my job?

Blocks are expensive to produce

You don't need to have much DOS concerns in your application if you are only reacting to onchain payments. But what happens if you do an expensive operation each time your Lightning node accepts an HTLC ?..

Backups are simple

You don't have to think much about backing up the state of your application for your user: your data is public and stored by everyone. Your user only has to back up a very small amount of data.

On Lightning, you are responsible for your own data. That's sometimes surprising to users who have been accustomed to (ab)using the block chain for years :).
In addition, on Lightning in its current form you are in a pretty bad position should you miss a single state backup. But this may be fixed in the future.

The security model is simple(r)

Even if there are some pitfalls and idiosyncrasies in Bitcoin, it's way harder to reason about assumptions you can reasonably make for your software and what you can convey to your user is a reasonable usage of your software.

For instance, "may i allow my user to re-import their HD wallet master account in another wallet?"

  • Bitcoin onchain: sure, what could go wrong?
  • Bitcoin offchain: meh. It's not that simple.

The same goes with "may i dig a hole, put my wallet in there, come back in a year, and still be in full possession of my coins ?"

  • Bitcoin onchain: sure, what could go wrong?
  • Bitcoin offchain: meh. It's not that simple.

Bootstrapping is simpler

Even if we usually make the analogy to "send coins to", Bitcoin onchain did not require interactivity. Just send the transaction to every single node on the network, make them verify it for you and call it a (lazy) day.

Now with Lightning for someone to start paying they need to find a way to connect to the payee, actually making the above analogy closer from the truth as they are actually transferring data.
For someone to start receiving payments, they also need to "be able" to be paid (have enough inbound liquidity).

Payments get increasingly more secure

Under Lightning's assumptions, a payment will be almost instantly "secure" :tm:
In practice, arguably even more so than a handful of onchain confirmations. However, maybe not more than a hundred. Or not than a thousand, or ten thousands confirmations.

For some applications (such as making very large payments), you may want to use this feature unique to the block chain: don't consider a payment to be made until a reorganization of the block chain that deep would put the entire currency down anyway.

2. Hey nodes, can you be more qualified at my job?

Of course, there are also drawbacks to (ab)using the chain.

Decent payment security is slow to bootstrap

Getting the first confirmation may be infinitely longer than on a layer 2 system. If you ask "if my payment can go through successfully, when is it going to be finalized?":

  • Bitcoin Lightning: immediately. (this assumes unstuck payments)
  • Bitcoin onchain: well, lemme explain you the block space market.

UTXO management

This logic is one you can't outsource to the nodes :). It's pretty difficult optimization problem that highly depend on the usage that is going to be made of your software. It takes a deep understanding of the tradeoffs and knowledge of the existing solutions to the developer to make a sensible decision.

On Lightning, you don't have to manage coins. The value is similar to a flux rather than to actual physical, indivisible coins.

Fees orthogonal to payments and fee management

Onchain fees depend on the actual transaction (in the database sense of the term) size, not on the actual payment. They are in addition very unreliable, in theory you really can't know for sure that your transaction is going to make it into a block in advance. You are really hoping for the best.
The counter measures for adapting to this always-moving block space market incur an additional cost in knowledge and understanding (and complexity of implementation) to the application developer, similarly to coin selection (which is tightly related).

"how much is my finalized payment going to cost me?":

  • Bitcoin Lightning: a proportional fee of x sats per million of sats transferred and a fixed fee of y.
  • Bitcoin onchain: well, lemme explain you the block space market.

Higher usage cost

As the demand for the finite resource of block space increases, so are average fees premium to be included as soon as possible in the chain. This makes some design of application not possible onchain anymore, re-aligning the incentives of (ab)using the network to incur less burden to the software / user of the software.

Lack of features

Onchain nodes are pretty restricted in what they can verify for you. Some more complex systems can be emulated on a L2 network with different trust assumptions than the base trustless network (eg with sidechains).
The advantage of not doing it onchain here is that it's opt-in: you don't have to make the entire network and economy accept to augment their functionalities in order to bear even more burden than previously.

Some features may be either backward incompatible or present tradeoffs that not everyone would accept. Their addition to the base layer would raise big questions about the censorship resistance of the system and finally the point of using it in the first place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.