L2 Summer is coming? Master the principle and ecology of StarkNet technology in one article
first level title
Original editor: Biteye core contributor Crush
1. Prelude to Layer 2 Summer
image description

image description

(Data source: https://dune.com/Henrystats/arbitrum-metrics)
The former four kings of layer 2: Optimism, Arbitrum, zkSync, and StarkNet, only the latter two have not announced the airdrop. Optimism and Arbitrum have successively practiced the method of ecological accumulation + airdrop to grab users, and the results have been reflected in the market share of Layer 2 ecology. As the Layer 2 ecosystem becomes more mature, and EIP-4844 will significantly reduce Rollup fees, preempting users will become the core factor for Layer 2's success. Under the current market structure, there is not much time left for zkSync and StarkNet to seize the market. The competition among projects and the wealth effect brought by users' fomo have made Layer 2 Summer ready to emerge.
(Note: EIP-4844 is an improvement proposal to the Ethereum network, which is expected to reduce the overhead of Rollup by 10-100 times. It will introduce a new transaction type to Ethereum that can carry short-lived Data called blob. The availability of data stored in the form of Calldata before can be stored in blob instead, and the storage cost of blob is much cheaper than calldata. In terms of user experience, the most intuitive perception of users is that the cost of L2 is greatly reduced, which means It will provide an important foundation for the outbreak of the L2 ecology.)
As the project with the highest valuation among the four Layer 2 kings (the parent company StarWare is valued at 8 billion US dollars), the gold content of the StarkNet ecological project needless to say, can be seen from the recent transaction activity.
image description

first level title
secondary title
2.1 Project Overview
StarkWare, StarkNet's parent company, was established in 2018 and is headquartered in Israel. Its two main products are StarkEx, an expansion engine based on the Ethereum mainnet, and StarkNet, a general-purpose ZK-Rollup. The StarWare technical team has more than ten years of research and engineering experience in the ZKP field. In 2018, it took the lead in proposing the use of SATRK validity proof to solve the scalability problem of Ethereum and realize the unlocking of large-scale scalability.
StarkEx: A layer-2 scalability engine designed for applications. StarkEx provides dedicated Rollup technical services for each application. It has been officially launched on the Ethereum mainnet since 2020 and is relatively mature. At present, the projects developed based on StarkEX include Sorare, immutableX, dYdX, ApeX and other famous projects.
StarkNet: A general-purpose Rollup that can deploy any smart contract without custom development for specific applications. StarkNet will launch the Ethereum mainnet in November 2021. Currently, 50+ projects are launched on the mainnet, and 100+ projects are launched on the testnet.
secondary title
2.2 Technical Architecture and Others
Similar to the zk-rollup scheme based on validity proof, StarkNet and StarkEx also adopt the form of "off-chain calculation-generation of zk proof-on-chain verification" to realize the expansion of Ethereum.
However, it achieves high transaction processing speed and low cost through the original zk-STARK zero-knowledge proof algorithm, zk-friendly programming language Cairo, SHARP shared validator, and diverse data availability.
2.2.1 Validity proof based on STARK
zk-STARK was proposed by Eli Ben Sasson, the founder of StarkWare, in a paper in 2018. It is an acronym for Zero-Knowledge Scalable Transparent Argument of Knowledge, and has excellent features such as scalability and transparency.
Transparency: ZK-STARK can work without a trusted setting of a common reference string (CRS: Common Reference String). Instead, interactions between provers and verifiers are established using publicly verifiable randomness, which reduces user trust assumptions and improves the security of STARK-based protocols.
image description

(Image source: https://medium.com/coinmonks/zk-starks-create-verifiable-trust-even-against-quantum-computers-dd 9 c 6 a 2b b 1 3d)
The advantages of STARK also come with a series of trade-offs:
The proof size of STARK is larger than that of SNARK, so when the Layer 2 transaction volume is low and it is difficult to share the proof cost, there will be a large confirmation delay. At present, the final confirmation time of StarkNet transactions is about 8 hours. The reason is that the current transaction volume of StarkNet It is relatively low, and it is necessary to collect enough transactions to share the cost of a validity proof; at the same time, zk-STARK needs to cooperate with Cairo to generate validity proofs for transactions, which has a certain learning threshold for developers.
2.2.2 Cairo programming language
Cairo is a Turing-complete programming language released by the StarkWare team in 2020, allowing developers who do not know STARK to use Cairo to use STARK to achieve verifiable computing. In most existing proof systems, for each business logic, that is, for each calculation, a set of polynomial constraints representing a specific calculation needs to be generated. The difficulty lies in how to unify the execution results of diverse smart contracts into verifiable polynomials equation.
Through the program written by Cairo, the calculation result can be directly converted into a provable polynomial equation through the STARK prover, so that the smart contract and zero-knowledge proof can achieve good compatibility. Cairo is a programming language born for STARK. The combination of the two can maximize the potential of STARK, but its separation from the EVM ecology has always been a problem that needs to be resolved. EVM compatibility is a high ground for various zk expansion solutions, and the StarkWare team is also working hard for it.
At the end of October 2022, StarkNet claimed to use Cairo to develop ZK-EVM. At the same time, the Ethereum client Nethermind is working on developing a Solidity-to-Cairo compiler Warp to achieve StarkWare's compatibility with EVM. The team claims that currently Wrap already supports the rewriting of Uniswap V3 into Cairo code. As StarkNet is actually put into the production environment, the actual effect of the compatibility of different solutions will be tested.
2.2.3 SHARP Shared Certifier
SHARP is the Shared Prover (SHARed Prover), which is the Prover used by StarkEx and StarNet to generate zero-knowledge proofs. SHARP can generate validity proofs for StarkEx and StarNet at the same time, so different StarkEx applications and transactions on StarkNet can be aggregated and proved in a single STARK proof, so as to fill up the capacity of STARK proof faster and improve Transaction processing speed and lower latency.
Recursive proofs are a next-generation cutting-edge technology, not just for some hard-coded logic, but for general-purpose computing. The combination of SHARP and STARK can make transactions in the entire StarkWare ecosystem well realize the recursive nature, bringing ultimate scalability.
2.2.4 Diverse data availability
The general logic of the validity proof is "off-chain calculation-generation of zk proof-on-chain verification", that is, the user sends a transaction on Layer 2 -> Sequencer collects it for sorting and execution, and the transaction after the calculation is completed will be submitted to Prover -> Prover for generation The validity proof is submitted to the Verifier contract on the main network -> the Verifier contract verifies the validity of the proof, and if the verification passes, the status is confirmed by the main network.
Data Availability: In Rollup mode, after the proof generated by Prover is verified, the new state will be valid, and the specific information of the state (such as the ledger balance) will be written into the main network, and users can use the data confirmed by the main network without trust. State information initiates new transfers because the mainnet has the latest user balances, i.e. data availability is on-chain.
In fact, most of the gas cost consumed by the main network is used for storage of data availability, rather than proof of verification, that is, having data availability on the main network will incur a large amount of cost. Therefore, StarkNet proposed Validium, a scheme to transfer data availability to off-chain storage, and only the hash value of the verified state is saved on the chain.
In this scheme, data availability is stored by the Data Availability Committee (DAC), which consists of a quorum of independent members who oversee the correct update of the state and keep a copy of the processed data. When a user wants to withdraw Layer 2 funds in a new state, a DAC signature is required to provide specific ledger information. Validium can greatly reduce the cost of Rollup, but at the same time it sacrifices decentralization and data availability suitable for non-important transactions.
Based on the two basic modes of Rollup and Validium, StarkWare also provides the Volition mode, allowing users to choose the storage mode of data availability between Validium and Rollup modes at the transaction level. Users can choose to save in Validium or Rollup mode in each single transaction. To sum up, the three data availability (DA) modes provided by StarkWare allow dApps and users to choose according to the importance of data, and the team claims that all three modes are currently available in production. But no matter which DA mode is used, the validity of all transactions will be guaranteed by STARK validity proof.
Rollup: The ledger is published directly on the blockchain
Validium: The Data Availability Consortium (DAC) keeps the ledger secure and only the hash is kept on-chain
secondary title
2.3 Workflow
2.3.1 StarkNet workflow
1. The user initiates a transaction, and sends the transaction to Squecer for verification, sorting and execution, and packs the batch. At present, there is only one Sequencer officially mastered by StarkWare in the StarkNet system, but the StarkWare team plans to decentralize Squeencer in the future; Squeencer executes transactions through Cairo OS, playing the role of EVM.
2. Squeencer submits the trace of the executed transaction to Prover, and Prover generates a validity certificate for the integrity of the calculation. Execution traces are the core of zkp generation, and recording execution traces is a zk-friendly feature of the Cairo language; Prover here also generates validity proofs for StarkEx, and can aggregate transactions from different StarkEx applications and StarkNet for sharing.
3. Squeencer and Prover send validity proofs and global state changes to all nodes for recording. The full node is built on a P2P network and is responsible for recording the transaction history of the entire Layer 2 network and Layer 2-related transactions on the Ethereum mainnet.
4. Prover submits the validity certificate to Verifier on the main network. Verifier is a smart contract deployed on the Ethereum mainnet, responsible for receiving and verifying the validity proof provided by Prover.
5. Verifier sends the verified result to the StarkNet Core contract on the main network for recording and storage. The StarkNet Core contract is deployed on the Ethereum mainnet to receive Layer 2 global state change information, including state hashes and data availability; the result verified by Verifier is a string of state hashes, and Verifier writes a new Layer 1 Transaction, and passed to the Core contract for saving.
image description

(Image source: https://david-barreto.com/starknets-architecture-review/#more-4602 )
2.3.2 StarkEx Workflow
1. The user initiates an interaction within the app, and the app executes and generates transactions, which will be sent directly to the StarkEx server by the app. StarkEx server is a Cairo program customized by StarkEx for an application
2. The StarkEx server packages transactions in batches, sends them to SHARP Prover, and generates a validity certificate
3. Prover sends the generated validity certificate to Verifier on the chain for verification
image description

secondary title
2.4 StarkNet Value Analysis
StarkNet is a general-purpose Layer 2 launched by StarkWare. It adopts a validity proof scheme to obtain the security of the main network, and belongs to zk-rollup on the track. "Who will occupy the future between zk-rollup and op-rollup?" With the further explosion of Fang ecology, the interactive solution of op-rollup will be limited, and zk-rollup will dominate by virtue of the non-interactive and simplicity of validity proof.
In the subdivision track of zk-rollup, StarkNet did not rush forward in the fiery direction of zkEVM, but opened up a new path through STARK+Cairo, committed to bringing the effectiveness proof technology to the extreme, and gave birth to StarkNet's native ecology.
At present, the entire Web3 has not yet achieved mass adoption, and the StarkNet ecology is only in its infancy. The scarcity of transactions makes it difficult for StarkNet to accumulate a sufficient number of transactions to share the cost of validity proofs, resulting in StarkNet’s transaction confirmation time. Unleash extreme scalability.
first level title
3. Inventory of key StarkNet ecological projects
secondary title
3.1 wallet
3.1.1 Argent X
Argent X is a StarkNet wallet launched by Argent. It is also the first wallet to support StarkNet. It uses StarkNet's native account abstraction features to achieve multi-signature and mnemonic-free features, and uses StarkNet's excellent performance to achieve lower transaction costs. and faster confirmation times for transactions.
Argent X users can use Argent through ios and Google plugins. Its built-in DeFi functions such as exchange, pledge, and lending allow users to complete DeFi one-stop operations in the wallet.
Argent also provides biometric authentication, guardian mechanism and other functions to allow users to obtain web2 experience. The contract security of Argent X has been certified by three auditing companies, Trail of Bits, Solidified and G 0 Group.
picture

3.1.2 Bravvos
Bravvos is also an abstract wallet for self-custodial accounts running on StarkNet. Bravvos is committed to providing a seamless Web2.0 user experience, available on iOS, Android, and multiple browsers, while eliminating seed phrases and allowing users to recover their accounts.
Bravvos also plans to provide DeFi services like staking and lending. Braavos also supports account segmentation, which separates long-term (high amount) savings from daily (low amount) consumption by supporting withdrawal limits and withdrawal delay times, and allows users to view the details of each transaction to achieve refined management of funds on the chain.
secondary title

3.2 Cross-chain bridge
3.2.1 StarkGate
StarkGate is the official cross-chain bridge of Ethereum Starknet developed by StarkWare, which helps users realize cross-chain transactions of ETH and ERC-20 tokens between Ethereum and StarkNet.
picture

3.2.2 Orbiter Finance
Orbiter Finance is a decentralized cross-Rollup bridge that enables users to transfer assets between ETH mainnet, StarkNet, zkSync, Loopring, Arbitrum, Optimism, Polygon, ZKSpace, Immutable X, dYdX, Metis, BNB Chain and Boba chain.
Through the unique market maker model, the Orbiter bridge allows users to obtain excellent experience such as low handling fees and fast speed, but it currently only supports transfers in four currencies: ETH, USDC, USDT, and DAI.
secondary title

3.3 DID
3.3.1 StarkNet ID
StarkNet.id is StarkNet's domain name service (.stark), allowing users to mint StarkNet-based decentralized identities for free. Users can also attach any data to Starknet identities, including identity tags from Web2's social media accounts to Web3's ENS domain name. The team plans to launch a supporting StarkNet identity dashboard and more features to make it easier for users to manage and build A more comprehensive decentralized identity system.
picture

3.3.2 WIW Protocol
WIW is an on-chain identity protocol that focuses on privacy protection. It can generate corresponding tags based on users' on-chain behaviors and help users build an identity system. It mainly covers three application scenarios:
Personal brand building: WIW can help users display their achievements on the chain, build their resumes on the chain, and allow users to obtain potential airdrops and credit loan opportunities by building their credit on the chain
Social activities: WIW's precise analysis of user identities allows users to find and join matching communities and meet people with similar interests
secondary title

3.4 DeFi
3.4.1 10 KSwap
10 KSwap is the first open source AMM protocol deployed on StarkNet, aiming to leverage the performance of rollup to the performance of the AMM protocol, bringing lower fees, less friction and better liquidity to the L2 world.
Currently, 10 KSwap supports swap among five tokens including ETH, USDC, DAI, WBTC, and USDT. Similar to traditional swap, users can also provide liquidity to 10 KSwap to earn market-making income.
picture

3.4.2 Nostra
Nostra is a decentralized lending protocol based on StarkNet's deployment. It is StarkNet's first protocol that supports flash loans and also provides StarkNet's first native stablecoin $UNO.
Nostra aims to build StarkNet's liquidity layer, which consists of three products: Nostra Money Market, UNO, and Nostra Swap:
Nostra Money Market: It is the core product of the liquidity layer, providing users with minting and lending services similar to MakerDAO (minting $UNO); Nostra also provides features such as collateral risk isolation and intelligent liquidation, which further improves the user's lending experience and obtains Better asset security; the currency market also provides benefits for Nostra Swap and UNO minters, helping the entire liquidity system to complete a logical closed loop
Nostra Swap: It is a stable currency trading platform in the Nostra system, similar to Curve, used to support the peg and growth of UNO. Users can provide LP on Nostra Swap to obtain transaction fees and interest in the money market, and can also realize the exchange of $UNO and other stable currencies
picture

3.4.3 ZKX
ZKX is the first perpetual futures trading platform with self-custody and community governance on StarkNet. The protocol aims to provide further scalability through a decentralized node network and an upgraded trading experience, and provide perpetual swaps and derivatives to any user on StarkNet and Ethereum.
ZKX has introduced a series of measures to encourage users to trade, including trading and staking to earn USDC, increasing trading volume to unlock ZKX advanced functions, etc.
secondary title

3.5 NFT
3.5.1 Aspect
picture

3.5.2 Mint Square
secondary title

3.6 Game
3.6.1 cartridge.gg
picture

3.6.2 Briq
Briq is a 3D block-built NFT type chain game built on StarkNet, allowing anyone to build a separate virtual world storage chain. Users can use Briqs to build ERC-1155 standard NFT and build chain games.
picture

3.6.3 Influence
Influence is an immersive space strategy sandbox MMO, project token $SWAY. Players have exclusive asteroids, and by manipulating crew members of different professions, they can conduct mining, construction, trade, research, combat, etc. At present, Influence has conducted three rounds of award-winning tests and is under continuous active development. The release date has not yet been finalized.
picture

3.6.4 lootrealmsLoot Realms
Developed by the game studio Bibliotheca DAO, it is a large-scale multiplayer strategy game ecosystem that can be combined on the chain, and the token $LORDS. The gameplay is similar to Web2's military sandbox games, such as EVE, Satoshibin, etc. Players need to build a sustainable economic system to produce resources, and also protect and compete for resources by building military forces.
first level title

Summarize
With its strong technical advantages and capital blessing, StarkNet has blazed a unique path in the Layer 2 solution. It fully stimulates the potential of validity proof through STARK+Cairo, and it can handle a large number of transactions more easily than other solutions.
StarkNet has temporarily given up good EVM compatibility, but this also means that StarkNet can get rid of the shackles of the EVM framework, gain a more flexible development experience, and attract diverse developers.
Original link


