Learn ErgoScript by Example

Translation temporarily unavailable. Showing original English.
Guy Brandon

12 ottobre 2020

The new resources provide a powerful but simple way to learn UTXO-based smart contracts.

Since its mainnet launch in July 2019, Ergo has steadily been building out both its core tech and its dapps ecosystem, with several unique developments in both. Ergo’s Sigma Protocols enable safe, customisable zero-knowledge proofs, which underpin such applications as ErgoMixer and the ZKTreasury. And there’s lots more to come!

To date, though, Ergo hasn’t been the most user-friendly ecosystem. It’s been far better suited to developers and the tech-savvy. With key functionality now complete, that’s starting to change as the priority shifts towards bringing in users and developers. The integration of Ergo in Yoroi, a major lite wallet for Cardano developed by Emurgo, is a critical step for users; Yoroi will ultimately serve as a portal for Ergo dApps, acting a lot like MetaMask.

Ergo by Example and Ergo Playground

Ergo’s broad functionality yet safe and simple approach to smart contracts makes it a great tool for developers. To make it more accessible to the dev community, we’re launching ErgoScript by Example: a set of resources that enables users to jump in and start writing smart contracts on the platform. We believe there’s nothing like it anywhere else on the web. This is the go-to site for learning about smart contracts based on the extended UTXO model.

Ergo by Example is a repo on GitHub. It’s similar in format to other examples you may have seen for various programming languages. As the name implies, it’s designed to teach by example, taking smart contract use cases and unpacking how they work so anyone can write their own. It’s suitable for almost any level of expertise.

We’re also announcing Ergo Playground, which is linked from the examples you’ll find on GitHub. This is a powerful yet easy-to-use developer-focused environment with a text-based approach. It provides a full Ergo development environment based on Scastie, which is Scala-based, like ErgoScript. You can write code, share it as a URL at any moment, ask for feedback, and collaborate with others while writing your smart contracts seamlessly.

Example #1: Pin Lock Contract

We’ve uploaded the first example to GitHub: a Pin Lock smart contract. This application enables a user to lock ERG in a contract using a pin number. The way it works is pretty simple: the pin is hashed and stored on-chain, and the hash can then be used to prove a pin entered at a later date is valid, upon which the ERG can be moved.

This smart contract is not secure, for several reasons, so it’s not suitable for use in a real application. But it’s a good introductory example of the kind of things that are possible. ErgoScript is relatively simple to use, but very powerful. That’s well illustrated here: the code for the Pin Lock smart contract is just one line!

This video by Robert Kornacki offers a walkthrough of how Ergo’s smart contracts work, and how this particular contract works. One of the great things about the Ergo Playground is that it has no GUI, but does provide the ability to test complex scenarios easily. The remainder of the code in this example simulates the Ergo blockchain to test the contract without actually needing to engage with the network – making it faster, safer and more convenient.

We’ll continue uploading more going forward and the community is welcome to contribute to ErgoScript by Example with their own examples as well. Check it out, and get to know the #1 way to write extended-UTXO smart contracts and move them on-chain!

Share post

Ergo Infrastructure DAO: Decentralizzare la Spina Dorsale dell'Ecosistema Ergo

Ergo Infrastructure DAO: Decentralizzare la Spina Dorsale dell'Ecosistema Ergo

La missione di Ergo è sempre stata radicata nella decentralizzazione, non solo a livello di consenso, ma in tutto lo stack.

Ergo Platform

13 agosto 2025

Mew Finance: Un Toolkit DeFi Giocoso per l'Ecosistema Ergo

Mew Finance: Un Toolkit DeFi Giocoso per l'Ecosistema Ergo

Mew Finance è una suite di applicazioni decentralizzate sulla Blockchain Ergo.

Ergo Platform

12 agosto 2025

Lithos: Decentralizzare il Mining con Pool On-Chain

Lithos: Decentralizzare il Mining con Pool On-Chain

Lithos è un nuovo protocollo progettato per ristrutturare il funzionamento delle pool di mining spostandole on-chain, dando ai min.

Ergo Platform

24 luglio 2025

Sigma 6.0: Un Ergo più Intelligente e Flessibile

Sigma 6.0: Un Ergo più Intelligente e Flessibile

Sigma 6.0 è un importante aggiornamento proposto per la blockchain Ergo.

Ergo Platform

23 luglio 2025

Plasmare il Futuro di Rosen: Una Chiamata della Comunità su Cinque Proposte Chiave del Tesoro

Plasmare il Futuro di Rosen: Una Chiamata della Comunità su Cinque Proposte Chiave del Tesoro

Il co-fondatore di Rosen, Armeanio, ha presentato cinque nuove proposte al Tesoro di Rosen.

Ergo Platform

9 luglio 2025

L'Extended UTXO di Ergo e l'Ascesa dell'Intelligenza Economica Artificiale

L'Extended UTXO di Ergo e l'Ascesa dell'Intelligenza Economica Artificiale

Una Visione Pratica per Agenti Economici Autonomi Gli agenti economici autonomi sulla blockchain di Ergo svolgono un lavoro utile.

Ergo Platform

12 maggio 2025

ErgoHACK X: Intelligenza Artificiale sulla Blockchain di Ergo

ErgoHACK X: Intelligenza Artificiale sulla Blockchain di Ergo

Celebrare un Decennio di Innovazione Decentralizzata Unisciti al decimo anniversario di ErgoHACK e sii in prima linea nella rivolu.

Ergo Platform

10 aprile 2025

I partecipanti all'Hackaton V: mining and minting

I partecipanti all'Hackaton V: mining and minting

La registrazione per "ErgoHack V: Mining and Minting" è ufficialmente chiusa ed è tempo di esplorare ciò che i partecipanti hanno .

Ergo Platform

11 ottobre 2022

EIP37 Hardfork

EIP37 Hardfork

Dopo il merge di Ethereum, l'industria del mining di criptovalute ha assistito a un impressionante riorientamento del potere di ha.

Ergo Platform

3 ottobre 2022

ErgoHack V: incontra i nostri giudici

ErgoHack V: incontra i nostri giudici

Con le iscrizioni ora aperte, ErgoHack V si sta avvicinando rapidamente.

Ergo Platform

25 settembre 2022

Ergo: Dopo il merge di Ethereum

Ergo: Dopo il merge di Ethereum

Una discussione per la comunità mineraria Sono state un paio di settimane vorticose per l'industria del mining di criptovalute.

Ergo Platform

25 settembre 2022

La tabella di marcia di Ergo: cosa succederà. Parte 1

La tabella di marcia di Ergo: cosa succederà. Parte 1

Dal lancio sulla rete principale di Ergo il 1 luglio 2019, la blockchain ha raggiunto molti traguardi importanti.

Ergo Platform

24 settembre 2022

I premi di ErgoHack V

I premi di ErgoHack V

Con la fusione di Ethereum, stiamo assistendo a un cambiamento sismico nel panorama degli hashrate per le blockchain Proof of Work.

Ergo platform

18 settembre 2022

EIP-0028 di Ergo: ErgoAuth

EIP-0028 di Ergo: ErgoAuth

Quando si parla di blockchain, è importante ricordare che i wallet sono completamente anonimi.

Ergoplatform

4 settembre 2022

The Ergo Manifesto

The Ergo Manifesto

Il Manifesto Ergo desidera educare e offrire una panoramica di ciò che la tecnologia blockchain può raggiungere.

Ergo Foundation

3 settembre 2022

Ergo e il meccanismo di consenso di Autolykos: parte I

Ergo e il meccanismo di consenso di Autolykos: parte I

Quello che segue è un'analisi tecnica approfondita del meccanismo di consenso di Ergo, Autolykos.

Ergo Platform

28 agosto 2022

Ergo e il meccanismo di consenso di Autolykos: parte II

Ergo e il meccanismo di consenso di Autolykos: parte II

La scorsa settimana abbiamo introdotto un'analisi approfondita del meccanismo di consenso Autolykos di Ergo.

Ergo Platform

28 agosto 2022

Come acquistare Ergo da Kucoin

Come acquistare Ergo da Kucoin

Tutti gli aspetti di questo articolo non sono consigli finanziari. Ricontrolla tutte le informazioni fornite da altre fonti.

Ergoplatform

7 agosto 2022

Ethereum Mining Community e GPU Miners: il caso di Ergo dopo la fusione

Ethereum Mining Community e GPU Miners: il caso di Ergo dopo la fusione

Un cambiamento epocale in arrivo nel campo delle blockchain minabili Il panorama del mining di criptovalute Proof of Work sta per.

Ergoplatform

7 agosto 2022

Ergo: una risposta ai fallimenti della teoria monetaria moderna

Ergo: una risposta ai fallimenti della teoria monetaria moderna

Nel 2008, un gruppo o una persona sconosciuta ha rilasciato una riserva di valore peer-to-peer e l’ha chiamata Bitcoin.

Ergo platform

9 febbraio 2022

E' nata Ergoitaly.it

E' nata Ergoitaly.it

La prima community ufficiale Ergo in Italia Ergo è nato l'8 aprile 2019. Alle 20:41.

ErGonario

27 gennaio 2022