From a2e5eb97b2cd7c359c9e29e96cc3452718782e47 Mon Sep 17 00:00:00 2001 From: M Glasgow Date: Thu, 26 Oct 2023 13:36:50 +0100 Subject: [PATCH] scala --- docs/dev/lang/scala.md | 17 +++++++++++++++++ docs/dev/protocol/eutxo/ergo_vs_cardano.md | 13 +++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/dev/lang/scala.md b/docs/dev/lang/scala.md index f6b224d0..c502a1a9 100644 --- a/docs/dev/lang/scala.md +++ b/docs/dev/lang/scala.md @@ -9,6 +9,23 @@ Ergo's primary language is [Scala](https://www.udemy.com/course/rock-the-jvm-sca If you're new to Scala development with Ergo, the [Ergo Scala Skeleton App](https://github.com/dav009/ergo-scala-skeleton-app) is a great place to start. +## Why Scala? + +### Why Scala? + +Ergo's primary language is Scala. Similarly, the scripting language used by Ergo, ErgoScript, is also based on Scala, but the off-chain code can be written in any language. Developers have access to a growing selection of tools and Software Development Kits (SDKs) for JVM, Rust and JS/TS. + + +Scala has several features that set it apart from other JVM languages. + +- Firstly, it is truly cross-platform, as the same code can run on JVM and JavaScript natively. This is a feature that is not found in many other languages. +- Additionally, key ecosystem libraries for Scala support all platforms, and the popularity of Scala.js and Scala-native is increasing. +- Another advantage of Scala is its conciseness, both in terms of syntax and conceptual level. +- Despite its high-level nature, Scala can also be more efficient than similar Java code due to its ability to use primitive unboxed types, and the ability of the Scala compiler to perform code specialization. +- Furthermore, Scala is multi-paradigm, allowing for the combination of OOP, FP, and LP, making it suitable for a wide range of domains. +- Lastly, Scala3 brings even more powerful features such as metaprogramming and tools for zero-cost abstractions. + + ## Learning Resources Here are some tutorials, guides, and explanations to help you get started with Scala development on Ergo: diff --git a/docs/dev/protocol/eutxo/ergo_vs_cardano.md b/docs/dev/protocol/eutxo/ergo_vs_cardano.md index 4b38ead9..dc3fbcad 100644 --- a/docs/dev/protocol/eutxo/ergo_vs_cardano.md +++ b/docs/dev/protocol/eutxo/ergo_vs_cardano.md @@ -31,7 +31,7 @@ Both Ergo and Cardano's models support non-fungible assets and complex types of Minting, the process of creating new tokens on a blockchain network, is a critical feature that enables the creation of native assets, such as NFTs. Both Ergo and Cardano offer native asset support through their respective eUTXO models, but their approach to minting and issuing tokens varies. -### Ergo's Minting Policy +### Native Tokens on Ergo Ergo's token issuance is standardized through [EIP4](eip4.md). @@ -51,7 +51,6 @@ Each box can hold multiple tokens, represented as pairs of `tokenId` and `amount - The size of a box cannot exceed 4 kilobytes, ensuring efficient storage and processing of token-related data. - The presence of tokens increases the computational cost of a transaction, as additional calculations are required to handle the token-related operations. - Ergo's NFT minting policy is defined by the [Ergo Improvement Proposal (EIP) 0024](eip24.md), which offers two design versions for artwork issuance: V1 and V2. -### Cardano's Minting Policy +### Native Tokens on Cardano + +Native tokens on Cardano allow for the transacting of multiple assets, including ada and custom tokens, without the need for smart contracts. This feature extends the accounting infrastructure to accommodate various assets. Native tokens are different from non-native tokens that require smart contracts. Assets on Cardano are uniquely identified by an asset ID, consisting of a policy ID and asset name, and tokens with the same asset ID are fungible. Ada is the principal currency for fees and rewards, while native tokens can be used for payments and transactions. + +Cardano's minting policy uniquely identifies each native asset with a permanent policy ID, which originates from the policy script. The policy script further defines other attributes, such as the asset's name and amount/value. Since asset names are not unique, Cardano NFTs must be identified by the policy ID, which can be publicly available to distinguish fraudulent/duplicate NFTs from the original tokens. + + +The minimum ada value is required to transfer native tokens between addresses. Token bundles organize tokens and are the standard way to represent assets on Cardano. Minting policies specify the rules for creating and burning tokens, and each asset has a permanent association with a minting policy. The native token lifecycle involves minting, issuing, using, redeeming, and burning tokens, with various actors involved, such as asset controllers, token issuers, and token holders. Tokens can also be reissued by token holders acting as reissuers for trading or liquidity purposes. -Cardano's minting policy uniquely identifies each native asset with a permanent policy ID, which originates from the policy script. The policy script further defines other attributes, such as the asset's name and amount/value. Since asset names are not unique, Cardano NFTs must be identified by the policy ID, which can be publicly available to distinguish fraudulent/duplicate NFTs from the original tokens. Cardano's minting policy provides a straightforward approach to token issuance and is suitable for assets with fewer attributes. It ensures that NFTs are unique and easily identifiable through the policy ID.