generated from readthedocs/tutorial-template
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improving tokens/mining/wallet sections
- Loading branch information
1 parent
eb6170e
commit 9fd637a
Showing
11 changed files
with
149 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,69 @@ | ||
--- | ||
tags: | ||
- Data Model | ||
- Storage Rent | ||
- Registers | ||
--- | ||
|
||
# Ergo Tokens | ||
# Tokens on Ergo | ||
|
||
Ergo tokens are incredibly versatile and can represent a wide range of assets, including shares, complementary currency units, and various tangible or intangible items. The infrastructure of Ergo is designed to seamlessly handle the representation and transfer of these diverse assets, integrating them into the blockchain as *first-class citizens*. | ||
Ergo's native tokens are incredibly versatile and can represent a wide range of assets, including shares, complementary currency units, and various tangible or intangible items. The infrastructure of Ergo is designed to seamlessly handle the representation and transfer of these diverse assets, integrating them into the blockchain as *first-class citizens*. | ||
|
||
It is crucial to understand that ERG, the native token of Ergo, possesses two unique characteristics: | ||
|
||
- ERGs are non-destructible; the total input and output amounts in any transaction must be equal. | ||
//// details | What are **first-class citizens**? | ||
{type: info, open: false} | ||
This means that tokens in Ergo are not just metadata attached to transactions, but they are deeply integrated into the Ergo protocol. They can be manipulated and managed with the same level of support and functionality as the native Ergo token (see [EIP-0004](eip4.md)). | ||
/// details | It is crucial to understand that ERG, the native token of Ergo, possesses two unique characteristics: | ||
{type: warning, open: false} | ||
- ERGs **cannot be burned**; the total input and output amounts in any transaction must be equal. | ||
- [Storage rent](rent.md) can only be paid in ERGs. | ||
/// | ||
//// | ||
|
||
/// details | How do I mint a token? | ||
{type: info, open: false} | ||
- Use [ergoutils](https://ergoutils.org/#/token) to mint a token directly from your web browser. ([Video Tutorial](https://www.youtube.com/watch?v=I3R6_PceM1k) | ||
)) | ||
- For programmatic token minting, refer to this guide: [Minting a Token with Fleet SDK](https://fleet-sdk.github.io/docs/transaction-building#step-4-2-mint-a-token) | ||
/// | ||
|
||
## Token Storage | ||
|
||
- Tokens are stored in a special [register](registers.md) `R2` of a [box](box.md) in the form of (tokenId -> amount) pairs. | ||
- A single box can hold **up to 255 secondary tokens**. | ||
|
||
|
||
## Register Usage | ||
|
||
The Ergo reference implementation wallet uses specific [registers](registers.md) in a unique way, although the protocol doesn't enforce this: | ||
|
||
* `R4` - verbose name | ||
* `R5` - description | ||
* `R6` - number of decimal places | ||
* Additional registers (`R7`, `R8`, `R9`) can store asset-specific information | ||
|
||
|
||
## Limitations | ||
|
||
There are certain indirect limitations to consider: | ||
|
||
- The size of a box should not exceed 4 kilobytes. | ||
- The presence of tokens increases the computational cost of the transaction. | ||
|
||
## Asset Creation | ||
|
||
An exception to the rule of weak preservation *(the total amount in inputs should be no less than the total amount in outputs)* is that a transaction can generate tokens from thin air in its outputs if the asset identifier matches the identifier of the transaction's first input box. Given that the box identifier is cryptographically unique, it's impossible to have a second asset with the same identifier, assuming the hash function used is collision-resistant (which it indeed is). This rule also implies that **only one new asset can be created per transaction.** | ||
|
||
## Examples | ||
|
||
- [How to mint a token with Fleet SDK](https://fleet-sdk.github.io/docs/transaction-building#step-4-2-mint-a-token) | ||
- Creating a [perpetual token](perpetual.md) (designed to exist indefinitely, unless it is removed by garbage collection.) | ||
|
||
Tokens in Ergo are stored in the `R2` [register](registers.md) of a [box](box.md). Each box holds pairs of `tokenId` and `amount`. allowing for the representation of multiple tokens within a single box. A single box has the capacity to hold up to 255 secondary tokens. | ||
However, there are some indirect constraints to consider when working with tokens in Ergo: | ||
## Resources | ||
|
||
- 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. | ||
- [Token category on sigmaverse.io](https://sigmaverse.io/all-projects/?category=Tokens) | ||
- [Ergo Token Minter](https://thierrym1212.github.io/tokenminter/index.html) or [CYTI](https://thierrym1212.github.io/cyti/index.html) which uses a Use CYTI minable smart contract to choose your token ID. | ||
- [ergoutils.org](https://ergoutils.org/#/token) | ||
- [Video Tutorial](https://www.youtube.com/watch?v=I3R6_PceM1k) | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
# Creating an NFT | ||
|
||
> The quickest way to create an NFT is to use the [resources](#Resources) listed at the bottom of this page. | ||
/// details | How do I mint a NFT? | ||
{type: tip, open: true} | ||
The quickest way to create an NFT is to follow [this visual guide](https://ergoplatform.org/en/blog/2022-03-08-how-to-minting-a-non-fungible-token-nft-on-the-ergo-blockchain/) that'll show you how to mint your NFT through [ergoauctions.org](https://ergoauctions.org/) | ||
/// | ||
|
||
## Standard | ||
|
||
The standard for artwork issuance on Ergo is [EIP-0024: Artwork Contract](eip24.md). This standard outlines the process of issuing NFTs, including the two different design versions, [V1 and V2](v1v2.md), and the importance of artist identity. V2 offers more flexibility and features, such as handling multiple royalty recipients, detailed artwork traits, and additional information. | ||
|
||
|
||
## Creating an NFT programmatically | ||
|
||
See [this page](nft-examples.md) for some simple examples that demonstrate how to programmatically mint a NFT on the Ergo Blockchain. | ||
|
||
## Standard | ||
|
||
The standard for artwork issuance on Ergo is [EIP-0024: Artwork Contract](eip24.md). This standard outlines the process of issuing NFTs, including the two different design versions, [V1 and V2](v1v2.md), and the importance of artist identity. V2 offers more flexibility and features, such as handling multiple royalty recipients, detailed artwork traits, and additional information. | ||
|
||
|
||
## Resources | ||
|
||
### Minting your NFT online | ||
|
||
- [ergoauctions.org](https://ergoauctions.org/#/auction/active?type=all) Allows NFT minting. ([HowTo](https://ergoplatform.org/en/blog/2022-03-08-how-to-minting-a-non-fungible-token-nft-on-the-ergo-blockchain/)) | ||
- [Lilium](lilium.md) seeks to create decentralised NFT minting, distribution, and sales infrastructure capable of being seamlessly integrated into business applications and programs. | ||
- [Lilium](lilium.md) is a tool for artists to mint and sell their collections. | ||
|
||
### Developer Resources | ||
|
||
- [ergpy](https://github.com/mgpai22/ergpy) has bulk-minting (with royalties!) | ||
- [ergo-nft-bulk-minter](https://github.com/mgpai22/ergo-nft-bulk-minter) | ||
- [ergonfts.org/](https://ergonfts.org/) | ||
- [ergonfts.org](https://ergonfts.org/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
# Non-Fungible Tokens on Ergo | ||
NFTs *(Non-Fungible Tokens)* are unique and indivisible blockchain tokens. They can be used to represent and prove ownership of digital products such as works of art, in-game items or characters, virtual trading cards and much, much more. Because an NFT can be used to represent ultimate ownership, they allow users to trade digital items and cryptographically guarantee provenance. | ||
|
||
- [How do I mint a NFT?](create.md) | ||
- [How do royalties work?](royalties.md) | ||
## Overview | ||
|
||
## UTXO NFTs | ||
*Non-Fungible Tokens* (NFTs) are unique and indivisible blockchain tokens. They can be used to represent and prove ownership of digital products such as works of art, in-game items or characters, virtual trading cards and much, much more. | ||
|
||
One interesting feature is that Ergo can be used to create [PoW-backed NFTs](PoW_tokens.md). For most NFTs, a user simply generates a UTXO with the token contract attached. But it’s also possible for miners to create special NFTs, where the id of the newly minted token is the id of a coinbase transaction. This has all kinds of potential use cases, but the core idea is that a miner has the opportunity to create a special NFT when they mine a block. While any number of NFTs can be created via a regular smart contract, a finite number of these PoW-backed NFTs can exist. | ||
## Frequently Asked Questions | ||
|
||
There are other applications of NFTs that use the extended UTXO model, including facilitating a new generation of complex dApps. For example, a dApp creator can generate an NFT associated with an address and smart contract. While anyone can use that contract, and even create a transaction using the private key of that address, the NFT owner can still maintain administrative rights or other privileges. | ||
//// details | Frequently Asked Questions | ||
{type: note, open: true} | ||
/// details | How do I mint a NFT? | ||
{type: note, open: false} | ||
Minting a NFT on Ergo is a straightforward process that can be done programmatically or using resources listed in our guide. Learn more about it [here](create.md). | ||
/// | ||
/// details | How do royalties work? | ||
{type: note, open: false} | ||
Royalties in Ergo are integrated into the minting metadata and can be accessed via smart contracts, allowing marketplaces to include royalties in their sale contracts. Find out more [here](royalties.md). | ||
/// | ||
//// | ||
|
||
## Use cases | ||
|
||
## Unforgeable identity | ||
### Unforgeable identity | ||
|
||
Let’s say you create a phenomenally successful exchange dApp, which pays a small percentage of trading fees to the owner – designated by ownership of that NFT. That token, and future revenues, can now be transferred and sold. The token can also be managed by a secondary smart contract, which could divide revenues among 100 tokens representing shareholders. The NFT could be used to update the dApp, or shut it down, if necessary – whatever conditions were coded into it. The point is that the NFT provides guaranteed, unforgeable proof of identity. | ||
|
||
|
||
|
||
### UTXO NFTs | ||
|
||
One interesting feature is that Ergo can be used to create [PoW-backed NFTs](PoW_tokens.md). For most NFTs, a user simply generates a UTXO with the token contract attached. But it’s also possible for miners to create special NFTs, where the id of the newly minted token is the id of a coinbase transaction. This has all kinds of potential use cases, but the core idea is that a miner has the opportunity to create a special NFT when they mine a block. While any number of NFTs can be created via a regular smart contract, a finite number of these PoW-backed NFTs can exist. | ||
|
||
There are other applications of NFTs that use the extended UTXO model, including facilitating a new generation of complex dApps. For example, a dApp creator can generate an NFT associated with an address and smart contract. While anyone can use that contract, and even create a transaction using the private key of that address, the NFT owner can still maintain administrative rights or other privileges. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.