Saturday, January 29, 2022

Web 3 - blockchain layers

Layers from a blockchain perspective.


My plan is to write 5 articles: 

1 Intro: Web 1.. 2.. 3..

2 Layers in crypto.  [this one]

3 Applications - not only DeFi!

4 Decentralisation

5 Summary - where we are, where to look, why should we join





Layer 1

Layer 1 refers to the underlying blockchain architecture, i.e., the actual blockchain itself. In the case of Bitcoin, it is the BTC network launched in 2009.


Layer 2

Layer 2 refers to various protocols that are built on top of layer 1 to improve the original blockchain’s functionality. Layer 2 protocols often use off-chain processing elements to solve the speed and cost inefficiencies of the layer 1 network. Examples of layer 2 platforms for Bitcoin include Lightning Network and Liquid Network.


Layer 3

Layer 3 is represented by blockchain-based applications, such as decentralized finance (DeFi) apps, games, or distributed storage apps. Many of these applications also have cross-chain functionality, helping users access various blockchain platforms via a single app.





A layer-1 blockchain is a set of solutions that improve the base protocol itself to make the overall system a lot more scalable. There are two most common layer-1 solutions, and these are the consensus protocol changes as well as sharding.


When it comes to consensus protocol changes, projects like Ethereum are moving from older, clunky consensus protocols such as proof-of-work (PoW) to much faster and less energy-wasteful protocols such as proof-of-stake (PoS). 


Sharding is one of the most popular layer-1 scalability methods out there as well. Instead of making a network sequentially work on each transaction, sharding breaks these transaction sets into small data sets which are known as "shards," and these can then be processed by the network in parallel. 


One of the pros when it comes to layer-1 solutions is that there is no need to add anything on top of the existing infrastructure.





Layer 2 is a term used for solutions created to help scale an application by processing transactions off of the Ethereum Mainnet (layer 1) while still maintaining the same security measures and decentralization as the mainnet. Layer 2 solutions increase throughput (transaction speed) and reduce gas fees. Popular examples of Ethereum layer 2 solutions include Lightning Network, Liquid Network, Polygon, and Polkadot.


Layer 2 solutions are important because they allow for scalability and increased throughput while still holding the integrity of the Ethereum blockchain, allowing for complete decentralization, transparency, and security while also reducing the carbon footprint (less gas, means less energy used, which equates to less carbon.)


Although the Ethereum blockchain is the most widely used blockchain and arguably the most secure, that doesn’t mean it doesn’t come with some shortcomings. The Ethereum Mainnet is known to have slow transaction times (13 transactions per second) and expensive gas fees. Layer 2s are built on top of the Ethereum blockchain, keeping transactions secure, speedy, and scalable.


Each individual solution has its own pros and cons to consider such as throughput, gas fees, security, scalability, and of course functionality. No single layer 2 solution currently fulfills all these needs. However, there are layer 2 scaling solutions which aim to improve all these aspects; these solutions are called rollups.



There are three properties of a layer 2 rollup: 


1. Transactions are executed outside of layer 1 (reduces gas fees)

1. Data and proof of transactions reside on layer 1 (maintains security)

1. A rollup smart contract which is found on layer 1, can enforce proper transaction execution on layer 2, by using the transaction data that is stored on layer 1








Layer 3 is often referred to as the application layer. It is a layer that hosts DApps and the protocols that enable the apps. While some blockchains such as Ethereum or Solana (SOL) have a thriving variety of layer 3 apps, Bitcoin is not optimized to host such applications.


As such, layer 2 solutions are the furthest deviations from the core network that Bitcoin currently has. Some projects are trying to bring DApp functionality to the BTC ecosystem via forks of the original BTC network.


For instance, CakeDeFi is a DeFi app offering services such as staking, lending, and liquidity mining to BTC coin holders. CakeDeFi is based on a fork of Bitcoin called DeFiChain. DeFiChain maintains “an anchor” to the core BTC chain for some of its operations, but technically speaking, it is still a separate blockchain of its own.


Some industry observers believe that the lack of DApp functionality is one of the biggest limitations of BTC. Ever since Ethereum’s arrival in 2015, layer 3 platforms have been growing strongly in popularity and value. Ethereum currently has close to 3,000 layer 3 apps. The DeFi apps based on the blockchain hold a total value of $185 billion by now.


Another leading blockchain, Solana, hosts over 500 layer 3 DApps, and the total value locked in the DeFi apps of the network is approaching $15 billion.


In comparison, BTC has no functioning app that could be clearly defined as a layer 3 application. There is an ongoing debate about whether projects designed to “force in” DApp functionality onto BTC are worth the effort. Some in the industry argue that BTC will always remain a network designed for crypto fund transfers, not DApps.


These people point out that the layer 1 BTC chain enjoys an industry-leading market cap (of $1.3 trillion by now) that dwarfs all the TVL and market cap figures of all layer 3 projects in existence combined. As such, Bitcoin may not be in any urgent need of layer 3 functionality, at least judging from the financial figures.







Summary



Blockchain platforms may have three distinct layers. Layer 1 refers to the actual underlying blockchain, with its core architecture and functionality. Examples of layer 1 networks are the Bitcoin, Ethereum, and Solana blockchains.


Layer 2 are protocols built on top of layer 1 networks and extend some functionality of the underlying blockchain. For example, they may offer faster speeds and lower transaction costs than layer 1.


Layer 2 protocols often use a combination of on-chain and off-chain operations to offer their extended functional capabilities. Examples of layer 2 projects on Bitcoin include the Lightning Network and Liquid Network platforms.


Layer 3 refers to the protocols that enable DApps on the blockchain. While some other blockchains have a large collection of layer 3 apps, the BTC blockchain has none of them. Some projects attempt to bring layer 3 functionality into the BTC ecosystem by using apps designed on forks of BTC.


However, these apps are still based on their own blockchains, not on the core BTC blockchain. There is a debate about whether BTC even needs to move towards enabling the layer 3 functionality. Some industry analysts argue that BTC is worth multiple times more than all these layer 3 apps combined, and therefore, it does not have a pressing need for layer 3 at all.


Web3 - next big bang!

 Short article about Web3 - what it is and why I personally think that for the next 3 years it will be must know / must use / must to be in !!

 

 

My plan is to write 5 articles:

 

1. Intro: Web 1.. 2.. 3..   [this one]

2. Layers in crypto.

3. Applications - not only DeFi!

4. Decentralisation

5. Summary - where we are, where to look, why should we join

 

 

 




 

 

 

Web3 is an idea for a new iteration of the World Wide Web-based on the blockchain, which incorporates concepts including decentralization and token-based economics. Some technologists and journalists have contrasted it with Web 2.0, wherein they say data and content are centralized in a small group of companies sometimes referred to as "Big Tech".

 






 

Web 1.0 and Web 2.0 refer to eras in the history of the World Wide Web as it evolved through various technologies and formats. Web 1.0 refers roughly to the period from 1991 to 2004, where most websites were static web pages, and the vast majority of users were consumers, not producers, of content.

Web 2.0 is based around the idea of "the web as platform" and centers on user-created content uploaded to social media and networking services, blogs, and wikis, among other services. Web 2.0 is generally considered to have begun around 2004 and continues to the current day.

 

 

 

Visions for Web3 differ, but they revolve around the idea of decentralization and often incorporate blockchain technologies, such as various cryptocurrencies and non-fungible tokens (NFTs). Bloomberg has described Web3 as an idea that "would build financial assets, in the form of tokens, into the inner workings of almost anything you do online". Some visions are based on the concept of decentralized autonomous organizations (DAOs). Decentralized finance (DeFi) is another key concept; in it, users exchange currency without bank or government involvement. Self-sovereign identity allows users to identify themselves without relying on an authentication system such as OAuth, in which a trusted party has to be reached in order to assess identity. Technology scholars have argued that Web3 would likely run in tandem with Web 2.0 sites likely adopting Web3 technologies in order to keep their services relevant.

 

 





 

To believers, Web3 represents the next phase of the internet and, perhaps, of organizing society. Web 1.0, the story goes, was the era of decentralized, open protocols, in which most online activities involved navigating to individual static webpages. Web 2.0, which we’re living through now, is the era of centralization, in which a huge share of communication and commerce takes place on closed platforms owned by a handful of super-powerful corporations—think Google, Facebook, Amazon—subject to the nominal control of centralized government regulators. Web3 is supposed to break the world free of that monopolistic control.

 

At the most basic level, Web3 refers to a decentralized online ecosystem based on the blockchain. Platforms and apps built on Web3 won’t be owned by a central gatekeeper, but rather by users, who will earn their ownership stake by helping to develop and maintain those services.

 

Gavin Wood coined the term Web3 (originally Web 3.0) in 2014. At the time, he was fresh off of helping develop Ethereum, the cryptocurrency that is second only to Bitcoin in prominence and market size. Today he runs the Web3 Foundation, which supports decentralized technology projects, as well as Parity Technologies, a company focused on building blockchain infrastructure for Web3. Wood, who is based in Switzerland, spoke with me last week over a video about where Web 2.0 went wrong, his vision of the future, and why we all need to be less trusting. The following interview is a transcript of our conversation, lightly edited for clarity and length.

 

 




 

 


 

 

As technology continues to take center stage as a key differentiator for companies, new tech trends for 2022 are beginning to emerge. These trends are largely reflective of the changing realities around us. Successive global lockdowns have opened up a world of possibilities around virtual experiences and digital interactions. The increased urgency around resource scarcity, both human and natural, has also led to the introduction of technology geared towards efficiency and sustainability. These growing trends are part of a larger directional shift of the world wide web to Web 3.0.

 

 

To understand the concept of Web 3.0, we need to take a step back and understand the larger evolution of the internet that brought us to this point.

 

Web 1.0, the original conception of the internet, was a largely static, one-to-many format where users could view web pages but do little beyond that.

 

Web 2.0 introduced the concept of a worldwide community of internet users, encouraging them to form social media groups, interact with each other and create virtual experiences. Web 2.0, the current form of the internet, is still by large the most influential, but Web 3.0 is now slowly coming into its own.

 

Web 3.0 takes the notion of the ‘community and expands it to include community ownership and regulation of the internet as a whole. Three key philosophies are involved in web 3.0 definition:

 

The internet is ‘open’ and is built with open-source software that anyone can create, utilize and modify.

Interactions between users are not governed by a trusted third-party regulatory body.

Anyone can participate, without requiring permission from governments or regulatory bodies.

We can already see many manifestations of web 3.0 all around us. Cloud technology and artificial intelligence are some of the most prevalent forms of web 3.0 today.

 

In 2022, we will become increasingly familiar with the concept of a “metaverse” – persistent digital worlds that exist in parallel with the physical world we live in – Forbes

 

 



 

 


 

Here are **a few of the top technological trends of 2022** that web 3.0 has given rise to.

 

 

 

 

 

1.  Advanced applications of Artificial Intelligence

Artificial Intelligence has arguably been one of the biggest technological innovations of our time. As AI begins to get more sophisticated and closely mimic human intelligence, a new form will gain popularity in 2022: generative AI. Unlike traditional AI models that simply understand repetitive patterns and recreate them, generative AI is capable of producing completely new material. It uses the underlying principle of AI, learning patterns, to identify how input is linked together and uses it to create new content from code, images, text or video inputs. 

One of the biggest applications of generative AI is in customer service. Chatbots of 2022 could be so human-like that it would be practically impossible to differentiate between an AI chatbot and a human rep. AI could also change the way we consume content. Social media algorithms could get a lot smarter with AI and offer more accurate content recommendations. This could deliver even more personalized experiences for customers.

 

2. Low-code application building software

Creating a strong digital presence has become increasingly important for businesses, especially in the wake of the lockdowns. Mobile applications are one of the most important virtual assets a business can have because it’s the closest way to mimic an in-store experience. Historically, however, applications have been expensive to develop. Businesses needed to either have an in-house software development team or enough financial budgets to outsource the project to a vendor. These have acted as strong barriers to entry and have meant that small businesses could not afford to launch a mobile app. But with web 3.0, a number of low-code or no-code app development platforms have begun to sprout. These platforms make it extremely easy to develop an app with little to no coding knowledge required. Usually, they come with preset templates and features and users have to simply drag and drop them to build their app. These services will undoubtedly democratize the development of mobile applications and help businesses engage with their customers online.

 

3. Dominance of cloud technology trends

The cloud was one of the biggest game-changing technologies of 2021 as it enabled businesses to work remotely, from any part of the world. But even as offices begin to re-open, it’s unlikely that we’re ever going to see a shift to old on-premise models again. Global scenarios are unpredictable and businesses need to remain agile. As companies plan for this volatile future, they are more likely to move away from hastily implemented cloud setups to cloud-native platforms. 

The ‘lift and shift’ approach involved using the same organizational processes and simply moving them to the cloud. This approach might have worked as a time-sensitive solution, but they don’t deliver the full benefits of the cloud in the long term. A major focus for CIOs in the coming year will be implementing more sustainable cloud structures that are scalable and flexible. 

One study by Gartner estimates that as much as 95% of new digital initiatives in 2022 will be built upon cloud-native platforms. This underscores the importance of cloud technology in the coming year.

 

4. Secure data fabric

In line with creating flexible and accessible platforms, data fabric is a type of data architecture that ties together different platforms and users. It’s the antidote to data silos of the past that would often result in a loss of critical insights and make access extremely restricted. A data fabric promises greater efficiency and security because data is stored on a secure cloud platform. This minimizes the cost of storing data and ensures the highest level of encryption. 

Think of a data fabric like a self-driving car. When the driver is active then the autonomous mode takes a back seat. If the driver gets lazy and is not too alert then the semi-autonomous mode kicks in and makes course corrections, This is similar to how a data fabric works. It will monitor all data pipelines as a passive observer and once it understands, it will start to suggest more productive alternatives. For instance, a supply chain organization that uses data fabric can keep adding newly encountered data information that can improve decisions based on the newly integrated data. 

To implement data fabric design, new technologies like semantic knowledge graphs, embedded machine learning etc. will be needed.

 

5. Growth of 5G technology

5G technology will ultimately be the backbone that drives all of the above technology trends. 5G networks have a much wider reach than 4G, offer faster internet speeds and even enable heavy code to download seamlessly. 2022 will most likely see 5G enter the mainstream market and become the most widespread form of mobile broadband connectivity. This presents a huge opportunity for businesses. As the new year quickly approaches, CIOs should brainstorm new ways to present their business digitally and new channels that they can open up, powered by 5G technology.

 

 

 

Technology is constantly evolving and these 5 tech trends are just a few of the many we expect to see develop over the next year. As the very form of the internet evolves with the introduction of web 3.0, there’s only one thing that’s for certain: businesses need to respond positively to change and leverage the latest technological advances if they want to maintain their competitive edge.

 




 

Web 2 was boom - lots of new companies emerged, Web 3 will go into the same direction with a possibility to be a much bigger change to our way of living!

Wednesday, October 7, 2020

AI/ML issue

When talking about AI, there is often seen the concept of "one-shot-learning". This is quite a basic understanding difference between small baby learning and machine learning ;-).

In machine learning to create a good quality model, one must provide a large number of sample (train) data.

However, in real life, a small baby quite quickly learns how a cat and how a dog looks like.

But the most visible example is learning that something is hot:

- on just one sample when the kid will burn his hand, he will learn what hot is and will never touch anything hot again - at least not on purpose

- if we give this to existing machine learning solutions - it will need thousand of samples, preferably of hot and cold, to learn and give prediction "don't touch is hot" ;-)


The answer to this dilemma is "one-shot-learning", where we try to build models that could learn from a single sample.





However, my issue is completely different: my baby was observing me, and the household. She noticed that we put lots of stuff into the trash can. She is interested. And since she is learning by repetition/duplication of what she can see ... currently she puts everything she finds into the bin.

By not breaking her confidence, so she will continue development at high speed;-) How to teach her that whatever she is doing is wrong? Basically: stop. 

The obvious note is: on multiple occasions during the day she constantly sees new examples (train data) that this is standard/expected behaviour.



Monday, September 23, 2019

Good design instead of big architecture

Architecture: instead of multiple fancy libraries, and overcomplicated pipelines/flows/services/microservices - just write good code.

Just want to share my support to the idea put onto the article from Uber guys :
"Software Architecture is Overrated, Clear and Simple Design is Underrated"

There are few points why I like it, especially since for some time I worked in an environment where managers were always thinking that using fancy jargon, and adding as much as possible different libraries make the solution "better" / "cooler".

Yes, I admit, I'd like to use nice new fancy libraries, but my excuse is I want to be in business and want to learn new stuff, from project/management perspective there is however one issue: at the end of the day - who will maintain that and why?

The second output of this article - if you build good software, then the architect position is .. obsolete. I know it's hypocrisy, on linkedin I use that title - and again my excuse is careerwise perspectives - "architect" is understandable by everyone in the programming world and by the head hunters.



Design patterns - no more

Design patterns - choose good programming language without internal "philosophical" gaps, then you don't need to learn patterns!

Yes, I admit I have aversion to patterns, for a simple reason - if programming language that you choose is good ... you don't need patterns, you don't need workarounds to cover language issues.

In my opinion patterns are just workarounds/cover-ups for language gaps/inconsistency.
It looks like: you build the house on the tree and you forgot to put a ladder, so you cannot reach the doors. Then comes patterns: use ropes, build concrete staircases, etc...
If you spend time on planing tree-house in the first place - no need for workarounds.

Just to be clear yes I'm talking about java - if you want to write a good program you need to know the whole catalog of patterns (starting with GOF). If you compare it to python, scala (tobe checked: kotlin, swift) - no more patterns. There are some suggested good behaviors like use functional instead of OO, but that is your choice/ your style.

I think this is an advantage of new languages - if you want to promote a new language you need to have it clean and easy to learn and use.




Tuesday, May 29, 2018

Ubuntu graphics resolution 640x480 fix

I stuck with 640x480 for some time ... so here is 3 easy steps to fix it:

Note: Tested on ubuntu 16.04 / 17.10 / 18.04 (bionic)



1) go to native terminal

ctrl+alt+F1


2) disable windows manager (step 1)

sudo lightdm stop


3) create new xorg config file (step 2)

sudo Xorg -configure


4) backup old xorg file ... (optional step for peace of mind)

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.bak


5) copy new configuration (step 3)

sudo mv /root/xorg.conf.new /etc/X11/xorg.conf


6) start lightdm (didn't work for me)

sudo lightdm start


7) reboot - this actually works!

reboot


and that's it ;-)

Saturday, October 14, 2017

Upgrade all pip packages

How to upgrade all installed Python packages at the same time?

pip freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U




Or pip3:

 
pip3 freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip3 install -U

Tuesday, July 4, 2017

Solution: Ubuntu/Linux vs JDK => Maximum number of clients reached / unable to open display

For work I'm using Ubuntu, and as developer, I constantly use some JDK tools/IDEs, usually it is IntelliJ IDEA, sometimes eclipse, some other specific, like nVidia studios..
I'm typical linux user - so "try it switch off and on" is not the standard way to deal with problems.
From some time when I tried to start some graphical tool I got this error:
Maximum number of clients reached unable to open display ":0"

I hate it and spend lots of time for investigation, went throug all standard:

xlsclients/xwininfo/xhost - which didn't work as they all need access to X (they are clients)  - so typical catch 22

I spend some time on different ubuntu settings for X-org/ file limits etc - everything set properly, all almost unlimited...
then finally by just some good luck I shut down my IntelliJ and ... checked that thousand of resources suddenly disappeared from usage list..


Final solution: you need suckless-tools ;-)

apt install suckless-tools

Tuesday, November 15, 2016

BREW - clean update / upgrade

Another one for future reference: brew
when I did brew update I've used to get:

>brew update
error: Your local changes to the following files would be overwritten by merge:

share/doc/homebrew/Acceptable-Formulae.md
share/doc/homebrew/Bottles.md
share/doc/homebrew/Brew-Test-Bot-For-Core-Contributors.md
share/doc/homebrew/Brew-Test-Bot.md
share/doc/homebrew/C++-Standard-Libraries.md
share/doc/homebrew/Common-Issues-for-Core-Contributors.md
share/doc/homebrew/Common-Issues.md
share/doc/homebrew/Custom-GCC-and-cross-compilers.md
share/doc/homebrew/External-Commands.md
share/doc/homebrew/FAQ.md
[......]

fix for that is:

cd `brew --prefix`
git fetch origin 
git reset --hard origin/master

if reset didn't work sometimes you need to do sudo, just make sure you change owner back to your user...

sudo chown -R user .

then :

brew update
brew upgrade


and all is nice and working cool ...  again ;-)

Monday, November 14, 2016

R - upgrade all packages

  • How to upgrade R?

There is this package, which you can use .... but you must have it installed before new version of R come ;-) - otherwise it is typical "catch 22":
Upgrade from 3.3.1  to 3.3.2 :
install.packages('installr', repos = 'http://cran.us.r-project.org') 
Warning message: 
package ‘installr’ is not available (for R version 3.3.1)


So basically - instead this go to https://cran.r-project.org/ and update using new R.


  • How to upgrade all your existing R packages (libraries)?

Use this command to upgrade all existing packages:

install.packages(
  .libPaths()[1],
  pkgs = as.data.frame(installed.packages(.libPaths()[1]), stringsAsFactors=FALSE)$Package,
  type = 'source'
)
And quick update - to the article ;-) - use this instead:

update.packages()
update.packages(ask = FALSE, dependencies = c('Suggests'))

Have a fun! 

Wednesday, April 6, 2016

Mac OS X - switch off discrete GPU in apps

Hi - just quick one.
I have this program (WriteApp) which is quite cool, but every time I'm using it, it is automatically switching my mac into discrete graphics card mode. This app is not really into anything fancy/ high graphics dependent.
But when I launch Activity Monitor it is displayed as: "Requires High Perf GPU" - which means that my app spur the system to keep the advanced graphics processor active, and thereby drain battery life.


After some research ... I didn't find any solution apart using gfxCardStatus to permanently switch into "Integrated only" mode.

So ... there is a hack:
Open your app contents and inside them should be Info.plist file. Open it and add those 4 lines:

       <key>NSHighResolutionCapable</key>
       <true/>
<key>NSSupportsAutomaticGraphicsSwitching</key>
       <true/>

restart your app... and now - no more forcing into discrete mode.

Web 3 - blockchain layers

Layers from a blockchain perspective. My plan is to write 5 articles:  1 Intro: Web 1.. 2.. 3.. 2 Layers in crypto.  [this one] 3 Applicatio...