https://medium.com/starkware/starks-starkex-and-starknet-9a426680745a
@Jing Guijia 13/06/2022 Ju/02/2022
STARKs (Scalable, Transparent ARgument of Knowledge) are a proof system that enables the proving and verification of computations. It allows processing a big computation, generating a proof for the computation’s correctness, and then verifying the proof in very few steps.
STARKs can play a key role in blockchain scalability by allowing large computations to be done off-chain, where it is cheaper, leaving only the verification, which requires a fraction of the computation, to be done on-chain. In other words, by performing very few steps on-chain, the verifier asserts the integrity of a much larger computation that was done off-chain.
Using STARKs, layer 2 solutions batch together and compute thousands of transactions, and then verify their validity on-chain with a single STARK proof. The cost of the on-chain process is split between all transactions in the batch. This results in Ethereum security and low gas cost per transaction.
The low computational cost will usher in a new class of applications that were previously not feasible on-chain. These properties make STARKs an excellent building block for improving user experience and reducing gas costs, all while maintaining the security of the Ethereum settlement layer.
StarkWare provides two solutions to scale Ethereum with STARKs: StarkEx and StarkNet.
StarkEx is a framework for creating permissioned, application-specific scaling solutions. StarkEx is a toolbox of useful application flows that projects can use to achieve cheap off-chain computation. A STARK proof, attesting to the correctness of execution, is generated off-chain. Such a proof can include up to 12,000–500,000 transactions (depending on the transaction type). The proof is then sent to the STARK Verifier to be accepted on-chain. This means one verification for all the transactions — for an incredibly low amortized gas cost per transaction.
A few examples of the applications deployed on StarkEx are dYdX (perpetuals trading), Immutable and Sorare (NFTs — minting and trading), DeversiFi (spot trading), and Celer (DeFi Pooling).
StarkWare is continuously adding more application flows to StarkEx, following the market and its customers’ needs.
StarkNet is a permissionless layer 2 network where any user or developer can deploy smart contracts developed in the Cairo language.
Comparable to the Ethereum smart-contract experience, inside of the StarkNet ecosystem, your contract can interact with any other contract deployed on StarkNet, allowing for richly composable protocols. StarkNet contracts can also interact with Ethereum contracts via asynchronous message passing.
Unlike StarkEx, where applications are responsible for submitting transactions, StarkNet sequencers batch transactions and send them to be processed and proved. (StarkNet’s sequencers are currently operated by StarkWare with future plans to decentralize.) This means once applications deploy their Cairo contracts, they do not have to worry about running additional Operator infrastructure. StarkNet supports the Rollup data availability mode, meaning the state of the rollup is written to Ethereum along with the STARK proofs.
A huge developer community is deeply engaged with the StarkNet ecosystem, building apps, tools and infrastructure. Dozens of applications are already live on testnet — DeFi, games, voting, AI and more. More over, developer tools such as block explorer, local testing environment and framework, SDK’s in several languages and more, are being built by the StarkNet Community. In addition, active discussions take place in the Shamans’ platform, featuring suggestions for improvements, potential features and best practices.
Both StarkEx and StarkNet are STARK-based scaling solutions. Both provide scalability, low gas costs, and Security, but have different operating requirements and interoperability patterns. StarkEx might be the right solution for an application that is largely self-contained and fits into the APIs that StarkEx provides. StarkNet might be better suited for a protocol that requires interacting synchronously with other protocols or has needs that go beyond what StarkEx offers.
STARKs have revolutionized how applications can be built on Ethereum. StarkEx and StarkNet will continue to enable applications that were previously unviable and push the limits of what is possible on the blockchain.
This article was written in collaboration by Tim Gestson and the StarkWare team
STARK(可扩展、透明的知识论证)是一种证明系统,可以证明和验证计算。它允许处理大型计算,生成计算正确性的证明,然后以很少的步骤验证证明。
STARK 可以在区块链可扩展性中发挥关键作用,它允许在链下进行大型计算,成本更低,只留下需要一小部分计算的验证在链上完成。换句话说,通过在链上执行很少的步骤,验证者就可以断言在链下完成的更大计算的完整性。
使用 STARK,第 2 层解决方案可以批处理并计算数千笔交易,然后使用单个 STARK 证明在链上验证它们的有效性。链上流程的成本在批次中的所有交易之间分配。这导致了以太坊的安全性和每笔交易的低 gas 成本。
低计算成本将带来以前在链上不可行的一类新应用。这些属性使 STARKs 成为改善用户体验和降低 gas 成本的优秀构建块,同时保持以太坊结算层的安全性。
StarkWare 提供了两种使用 STARK 扩展以太坊的解决方案:StarkEx 和 StarkNet。
StarkEx是一个用于创建许可的、特定于应用程序的扩展解决方案的框架。StarkEx 是一个包含有用应用程序流程的工具箱,项目可以使用它来实现廉价的链下计算。证明执行正确性的 STARK 证明是在链下生成的。这样的证明最多可以包括 12,000–500,000 笔交易(取决于交易类型)。然后将证明发送给 STARK 验证者以在链上被接受。这意味着对所有交易进行一次验证——每笔交易的摊销汽油成本极低。
StarkEx 上部署的一些应用程序示例包括 dYdX(永续交易)、Immutable 和 Sorare(NFT — 铸造和交易)、DeversiFi(现货交易)和 Celer(DeFi 池化)。
StarkWare 根据市场及其客户的需求,不断向 StarkEx 添加更多应用程序流。
StarkNet是一个无需许可的第 2 层网络,任何用户或开发人员都可以在其中部署以开罗语言开发的智能合约。
与以太坊智能合约体验相比,在 StarkNet 生态系统中,您的合约可以与部署在 StarkNet 上的任何其他合约进行交互,从而允许丰富的可组合协议。StarkNet 合约还可以通过异步消息传递与以太坊合约进行交互。
与 StarkEx 不同,应用程序负责提交交易,StarkNet 排序器对交易进行批处理并将其发送以进行处理和证明。(StarkNet 的排序器目前由 StarkWare 运营,未来计划去中心化。)这意味着一旦应用程序部署了他们的 Cairo 合约,他们就不必担心运行额外的 Operator 基础设施。StarkNet 支持 Rollup 数据可用性模式,这意味着 rollup 的状态与 STARK 证明一起写入以太坊。
一个庞大的开发者社区与 StarkNet 生态系统深入互动,构建应用程序、工具和基础设施。数十个应用程序已经在测试网上上线——DeFi、游戏、投票、人工智能等等。此外,StarkNet 社区正在构建开发工具,例如区块浏览器、本地测试环境和框架、多种语言的 SDK 等等。此外,在萨满的平台上进行了积极的讨论,提出了改进建议、潜在功能和最佳实践。
StarkEx和StarkNet都是基于 STARK 的扩展解决方案。两者都提供可扩展性、低 gas 成本和安全性,但具有不同的操作要求和互操作性模式。StarkEx 可能是适合大部分自包含并适合 StarkEx 提供的 API 的应用程序的正确解决方案。StarkNet 可能更适合需要与其他协议同步交互或需要超出 StarkEx 提供的需求的协议。
STARK 彻底改变了在以太坊上构建应用程序的方式。StarkEx 和 StarkNet 将继续支持以前不可行的应用程序,并推动区块链上的可能性极限。
本文由Tim Gestson和StarkWare团队合作编写