diff --git a/docs/assets/ergo-model.png b/docs/assets/ergo-model.png new file mode 100644 index 00000000..49e38faa Binary files /dev/null and b/docs/assets/ergo-model.png differ diff --git a/docs/dev/get-started.md b/docs/dev/get-started.md index b6117272..6fe34629 100644 --- a/docs/dev/get-started.md +++ b/docs/dev/get-started.md @@ -1,419 +1,449 @@ - # Developer's Guide /// admonition | Welcome to the Ergo Developer's Guide -This comprehensive guide is designed to provide an overview of our platform and introduce you to the various resources available for developers. Whether you're a seasoned blockchain developer or just starting out, this guide will help you navigate the Ergo ecosystem and understand its key features and functionalities. -/// -### **Connect with Our Community** -If you encounter any issues or have questions, feel free to connect with us on any of the following platforms. All our chat platforms are bridged, ensuring seamless communication: - -::cards:: - -[ - { - "title": "Come chat!", - "content": "Join the action on Discord", - "image": "../../assets/img/dev-grid/discord.png", - "url": "https://discord.gg/ergo-platform-668903786361651200" - }, - { - "title": "ERGOHACK", - "content": "We host regular hackathons which are a great opportunity to get involved.", - "image": "../../assets/img/grid/05.png", - "url": "/../../ergohack.md" - }, - { - "title": "Contribute", - "content": "See the Contributing Guidelines for information on bounties and grants.", - "image": "../../assets/img/grid/05.png", - "url": "../data-model/guidelines.md" - - } - -] - -::/cards:: +Welcome to the comprehensive **Ergo Developer's Guide**! Whether you're a seasoned blockchain developer or just starting out, this guide is designed to provide you with an in-depth understanding of the Ergo platform and the resources available to you. Explore the unique features of Ergo, learn how to develop on our platform, and connect with our vibrant community. +/// ## Ergo Platform Overview -Ergo is a next-generation Proof of Work (PoW) blockchain platform designed for secure, efficient, and decentralized smart contract execution. It establishes the foundation for a new wave of blockchain-based applications, with a strong focus on scalability, security, and privacy. Ergo leverages advanced technologies like a powerful scripting language called ErgoScript, flexible Zero-Knowledge Proofs, and the eUTXO model, which is an evolution of Bitcoin's UTXO model. +Ergo is a next-generation **Proof-of-Work (PoW)** blockchain platform designed for secure, efficient, and decentralized smart contract execution. It lays the foundation for a new wave of blockchain-based applications, focusing on scalability, security, and privacy. Ergo leverages advanced technologies like the powerful scripting language **ErgoScript**, flexible **Zero-Knowledge Proofs**, and the **eUTXO model**, an evolution of Bitcoin's UTXO model. - Get a concise overview of Ergo, its standout features, and the technology and decisions that power it on the **[*Why Ergo?*](why.md)** page. - Find answers to the most common questions about Ergo in our **[FAQ](faq.md)**. +### Key Features +- **ErgoScript**: A simple high-level language that enables clear descriptions of contractual logic. ErgoScript supports the creation of flexible crypto-contracts based on Σ-protocols (a class of Zero-Knowledge Proofs), allowing for privacy-preserving transactions and complex smart contract functionality. -### **Key Features** - -- **ErgoScript**: A simple high-level language that enables clear descriptions of contractual logic. ErgoScript supports the creation of flexible crypto-contracts based on Σ-protocols, which are a class of Zero-Knowledge Proofs, allowing for privacy-preserving transactions and complex smart contract functionality. - **Extended UTXO Model (eUTXO)**: The [eUTXO](eutxo.md) model allows each UTXO to carry arbitrary data and be protected by an arbitrary predicate or spending condition. This flexibility enables the representation of various assets, tokens, and smart contract states within the blockchain. -- **Mining with Autolykos**: Ergo utilizes [Autolykos](autolykos.md), an efficient, ASIC-resistant Proof of Work algorithm designed for fair launch. + +- **Mining with Autolykos**: Ergo utilizes [Autolykos](autolykos.md), an efficient, ASIC-resistant Proof-of-Work algorithm designed for a fair launch. - Learn about Ergo's [Emission](emission.md) schedule. -- **[NiPoPoWs](nipopows.md)**: Short for Non-Interactive Proofs of Proof-of-Work are compact data structures that validate blockchain events without needing full network connectivity or downloading all block headers. They enable efficient light clients, log-space mining, and trustless sidechains. + +- **[NiPoPoWs](nipopows.md)**: Short for Non-Interactive Proofs of Proof-of-Work, these are compact data structures that validate blockchain events without needing full network connectivity or downloading all block headers. They enable efficient light clients, log-space mining, and trustless sidechains. + - **Storage Rent**: Also known as [demurrage](rent.md), this mechanism mitigates blockchain bloat and turns it into a profitable venture by charging for on-chain storage. -- **Turing Complete Smart Contracts**: Ergo supports [Turing complete smart contracts](#multi-stage-protocols), enabling complex on-chain computations. +- **Turing-Complete Smart Contracts**: Ergo supports [Turing-complete smart contracts](#multi-stage-protocols), enabling complex on-chain computations. ::cards:: [ { "title": "📚 DeCo EU Layman Class - Basics of eUTxO", - "content": "A Great Introductory course aimed at the laymen from Decentralised Collaboration", + "content": "A great introductory course aimed at the layman from Decentralised Collaboration.", "url": "https://www.youtube.com/watch?v=SAWeW6wajEw" }, { - "title": "🧾 Learning Ergo 101 : eUTXO explained for human beings", + "title": "🧾 Learning Ergo 101: eUTXO Explained for Human Beings", "url": "https://dav009.medium.com/learning-ergo-101-blockchain-paradigm-eutxo-c90b0274cf5e" }, - { - "title": "📹 Learning blockchains like Cardano and Ergo", - "content": "Discusses the process of learning blockchain concepts, emphasizing the significance of understanding these theoretical aspects, practical interaction through playgrounds and nodes.", + "title": "📹 Learning Blockchains like Cardano and Ergo", + "content": "Discusses the process of learning blockchain concepts, emphasizing the importance of understanding theoretical aspects and practical interaction through playgrounds and nodes.", "url": "https://www.youtube.com/watch?v=HDn49bToTMI" } - ] ::/cards:: -### **Documentation & Reports** - -- **[Foundational Papers](documents.md)**: Explore the academic and technical papers that laid the groundwork for Ergo. -- **[EF Transparency Report](ergo-foundation.md)**: Gain insights into Ergo Foundation's operations and transparency initiatives. -- **[Ergo's Social Contract](social_contract.md)**: Delve into the principles and commitments that guide Ergo's community and development. -- **[Howey Test Analysis](security.md)**: Understand how Ergo measures up against the Howey Test for securities. +### Transactional Model +Ergo adopts a transactional approach similar to Bitcoin's UTXO model. In this model, transactions utilize and produce single-use entities known as ['boxes'](box.md). Every [transaction](transactions.md) in Ergo represents an atomic state transition, consuming boxes from the state and creating new ones in their place. The eUTXO model allows each UTXO to carry arbitrary data and be protected by an arbitrary predicate (or [spending condition](types.md#sigmaprop)). The data can represent various tokens or smart contract states. -### **Transactional Model** +[![Ergo Model](../assets/ergo-model.png)](../assets/ergo-model.png) -Ergo adopts a transactional approach similar to Bitcoin's UTXO model. In this model, transactions utilize and produce single-use entities known as a ['box'](box.md). Every [transaction](transactions.md) in Ergo represents an atomic state transition, eliminating a box from the state and introducing new ones in its place. The eUTXO model allows each UTXO to carry arbitrary data and be protected by an arbitrary predicate (or [spending condition](types.md#sigmaprop)). The data can represent arbitrary tokens or smart contract states. +*This image illustrates the structure and process flow of a blockchain transaction on the Ergo platform using its **extended UTXO model** (eUTXO).* -#### **Boxes & Their Components** +#### Boxes & Their Components - **[Registers within Boxes](registers.md)**: Boxes come equipped with multiple registers capable of holding various assets and complex [ErgoScript](#ergoscript) types. + - **[Assets in Ergo](tokens.md)**: Dive deeper into the different assets that can be held within these boxes. Ergo also supports advanced [data structures](data-structures.md) like [AVL+ Trees](data-structures.md) which can be used to store and authenticate large amounts of data on-chain. +### Transactional Basics -#### **Transactional Basics** - -##### **Tutorials & Guides** +#### Tutorials & Guides - **[Ergo Platform Basic Starter Tutorial](basics.md)** + - **[Create & Send a Transaction](https://www.youtube.com/watch?v=Md5s-XV6-Hs)**: A video tutorial on creating and sending a transaction using AppKit. + - **[Sign a Transaction](sign-tx.md)**: Learn how to sign a transaction with Sigma Rust. + - **[Sending a Chained Transaction](chained-tx.md)**: A guide on sending a chained transaction using Ergpy. + - **[Getting Started with Fleet SDK](https://fleet-sdk.github.io/docs/getting-started)**: A beginner's guide to the Fleet SDK. -##### **Tokens & NFTs** +#### Tokens & NFTs - **[Issuing a Token](tokens.md)**: A step-by-step guide on how to issue a token on Ergo. + - **[Burning a Token](burn.md)**: Learn how to burn a token, effectively removing it from circulation. + - **[Minting an NFT](create.md)**: A comprehensive guide on creating a Non-Fungible Token (NFT) on Ergo. -- **[Minting a on-chain NFT](on-chain.md)**: Don't want to rely on third-party storage? You can squeeze a NFT directly into the registers! +- **[Minting an On-Chain NFT](on-chain.md)**: Don't want to rely on third-party storage? You can squeeze an NFT directly into the registers! +## ErgoScript -### **Introductory Resources** +ErgoScript is a super-simple subset of Scala, enabling clear descriptions of contractual logic that can be Turing-complete. It is flexible enough to allow for ring signatures, multi-signatures, multiple currencies, atomic swaps, self-replicating scripts, and long-term computation. -::cards:: +The Account model of Ethereum is imperative, meaning that sending coins from Alice to Bob requires changing balances in storage through a series of operations. In contrast, Ergo's UTXO-based programming model is declarative. ErgoScript contracts specify conditions for a transaction to be accepted by the blockchain, not changes to be made in the storage state as a result of the contract execution. -[ +### Introduction - { - "title": "📚 DeCo Intro Lessons", - "content": "Programming basics for the laymen, from DeCo (Decentralised Collaboration)", - "url": "https://www.youtube.com/watch?v=qR0_k7VH6KI&list=PLopsKGshj0B4BpMoSMh5hQk8gVfWk-si6" - }, +- [Quick Primer](ergoscript-primer.md) +- [Core Concepts of ErgoScript](ergoscript-key-concepts.md) +- [Sigma Language](sigma-lang.md) +- [Creating a Simple Pay-to-Script App](p2s.md) - { - "title": "📚 DeCo Education docs", - "content": "DeCo steps you through eUTXO & NFTs, dApp Development and Multi-Stage Tx's & Smart Contracts", - "url": "https://deco-education.github.io/deco-docs/docs/category/into-the-woods" - }, +### Experimenting +- **[escript.online](https://escript.online/)** - { - "title": "📹 Ergo Blockchain Crash Course", - "content": "Ergo crash course, presented by developer Luca (lgd) covering the eUTXO model, Anatomy of Ergo and more.", - "url": "https://www.youtube.com/playlist?list=PL8-KVrs6vXLTVXGwmYXjOBRx3VymB4Vm2" - }, +- **[PlutoMonkey](plutomonkey.md)**: Compile any ErgoScript contract into a P2S. Check out these [simple examples](p2s.md). - { - "title": "📹 More introductory videos", - "url": "tutorials/introductory-video" - } -] +- **[Scastie](scastie.md)**: An online compiler tailored for Scala, perfect for developers eager to experiment, share, or learn Scala. -::/cards:: +- **[Kiosk](/dev/stack/kiosk)**: A web-based UI to explore ErgoScript. -/// admonition | Chatbots! - type: info +- **[Ergo-Puppet](puppet.md)**: An advanced tool built on the Ergo Playground, designed for off-chain experimentation and unit testing of Ergo contracts. -To further explore and understand Ergo's concepts, you can interact with the following chatbots: +### Tooling -- [General chat bot](https://www.chatbase.co/chatbot-iframe/zxB2uzZfYoHIpA98eTzgM) -- [ErgoScript chat bot](https://www.chatbase.co/chatbot-iframe/INAIfQ2ts4E6ykf4rseVu) +- **[Ergo Development Generics Elements](https://github.com/Ergo-Lend/edge)** -/// +- **[VSCode ErgoScript Language Support](https://github.com/GuapSwap/vscode-ergoscript-language-support)** +- **[ErgoScala](ergoscala.md)**: A compiler for Ergo smart contracts written in ErgoScala (a subset of Scala). +- **[CLI Compiler](compiler.md)**: A Command Line Interface tool to compile ErgoScript code into an Ergo address. -## **Ergo Infrastructure** +- **[FlowCards](flowcards.md)**: A declarative framework for developing Ergo dApps. +- **[ergo-playgrounds](https://github.com/ergoplatform/ergo-playgrounds)**: Run contracts and off-chain code in the browser. -##### **Ergo Node & Network** +- **[ergo-script-re](https://github.com/ross-weir/ergo-script-re/tree/main)**: Libraries for Ergo Script reverse engineering and analysis. -- **[Ergo Node](install.md)**: The Ergo Node forms the core of Ergo's P2P network, maintaining and synchronizing the entire blockchain. - - **[Bootstrap from UTXO Snapshot](pruned-full-node.md)**: Expedite the setup of a pruned full node on the [testnet](testnet.md) by bootstrapping from a UTXO snapshot. - - **[Fork Your Own Chain](mine-your-own-chain.md)**: Learn how to customize and create your own chain with specific parameters. +### Courses -##### **API & Programmatic Access** +If you're interested in deepening your understanding of ErgoScript and the Ergo ecosystem, consider taking one of the following courses: -- **[Node API](swagger.md)**: Gain comprehensive overview of the Ergo node API functionalities. - - **[Public APIs](api.md)**: If you prefer not to run your own node, you can utilize these public APIs for a variety of functionalities. +- [DeCo Education: Into the Woods](https://deco-education.github.io/deco-docs/docs/category/into-the-woods): This course provides a comprehensive introduction to the Ergo ecosystem. -##### **Explorers** +- [ErgoScript 101 Crash Course](https://docs.google.com/presentation/d/10gYO82z_7qloRrFOcCxTFuzpP40IImPyIKMV2ZFd9M4/edit#slide=id.p) (Slides): A crash course covering the basics of ErgoScript, perfect for beginners. -- **Public Explorers** can be accessed at [explorer.ergoplatform.com](https://explorer.ergoplatform.com/) and [testnet.ergoplatform.com](https://testnet.ergoplatform.com/). -- Delve deeper into blockchain data with **[GraphQL](graphql.md)**. -- **[Explorer & Node Bundles](install.md#Toolkits)**: Install both locally for a comprehensive blockchain experience. - - **[uExplorer](explorer.md)**: A lightweight Ergo explorer backed by CassandraDB. - - **[Blockchain Explorer with Raspberry Pi](rpi-blockchain-explorer.md)**: Learn how to set up an explorer using Raspberry Pi. +- [Learn ErgoScript By Example Via The Ergo Playground with Robert Kornacki (Video)](https://www.youtube.com/watch?v=8l2v1asHgyA): This video tutorial offers practical examples of how to use ErgoScript in the Ergo Playground. +- [DeCo-Education/ErgoScript-Developer-Course](https://github.com/DeCo-Education/ErgoScript-Developer-Course): A more advanced course for developers looking to build on their ErgoScript knowledge. -##### **Toolkits** +### Tutorials -- **[danaides](https://github.com/ergopad/danaides)**: A high-performance blockchain toolkit. +- [ErgoScript by Example Repository](https://github.com/ergoplatform/ergoscript-by-example) -##### **Off-chain** +- [Testing Ergo Contracts Off-chain](https://github.com/anon-real/contract-testing) -- [Bootstrap an Oracle Pool on testnet](oracle-bootstrap.md) -- [Running off-chain bots](dex_bots.md) +- [Debugging ErgoScript](debugging.md) +- [ergo-playground](https://github.com/jaysee260/ergo-playground): A collection of miscellaneous scenarios implemented on the Ergo blockchain. -## App development +### Boilerplate -Developers have a plethora of tools, libraries, SDKs, frameworks, and utilities at their disposal to seamlessly interact with the blockchain, craft applications, and present them to users. Navigate through the [Developer Section](start.md) to use grid buttons that help refine your technical stack requirements and pinpoint the ideal tooling. +- [scala-play-next-ergo](https://github.com/kii-dot/scala-play-next-ergo) + +- [ergo-scala-skeleton-app](https://github.com/dav009/ergo-scala-skeleton-app) + +- [The Ergo Web Template](https://github.com/SavonarolaLabs/ergo-web-template): An introductory guide for individuals new to Ergo, offering a hands-on experience with essential Ergo functionalities. + +- [Ergo-play-boilerplate](https://github.com/kii-dot/ergo-play-boilerplate) + +### Advanced Tutorials + +- [ErgoScript Tutorial](https://ergoplatform.org/docs/ErgoScript.pdf) + +- [Advanced ErgoScript Tutorial](https://ergoplatform.org/docs/AdvancedErgoScriptTutorial.pdf) + +### Interpreters + +ErgoScript has two compiler and ErgoTree interpreter implementations for the [*Sigma Language*](sigma-lang.md): + +- **[Sigmastate-interpreter](sigmastate-interpreter.md)**: For JVM languages, utilized by [AppKit](appkit.md). + +- **[Sigma-Rust](sigma-rust.md)**: A simpler alternative for the ErgoTree interpreter and transaction tools. + +## Cryptography + +Ergo has generic support for ring and threshold signatures, as well as a variety of cryptographic protocols via composable [sigma-protocols](crypto.md) built into the core. + +Sigma Protocols (Σ-Protocols) are the foundation of Ergo’s smart contracts. Their advantage is that they are composable using simple AND/OR logic. When combined with a blockchain, these composable proofs enable very powerful use cases, allowing for the implementation of sophisticated tasks that would otherwise be impossible, risky, or expensive on other platforms. + +### Crypto Primitives + +- **Hash Functions**: + - `Sha256`: Secure Hash Algorithm 256-bit. + - `Blake2b256`: A cryptographic hash function faster than MD5 and SHA-256, providing security similar to the strongest hash functions available. + +- **Encoding**: + - `Base58`: A binary-to-text encoding scheme used for encoding Bitcoin addresses and other text-based data. + +- **Signing Algorithms**: + - `ECDSA (secp256k1)`: Elliptic Curve Digital Signature Algorithm over the secp256k1 curve, widely used in Bitcoin and other cryptocurrencies. + - `Schnorr`: A digital signature scheme that is simple, provably secure in the random oracle model, and allows for the aggregation of multiple signatures into a single signature, enhancing efficiency and privacy. + +- **Primitive Secrets**: + - **[Schnorr Signature](schnorr.md)**: A proof of knowledge of a discrete logarithm with respect to a fixed group generator. + - **[Diffie-Hellman Tuple](diffe.md)**: A proof of equality of discrete logarithms, enabling secure exchange of cryptographic keys over a public channel. + +- **Non-Interactive Proofs**: + - The proofs of sigma-statements are made non-interactive with the [**Fiat-Shamir transformation**](diffe.md#fiat-shamir-transformation), which converts an interactive proof of knowledge into a non-interactive one by using a cryptographic hash function. + +- **Additional Cryptographic Standards**: + - **[EIP-0003: Deterministic Wallet Standard](eip3.md)**: A standard defining the structure and operation of deterministic wallets in the Ergo platform. + +See [this page](/dev/scs/global-functions/#cryptographic-functions) for a description of the global cryptographic functions available in ErgoScript. + +### Tutorials + +- [Creating a 3-out-of-5 Threshold Signature](sig.md) + +- [Message Signing and User Authentication](message-signing.md) + +- [Verifying Schnorr Signatures in ErgoScript](https://www.ergoforum.org/t/verifying-schnorr-signatures-in-ergoscript/3407) + +- [Updateable Multisig Pattern](https://www.ergoforum.org/t/updateable-multisig-pattern/3356) + +- [Making and Implementing a Signature, Elliptic Curves, and Extended Keys: Ergo with C#](https://www.youtube.com/watch?v=aUuki-fAxwc&list=PLUWruihtE-HtL-JZk8Vb4Yn_H18aE3rb6) + +### Tools + +- **[Scrypto](scrypto.md)**: A comprehensive open-source cryptographic toolkit, specifically engineered to simplify and safeguard the process of integrating cryptography into your applications. Supports AVL+ Trees and Batch Merkle Proof Serialization and Deserialization. + +## Advanced Concepts + +### Merkle Trees +**[Merkle Trees](merkle-tree.md)** are a fundamental data structure in the Ergo blockchain, ensuring the integrity and authenticity of data. They play a crucial role in various blockchain operations, from verifying transactions within blocks to securing additional metadata in the Extension Block. Ergo extends the concept of Merkle Trees by combining transactions and their corresponding spending proofs into a single Merkle Tree. + +Developers should familiarize themselves with Merkle Trees and their associated code implementations to effectively leverage them in their Ergo projects. + +### AVL Trees (Plasma) + +**[AVL trees](avl.md)** are highly efficient authenticated data structures natively supported in Ergo. These trees offer several benefits, including the ability to authenticate data properties without accessing the entire dataset. Developers can seamlessly integrate AVL trees into their Ergo applications using one of the **[Plasma](plasma.md)** libraries. + +### Multi-Stage Protocols + +[Multi-Stage Contracts](multi.md) is a technique where, using transaction trees, we can emulate persistent storage in UTXO-based systems by linking several UTXOs containing small pieces of code to form a large multi-stage protocol. This enables *on-chain computations*, making it possible to process parallelized actions on top of smart contracts and construct **Turing-complete** applications. + +## App Development + +Developers have a plethora of tools, libraries, SDKs, frameworks, and utilities at their disposal to seamlessly interact with the blockchain, craft applications, and present them to users. Navigate through the [Developer Section](start.md) to use grid buttons that help refine your technical stack requirements and pinpoint the ideal tooling. If you're aiming to develop a comprehensive decentralized application on Ergo, consider the following SDKs and frameworks tailored to your specific needs: /// admonition | As a spreadsheet! -Most repositories are also categories on [grist](https://ergo.getgrist.com/jf9KPR1HUDJH/Project-Management). This is a great place to start if you're looking for a specific repository or want to see what's currently being worked on. + type: info + +Most repositories are also categories on [Grist](https://ergo.getgrist.com/jf9KPR1HUDJH/Project-Management). This is a great place to start if you're looking for a specific repository or want to see what's currently being worked on. + /// -##### **Primary SDKs** +### Primary SDKs - **[AppKit](appkit.md)**: The go-to SDK for JVM developers, supporting Java, Scala, Kotlin, and Mobile platforms. - [General Example](tutorial.md) - [Using AppKit with Python](https://github.com/ergoplatform/ergo-appkit/wiki/Using-Appkit-from-Python) - [AppKit by Example](https://www.youtube.com/watch?v=Md5s-XV6-Hs) + - **[Fleet SDK](fleet.md)**: A pure JS library designed for effortless Ergo transaction creation. - - [The Ergo Web Template](https://github.com/SavonarolaLabs/ergo-web-template), serves as an introductory guide for individuals new to Ergo. This resource aims to streamline the onboarding process for newcomers by offering them a hands-on experience with essential Ergo functionalities. -- **[SigmaRust](sigma-rust.md)** is a ErgoTree interpreter with transaction tools and bindings for JS/TS/Swift/Java/C/Ruby. + - [Getting Started with Fleet SDK](https://fleet-sdk.github.io/docs/getting-started) + - [The Ergo Web Template](https://github.com/SavonarolaLabs/ergo-web-template): An introductory guide for individuals new to Ergo, offering a hands-on experience with essential Ergo functionalities. + +- **[SigmaRust](sigma-rust.md)**: An ErgoTree interpreter with transaction tools and bindings for JS/TS/Swift/Java/C/Ruby. - [Address Generation Demo](https://github.com/ergoplatform/sigma-rust/tree/develop/bindings/ergo-lib-wasm/examples/address-generation-demo) - [Create Transaction Demo](https://github.com/ergoplatform/sigma-rust/tree/develop/bindings/ergo-lib-wasm/examples/create-transaction-demo) -##### **Alternative SDKs** +### Alternative SDKs + +- **[Ergpy](ergpy.md)**: A Python-JVM wrapper facilitating interactions with the Ergo blockchain. + +- **[Mosaik](mosaik.md)**: A dedicated UI system crafted for Ergo dApps. -- **[Ergpy](ergpy.md)** is a Python-JVM wrapper facilitating interactions with the Ergo blockchain. -- **[Mosaik](mosaik.md)** is a dedicated UI system crafted for Ergo dApps. - **[JSON dApp Environment](jde.md)** + - **[Headless dApp Framework](headless.md)**: A Rust-based framework for creating Ergo Headless dApps, marking the debut of a portable UTXO-centric headless dApp development framework on any blockchain. + - **[RustKit (In Development)](rustkit.md)**: An upcoming toolkit aiming to align the Rust development experience with the JVM. -##### **Payments** +### Payments + +- **[ErgoPay](ergo-pay.md)**: Ergo's dApp connector for non-web wallets. + +- **[dApp Connector](dApp.md)**: For connecting dApps to web-based wallets like Nautilus and SAFEW. + +- **[Proxy Contracts](proxy.md)**: A smart contract design used in blockchain ecosystems to enable secure and controlled interaction between users and decentralized applications. -- [**ErgoPay**](ergo-pay.md) is Ergo's dApp connector for non-web wallet -- [**dApp Connector**](dApp.md) is for connecting dApps to web-based wallets like Nautilus and SAFEW. -- [**Proxy Contracts**](proxy.md) are a smart contract design used in blockchain ecosystems to enable secure and controlled interaction between users and decentralized applications. +### Libraries -##### **Librarie** +- [ergo-lib-go](https://github.com/ergoplatform/ergo-lib-go): Go wrapper around C bindings for ErgoLib from sigma-rust. -- [ergo-lib-go](https://github.com/ergoplatform/ergo-lib-go): Go wrapper around C bindings for ErgoLib from sigma-rust -- [ergo-lib-wasm](https://github.com/ergoplatform/ergo-lib-wasm): ergo-lib bindings for JS/TS -- [ergo_client](https://github.com/ross-weir/ergo_client): Rust library containing HTTP clients for various Ergo applications -- [sigma-builders](https://github.com/GuapSwap/sigma-builders): Easy to use library for creating protocol abstractions interacting with Ergo blockchain. +- [ergo-lib-wasm](https://github.com/ergoplatform/ergo-lib-wasm): Ergo-lib bindings for JS/TS. +- [ergo_client](https://github.com/ross-weir/ergo_client): Rust library containing HTTP clients for various Ergo applications. -##### Templates +- [sigma-builders](https://github.com/GuapSwap/sigma-builders): Easy-to-use library for creating protocol abstractions interacting with the Ergo blockchain. +### Templates ::cards:: [ - { - "title": "📕 Side tooling for building dApps on Ergo", + "title": "📕 Side Tooling for Building dApps on Ergo", "url": "https://dav009.medium.com/ergo-101-side-tooling-for-building-dapps-on-ergo-c71889d60826", "content": "Building functional dApps on Ergo requires more than just smart contracts and transactions." - }, { "title": "📕 DeCo Education: DApp Components - Backend", "url": "https://deco-education.github.io/deco-docs/docs/into-the-woods/trail2-ergo-coding/dapp-components" - } , + }, { - "title": "📕 DeCo Intro Lessons: Build a mobile app on Android or iOS", + "title": "📕 DeCo Intro Lessons: Build a Mobile App on Android or iOS", "url": "https://www.youtube.com/watch?v=qR0_k7VH6KI&list=PLopsKGshj0B4BpMoSMh5hQk8gVfWk-si6" } ] - ::/cards:: -## ErgoScript - -ErgoScript is a super-simple subset of Scala, enabling clear descriptions of contractual logic that can be Turing complete. - -It is flexible enough to allow for ring signatures, multi-signatures, multiple currencies, atomic swaps, self-replicating scripts, and long-term computation. - -The Account model of Ethereum is imperative. This means that the typical task of sending coins from Alice to Bob requires changing the balances in storage as a series of operations. On the other hand, Ergo's UTXO based programming model is declarative. ErgoScript contracts specify conditions for a transaction to be accepted by the blockchain (not changes to be made in the storage state as a result of the contract execution). - -##### **Introduction** - -- [Quick Primer](ergoscript-primer.md) -- [Core Concepts of ErgoScript](ergoscript-key-concepts.md) -- [Sigma Language](sigma-lang.md) -- [Creating a simple pay-to-script app](p2s.md) - +## Ergo Infrastructure +### Ergo Node & Network -##### Experimenting - -- **[escript.online](https://escript.online/)** -- **[PlutoMonkey](plutomonkey.md)**: Compile any ErgoScript contract into a P2S. Check out these [simple examples](p2s.md). -- **[Scastie](scastie.md)**: An online compiler tailored for Scala, perfect for developers eager to experiment, share, or learn Scala. -- **[Kiosk](/dev/stack/kiosk)**: A web-based UI to explore ErgoScript. -- **[Ergo-Puppet](puppet.md)**: An advanced tool built on the Ergo Playground, designed for off-chain experimentation and unit testing of Ergo contracts. - - -##### **Tooling** - -- **[Ergo Development Generics Elements](https://github.com/Ergo-Lend/edge)** -- **[VSCode ErgoScript Language Support](https://github.com/GuapSwap/vscode-ergoscript-language-support)** -- **[ErgoScala](ergoscala.md)**: A compiler for Ergo smart contracts written in ErgoScala (a subset of Scala). -- **[CLI Compiler](compiler.md)**: A Command Line Interface tool to compile ErgoScript code into an Ergo address. -- **[FlowCards](flowcards.md)**: A declarative framework for developing Ergo dApps. -- **[ergo-playgrounds](https://github.com/ergoplatform/ergo-playgrounds)**: Run contracts + off-chain code in the browser -- **[ergo-script-re](https://github.com/ross-weir/ergo-script-re/tree/main)**: Libraries for Ergo Script reverse engineering and analysis - -##### **Courses** - -If you're interested in deepening your understanding of ErgoScript and the Ergo ecosystem, consider taking one of the following courses: - -- [DeCo Education: Into the Woods](https://deco-education.github.io/deco-docs/docs/category/into-the-woods): This course provides a comprehensive introduction to the Ergo ecosystem. -- [ErgoScript 101 Crash Course](https://docs.google.com/presentation/d/10gYO82z_7qloRrFOcCxTFuzpP40IImPyIKMV2ZFd9M4/edit#slide=id.p) (Slides): A crash course that covers the basics of ErgoScript, perfect for beginners. -- [Learn ErgoScript By Example Via The Ergo Playground with Robert Kornacki (Video)](https://www.youtube.com/watch?v=8l2v1asHgyA): This video tutorial offers practical examples of how to use ErgoScript in the Ergo Playground. -- [DeCo-Education/ErgoScript-Developer-Course](https://github.com/DeCo-Education/ErgoScript-Developer-Course): A more advanced course for developers looking to build on their ErgoScript knowledge. - -##### **Tutorials** - -- [ErgoScript by Example Repository](https://github.com/ergoplatform/ergoscript-by-example) -- [Testing Ergo Contracts Off-chain](https://github.com/anon-real/contract-testing) -- [Debugging ErgoScript](debugging.md) -- [ergo-playground](https://github.com/jaysee260/ergo-playground): A collection of miscellaneous scenarios implemented on the Ergo blockchain. - -##### **Boilerplate** - -- [scala-play-next-ergo](https://github.com/kii-dot/scala-play-next-ergo) -- [ergo-scala-skeleton-app](https://github.com/dav009/ergo-scala-skeleton-app) -- [The Ergo Web Template](https://github.com/SavonarolaLabs/ergo-web-template), serves as an introductory guide for individuals new to Ergo. This resource aims to streamline the onboarding process for newcomers by offering them a hands-on experience with essential Ergo functionalities. -- [Ergo-play-boilerplate](https://github.com/kii-dot/ergo-play-boilerplate) - +- **[Ergo Node](install.md)**: The Ergo Node forms the core of Ergo's P2P network, maintaining and synchronizing the entire blockchain. + - **[Bootstrap from UTXO Snapshot](pruned-full-node.md)**: Expedite the setup of a pruned full node on the [testnet](testnet.md) by bootstrapping from a UTXO snapshot. + - **[Fork Your Own Chain](mine-your-own-chain.md)**: Learn how to customize and create your own chain with specific parameters. -##### **Advanced Tutorials** +### API & Programmatic Access -- [ErgoScript tutorial](https://ergoplatform.org/docs/ErgoScript.pdf) -- [Advanced ErgoScript Tutorial](https://ergoplatform.org/docs/AdvancedErgoScriptTutorial.pdf) +- **[Node API](swagger.md)**: Gain a comprehensive overview of the Ergo node API functionalities. + - **[Public APIs](api.md)**: If you prefer not to run your own node, you can utilize these public APIs for a variety of functionalities. +### Explorers +- **Public Explorers** can be accessed at [explorer.ergoplatform.com](https://explorer.ergoplatform.com/) and [testnet.ergoplatform.com](https://testnet.ergoplatform.com/). -### Interpreters +- Delve deeper into blockchain data with **[GraphQL](graphql.md)**. -ErgoScript has two compiler and ErgoTree interpreter implementations for the [*Sigma Language*](sigma-lang.md): +- **[Explorer & Node Bundles](install.md#Toolkits)**: Install both locally for a comprehensive blockchain experience. + - **[uExplorer](explorer.md)**: A lightweight Ergo explorer backed by CassandraDB. + - **[Blockchain Explorer with Raspberry Pi](rpi-blockchain-explorer.md)**: Learn how to set up an explorer using Raspberry Pi. -- **[Sigmastate-interpreter](sigmastate-interpreter.md)** for JVM languages, utilized by [AppKit](appkit.md). -- **[Sigma-Rust](sigma-rust.md)**: A simpler alternative for the ErgoTree interpreter and transaction tools. +### Toolkits -### Cryptographic +- **[danaides](https://github.com/ergopad/danaides)**: A high-performance blockchain toolkit. -Ergo has generic support ring and threshold signatures as well as a variety of cryptographic protocols via composable [sigma-protocols](crypto.md) built into the core. +### Off-chain -Sigma Protocols (Σ-Protocols) are the foundation of Ergo’s smart contracts. Their advantage is that they are composable, using simple AND/OR logic. +- [Bootstrap an Oracle Pool on Testnet](oracle-bootstrap.md) -When combined with a blockchain, these composable proofs enable very powerful use cases, while allowing for the implementation of sophisticated tasks that would otherwise be impossible, risky, or expensive on other platforms. +- [Running Off-chain Bots](dex_bots.md) +## Documentation & Reports -##### **Crypto Primitives** +- **[Foundational Papers](documents.md)**: Explore the academic and technical papers that laid the groundwork for Ergo. +- **[EF Transparency Report](ergo-foundation.md)**: Gain insights into the Ergo Foundation's operations and transparency initiatives. -- **Hash**: - - `Sha256`: Secure Hash Algorithm 256-bit. - - `Blake2b256`: A cryptographic hash function that is faster than MD5 and SHA-256, yet provides security similar to the strongest hash functions available. -- **Encoding**: - - `Base58`: A binary-to-text encoding scheme used for encoding Bitcoin addresses and other text-based data. -- **Signing Algorithm**: - - `ECDSA (secp256k1)`: Elliptic Curve Digital Signature Algorithm over the secp256k1 curve, widely used in Bitcoin and other cryptocurrencies. - - `Schnorr`: A digital signature scheme that is simple, provably secure in the random oracle model, and allows for the aggregation of multiple signatures into a single signature, enhancing efficiency and privacy. -- **Primitive Secrets**: - - **[Schnorr Signature](schnorr.md)**: A proof of knowledge of a discrete logarithm with respect to a fixed group generator. - - **[Diffie-Hellman Tuple](diffe.tex)**: A proof of equality of discrete logarithms, enabling secure exchange of cryptographic keys over a public channel. -- **Non-Interactive Proofs**: - - The proofs of sigma-statements are made non-interactive with the [**Fiat-Shamir transformation**](diffie.md#fiat-shamir-transformation), which converts an interactive proof of knowledge into a non-interactive one by using a cryptographic hash function. -- **Additional Cryptographic Standards**: - - **[EIP-0003: Deterministic Wallet Standard](eip3.md)**: A standard defining the structure and operation of deterministic wallets in the Ergo platform. +- **[Ergo's Social Contract](social_contract.md)**: Delve into the principles and commitments that guide Ergo's community and development. -See [this page](/dev/scs/global-functions/#cryptographic-functions) for a description of the global Cryptographic functions available in ErgoScript. +- **[Howey Test Analysis](security.md)**: Understand how Ergo measures up against the Howey Test for securities. -##### **Tutorials** +## Introductory Resources -- [Creating a 3-out-of-5 Threshold Signature](sig.md) -- [Message signing and user authentication](message-signing.md) -- [Verifying Schnorr Signatures in ErgoScript](https://www.ergoforum.org/t/verifying-schnorr-signatures-in-ergoscript/3407) -- [Updateable Multisig Pattern](https://www.ergoforum.org/t/updateable-multisig-pattern/3356) -- [Making and implementing a signature, elliptic curves, and extended keys: Ergo with C#](https://www.youtube.com/watch?v=aUuki-fAxwc&list=PLUWruihtE-HtL-JZk8Vb4Yn_H18aE3rb6) +::cards:: +[ + { + "title": "📚 DeCo Intro Lessons", + "content": "Programming basics for the layman from Decentralised Collaboration (DeCo).", + "url": "https://www.youtube.com/watch?v=qR0_k7VH6KI&list=PLopsKGshj0B4BpMoSMh5hQk8gVfWk-si6" + }, + { + "title": "📚 DeCo Education Docs", + "content": "DeCo steps you through eUTXO & NFTs, dApp Development, and Multi-Stage Transactions & Smart Contracts.", + "url": "https://deco-education.github.io/deco-docs/docs/category/into-the-woods" + }, + { + "title": "📹 Ergo Blockchain Crash Course", + "content": "Ergo crash course presented by developer Luca (lgd), covering the eUTXO model, anatomy of Ergo, and more.", + "url": "https://www.youtube.com/playlist?list=PL8-KVrs6vXLTVXGwmYXjOBRx3VymB4Vm2" + }, + { + "title": "📹 More Introductory Videos", + "url": "tutorials/introductory-video" + } +] -##### **Tools** +::/cards:: -- **[Scrypto](scrypto.md)** is a comprehensively built open-source cryptographic toolkit, specifically engineered to simplify and safeguard the process of integrating cryptography into your applications. Supporting AVL+ Trees and Batch Merkle Proof Serialization and Deserialization. +## Connect with Our Community -### Merkle Trees +If you encounter any issues or have questions, feel free to connect with us on any of the following platforms. All our chat platforms are bridged, ensuring seamless communication: -**[Merkle Trees](merkle-tree.md)** are a fundamental data structure in the Ergo blockchain, ensuring the integrity and authenticity of data. They play a crucial role in various blockchain operations, from verifying transactions within blocks to securing additional metadata in the Extension Block. Ergo extends the concept of Merkle Trees by combining transactions and their corresponding spending proofs into a single Merkle Tree. +::cards:: -Merkle Trees in Ergo follow a specific structure and encoding scheme, providing cryptographic security and deterministic byte representation. They are used in core applications such as the Transaction Merkle Tree, Extension Block Merkle Tree, Merkle Batch Proofs, and State Proofs. +[ + { + "title": "Come Chat!", + "content": "Join the action on Discord", + "image": "../../assets/img/dev-grid/discord.png", + "url": "https://discord.gg/ergo-platform-668903786361651200" + }, + { + "title": "ERGOHACK", + "content": "We host regular hackathons which are a great opportunity to get involved.", + "image": "../../assets/img/grid/05.png", + "url": "/../../ergohack.md" + }, + { + "title": "Contribute", + "content": "See the Contributing Guidelines for information on bounties and grants.", + "image": "../../assets/img/grid/05.png", + "url": "../data-model/guidelines.md" + } +] -Developers should familiarize themselves with Merkle Trees and their associated code implementations to effectively leverage them in their Ergo projects. +::/cards:: -### AVL Trees (Plasma) +/// admonition | Chatbots! + type: info -**[AVL trees](avl.md)** are highly efficient authenticated data structures natively supported in Ergo. These trees offer several benefits, including the ability to authenticate data properties without accessing the entire dataset. Developers can seamlessly integrate AVL trees into their Ergo applications using one of the **[Plasma](plasma.md)** libraries. +To further explore and understand Ergo's concepts, you can interact with the following chatbots: -### Multi-Stage Protocols +- [General Chatbot](https://www.chatbase.co/chatbot-iframe/zxB2uzZfYoHIpA98eTzgM) -Multi-Stage Contracts is a technique wherein using transaction trees we can emulate persistent storage in UTXO-based systems by linking several UTXOs containing small pieces of code to form a large [multi-stage protocol](multi.md). This enables *on-chain computations*, making it possible to process parallelised actions on top of smart contracts and construct **Turing-complete** applications. +- [ErgoScript Chatbot](https://www.chatbase.co/chatbot-iframe/INAIfQ2ts4E6ykf4rseVu) +/// -## **Ergo Community Resources** +## Ergo Community Resources -##### **Analytics & Insights** +### Analytics & Insights - **[Ergo Watch](https://ergo.watch/)**: Dive into on-chain analytics and data. -##### **Community Knowledge Base** +### Community Knowledge Base - **[Ergonaut Space](https://ergonaut.space/)**: Discover Ergo's community-driven wiki, filled with insights and information. -##### **Explore the Ecosystem!** +### Explore the Ecosystem! - **[Sigmaverse.io](https://sigmaverse.io/)**: Explore a diverse range of dApps built on Ergo. + - **[ErgCube](https://ergcube.com/)**: Another platform to discover and interact with Ergo dApps. -- The [**Ecosystem**](../uses/index.md) section on this site acts as directory for projects building on Ergo and potential future ideas. +- The [**Ecosystem**](../uses/index.md) section on this site acts as a directory for projects building on Ergo and potential future ideas. \ No newline at end of file diff --git a/docs/tutorials/rsERGLP.md b/docs/tutorials/rsERGLP.md index 0f32c91e..59f1a879 100644 --- a/docs/tutorials/rsERGLP.md +++ b/docs/tutorials/rsERGLP.md @@ -1,20 +1,8 @@ -# Comprehensive Guide: Participating in rsERG/ETH Liquidity Pools +# Comprehensive Guide: Participating in rsERG Liquidity Pools This guide walks you through the process of participating in rsERG/ETH liquidity pools. It covers essential precautions, the bridging process, and how to provide liquidity on Uniswap step by step. ---- - -## Table of Contents -1. [Important Notes](#important-notes) -2. [Preparing for the Bridge](#preparing-for-the-bridge) -3. [Bridging Assets Using Rosen](#bridging-assets-using-rosen) -4. [Adding rsERG to MetaMask](#adding-rserg-to-metamask) -5. [Step-by-Step: Providing Liquidity on Uniswap](#step-by-step-providing-liquidity-on-uniswap) -6. [Additional Tips and Notes](#additional-tips-and-notes) - ---- - ## Important Notes ### ERGO Token Contract Address @@ -55,11 +43,7 @@ By following these steps, you can efficiently bridge your assets using Rosen Bri - **Transaction Timing**: Transfers typically take around 2 hours, but delays can occur. - **Monitor Transaction Status**: Track your transaction progress on the [Rosen events page](https://app.rosen.tech/events). - - - - - +--- ## Step-by-Step: Providing Liquidity on Uniswap @@ -91,13 +75,11 @@ Follow these steps to provide liquidity in the rsERG/ETH pool on Uniswap: ![Access Pool](5.jpg) -### Step 5: Choose the ETH/rsERG Pair -- Enter ETH in the left field and copy-paste the rsERG contract address (`0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6`) on the right side. - -![Choosing ETH/rsERG Pair](7.jpg) +### Step 5: Choose Pair +- Enter ETH in the left field and rsERG from the dropdown list next to it. +You can also [add to the rsBTC pool](https://app.uniswap.org/pools/840081), which may give BTC holders some incentive to use the bridge. -You can also [add to the rsBTC pool]( https://app.uniswap.org/pools/840081), that way it may give btc holders some incentive to use the bridge: ### Step 6: Select the Fee Tier - The rsERG/ETH pair has a 1% fee pool, which is usually selected by default. @@ -132,6 +114,27 @@ Congratulations! You’ve successfully added assets to the rsERG/ETH liquidity p --- +## Best Practices for Yield Farming and Liquidity Provision on Ergo + +- **Risk Management**: Understand the risks involved, including impermanent loss in liquidity pools and the volatility of the crypto market. +- **Research**: Stay informed about the latest Ergo DeFi projects and yield farming opportunities. Joining the Ergo community on forums and social media can provide valuable insights. +- **Diversify**: Spread your investments across different pools and farming opportunities to mitigate risk. +- **Monitor Performance**: Regularly check the performance of your investments. Be prepared to adjust your strategy in response to changing market conditions or new opportunities. + +--- + +## Leveraging SigmaUSD and SigmaRSV for Yield on Ergo + +SigmaUSD, along with SigmaRSV, offers varied strategies for yield farming within the Ergo ecosystem. These options range from direct minting to engaging in secondary market trades, each presenting unique opportunities and considerations. + +- **Minting SigmaUSD**: You can create SigmaUSD through a process of collateralization on the Ergo blockchain. While direct minting is typically done via platforms like SigmaUSD and TokenJay, or through the Minotaur wallet, it’s important to note that SigmaUSD’s site isn’t ‘official’ but rather one of the various user-friendly interfaces for the protocol. + +- **Secondary Market Dynamics**: SigmaUSD can also be acquired from secondary markets like the Spectrum liquidity pool. Here, the price of SigmaUSD may vary from its ideal peg, primarily due to supply and demand dynamics. For instance, if SigmaUSD’s demand exceeds its supply in the pool, its price might slightly increase above $1, and vice versa. + +- **Arbitrage Opportunities**: These price variations in the secondary market can lead to arbitrage opportunities. Savvy traders might buy SigmaUSD at a lower price from the secondary market and redeem it for $1 worth of collateral or sell it at a higher price when the demand spikes, earning a profit from these price discrepancies. + +--- + ## Additional Tips and Notes - **Track Your LP Tokens**: After adding liquidity, Uniswap may prompt you to add rsERG and LP tokens to your token list. Do this so that they appear in your wallet's assets tab. @@ -147,12 +150,12 @@ This guide equips you with the knowledge to participate in rsERG/ETH liquidity p ## Resources -2. **Ethereum Token Details**: +1. **Ethereum Token Details**: - **Token Name**: rsERG - **Contract Address**: `0x6C060Ba738af39A09F3b45ac6487dFC9Ebb885f6` - **Liquidity Pool ID**: `0x85bb44d0a6f2a5844975ef19149d9c4b0bb77b7d` -3. **Cardano Token Details**: +2. **Cardano Token Details**: - **Asset ID**: `asset1a7ej28cdf078tndzcvswm5whk2jrpd0z98vlg4` - **Policy ID**: `04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb14` - **Token Explorer**: [CardanoScan](https://cardanoscan.io/token/04b95368393c821f180deee8229fbd941baaf9bd748ebcdbf7adbb147273455247) \ No newline at end of file