This repository was archived by the owner on Feb 18, 2025. It is now read-only.
Draft
Conversation
muXxer
suggested changes
Oct 26, 2023
| The current `dust protection` in `chrysalis-pt2` is only an intermediate solution to prevent attacks or misbehavior that could bloat the ledger database. The design has several drawbacks, e.g. it does not scale, relies on a total ordering of the tangle and it is rather complicated to use from a user point of view. | ||
|
|
||
| This document describes a new `dust protection` concept, called `storage deposit`, which solves the mentioned drawbacks and creates a monetary incentive to keep the ledger state small. It focuses on the underlying problem, the increase in database size, instead of artificially limiting the number of UTXOs. This is achieved by enforcing a minimum IOTA coin deposit in every output based on the actually used disc space of the output itself. | ||
| This document describes a new `dust protection` concept, called `storage deposit`, which solves the mentioned drawbacks and creates a monetary incentive to keep the ledger state small. It focuses on the underlying problem, the increase in database size, instead of artificially limiting the number of UTXOs. This is achieved by enforcing a minimum micros deposit in every output based on the actually used disc space of the output itself. |
Contributor
There was a problem hiding this comment.
Why that change here? It's all still IOTA coins
| ## Motivation | ||
|
|
||
| In a distributed ledger network, every participant, a so-called node, needs to keep track of the current ledger state. Since `chrysalis-pt2`, the IOTA ledger state is based on the UTXO model, where every node keeps track of all the currently unspent outputs. Without `dust protection`, even outputs containing only one single IOTA coin are valid and therefore stored in the database. | ||
| In a distributed ledger network, every participant, a so-called node, needs to keep track of the current ledger state. Since `chrysalis-pt2`, the IOTA ledger state is based on the UTXO model, where every node keeps track of all the currently unspent outputs. Without `dust protection`, even outputs containing only one single micro are valid and therefore stored in the database. |
Contributor
There was a problem hiding this comment.
Suggested change
| In a distributed ledger network, every participant, a so-called node, needs to keep track of the current ledger state. Since `chrysalis-pt2`, the IOTA ledger state is based on the UTXO model, where every node keeps track of all the currently unspent outputs. Without `dust protection`, even outputs containing only one single micro are valid and therefore stored in the database. | |
| In a distributed ledger network, every participant, a so-called node, needs to keep track of the current ledger state. Since `chrysalis-pt2`, the IOTA ledger state is based on the UTXO model, where every node keeps track of all the currently unspent outputs. Without `dust protection`, even outputs containing only one single `micro` are valid and therefore stored in the database. |
| Blocks including payloads, even transaction payloads, are considered to be pruned by the nodes, but unspent transaction outputs must be kept until they are spent. Therefore the `dust protection` is based on the unspent outputs only. | ||
|
|
||
| **Every output created by a transaction needs to have at least a minimum amount of IOTA coins deposited in the output itself, otherwise the output is syntactically invalid.** | ||
| **Every output created by a transaction needs to have at least a minimum amount of micros deposited in the output itself, otherwise the output is syntactically invalid.** |
Contributor
There was a problem hiding this comment.
Why that change here? It's all still IOTA coins
| The proposed solution has several advantages over the former solution. | ||
|
|
||
| First of all, the database size is limited to an absolute maximum size. Since the total supply of IOTA coins stays constant, also the maximum amount of `v_bytes` that can ever be written to the database remains constant. | ||
| First of all, the database size is limited to an absolute maximum size. Since the total supply of micros stays constant, also the maximum amount of `v_bytes` that can ever be written to the database remains constant. |
Contributor
There was a problem hiding this comment.
Why that change here? It's all still IOTA coins
| ### Drawbacks | ||
|
|
||
| This solution prevents seamless microtransactions, which are a unique selling point for IOTA, because the issuer of the transaction always needs to deposit `min_deposit_of_output` IOTA coins in the output created by the transaction. This minimum deposit will have a higher value than the microtransaction itself, which basically makes microtransactions impossible. Two different solutions to circumvent this obstacle are introduced [here](#Microtransactions). | ||
| This solution prevents seamless microtransactions, which are a unique selling point for IOTA, because the issuer of the transaction always needs to deposit `min_deposit_of_output` micros in the output created by the transaction. This minimum deposit will have a higher value than the microtransaction itself, which basically makes microtransactions impossible. Two different solutions to circumvent this obstacle are introduced [here](#Microtransactions). |
Contributor
There was a problem hiding this comment.
Suggested change
| This solution prevents seamless microtransactions, which are a unique selling point for IOTA, because the issuer of the transaction always needs to deposit `min_deposit_of_output` micros in the output created by the transaction. This minimum deposit will have a higher value than the microtransaction itself, which basically makes microtransactions impossible. Two different solutions to circumvent this obstacle are introduced [here](#Microtransactions). | |
| This solution prevents seamless microtransactions, which are a unique selling point for IOTA, because the issuer of the transaction always needs to deposit `min_deposit_of_output` `micros` in the output created by the transaction. This minimum deposit will have a higher value than the microtransaction itself, which basically makes microtransactions impossible. Two different solutions to circumvent this obstacle are introduced [here](#Microtransactions). |
| ### Byte cost calculations | ||
|
|
||
| To limit the maximum database size, the total IOTA supply needs to be divided by the target database size in bytes to get the worst case scenario regarding the byte costs. | ||
| To limit the maximum database size, the total micros supply needs to be divided by the target database size in bytes to get the worst case scenario regarding the byte costs. |
Contributor
There was a problem hiding this comment.
Why that change here? We are still talking about the IOTA supply.
| To limit the maximum database size, the total micros supply needs to be divided by the target database size in bytes to get the worst case scenario regarding the byte costs. | ||
|
|
||
| However, in this scenario no outputs hold more IOTA coins than required for the `dust protection`. This does not represent the real distribution of funds over the UTXOs. We could assume that these output amounts follow Zipf's law. Unfortunately, fitting a Zipf distribution to the current ledger state will not match the future distribution of the funds for several reasons: | ||
| However, in this scenario no outputs hold more micros than required for the `dust protection`. This does not represent the real distribution of funds over the UTXOs. We could assume that these output amounts follow Zipf's law. Unfortunately, fitting a Zipf distribution to the current ledger state will not match the future distribution of the funds for several reasons: |
Contributor
There was a problem hiding this comment.
Why that change here? It's all still IOTA coins
| - Fittings for other DLT projects do not match because there are transaction fees in place, which decrease the amount of dust outputs in the distribution. | ||
|
|
||
| Another possibility would be to estimate how much percentage of the database will be used for outputs with minimum required deposit (`fund sparsitiy percentage`) in the future. The remaining IOTA coins can be ignored in that case to simplify the calculation. Since a fund sparsity percentage of less than 20% would already be bad for other upcoming protocol features like the mana calculation, we could take this value for our calculation instead of the worst case. | ||
| Another possibility would be to estimate how much percentage of the database will be used for outputs with minimum required deposit (`fund sparsitiy percentage`) in the future. The remaining micros can be ignored in that case to simplify the calculation. Since a fund sparsity percentage of less than 20% would already be bad for other upcoming protocol features like the mana calculation, we could take this value for our calculation instead of the worst case. |
Contributor
There was a problem hiding this comment.
Why that change here? It's all still IOTA coins
|  | ||
|
|
||
| In this example, Alice sends funds to a smart contract chain on Layer 1 with an output that covers at least `min_deposit_of_output`. From this point on, Alice can send any number of off-chain requests to the smart contract chain, causing the smart contract to send microtransactions from Alice' on-chain account to Bob's on-chain account. Bob can now request his on-chain account balances to be withdrawn to his Layer 1 address. The last step can also be combined with the formerly introduced `conditional sending` mechanism, in case Bob wants to withdraw less than `min_deposit_of_output` IOTA coins or native assets. | ||
| In this example, Alice sends funds to a smart contract chain on Layer 1 with an output that covers at least `min_deposit_of_output`. From this point on, Alice can send any number of off-chain requests to the smart contract chain, causing the smart contract to send microtransactions from Alice' on-chain account to Bob's on-chain account. Bob can now request his on-chain account balances to be withdrawn to his Layer 1 address. The last step can also be combined with the formerly introduced `conditional sending` mechanism, in case Bob wants to withdraw less than `min_deposit_of_output` micros or native assets. |
Contributor
There was a problem hiding this comment.
Suggested change
| In this example, Alice sends funds to a smart contract chain on Layer 1 with an output that covers at least `min_deposit_of_output`. From this point on, Alice can send any number of off-chain requests to the smart contract chain, causing the smart contract to send microtransactions from Alice' on-chain account to Bob's on-chain account. Bob can now request his on-chain account balances to be withdrawn to his Layer 1 address. The last step can also be combined with the formerly introduced `conditional sending` mechanism, in case Bob wants to withdraw less than `min_deposit_of_output` micros or native assets. | |
| In this example, Alice sends funds to a smart contract chain on Layer 1 with an output that covers at least `min_deposit_of_output`. From this point on, Alice can send any number of off-chain requests to the smart contract chain, causing the smart contract to send microtransactions from Alice' on-chain account to Bob's on-chain account. Bob can now request his on-chain account balances to be withdrawn to his Layer 1 address. The last step can also be combined with the formerly introduced `conditional sending` mechanism, in case Bob wants to withdraw less than `min_deposit_of_output` `micros` or native assets. |
|  | ||
|
|
||
| The preceding picture shows the process of the `conditional sending` mechanism. Alice uses the `Basic Output` to send a microtransaction of 1 IOTA to Bob's `Address`. To fulfill the `min_deposit_of_output` requirement, the `Amount` is increased by `min_deposit_of_output` IOTA, which is 1 MIOTA in the above example. To prevent Bob from accessing these additional funds called the `storage deposit`, Alice adds the optional `Storage Deposit Return Unlock Condition` to the `Basic Output`. Now Bob can only consume the newly created output, if the unlocking transaction deposits the specified `Return Amount` IOTA coins, in this case 1 MIOTA, to the `Return Address` value defined by Alice. By consuming another UTXO and adding its amount to the received 1 IOTA, Bob takes care to create a valid output according to the dust protection rules. | ||
| The preceding picture shows the process of the `conditional sending` mechanism. Alice uses the `Basic Output` to send a microtransaction of 1 micro to Bob's `Address`. To fulfill the `min_deposit_of_output` requirement, the `Amount` is increased by `min_deposit_of_output` micro, which is 1 IOTA in the above example. To prevent Bob from accessing these additional funds called the `storage deposit`, Alice adds the optional `Storage Deposit Return Unlock Condition` to the `Basic Output`. Now Bob can only consume the newly created output, if the unlocking transaction deposits the specified `Return Amount` micros, in this case 1 IOTA, to the `Return Address` value defined by Alice. By consuming another UTXO and adding its amount to the received 1 micro, Bob takes care to create a valid output according to the dust protection rules. |
Contributor
There was a problem hiding this comment.
Suggested change
| The preceding picture shows the process of the `conditional sending` mechanism. Alice uses the `Basic Output` to send a microtransaction of 1 micro to Bob's `Address`. To fulfill the `min_deposit_of_output` requirement, the `Amount` is increased by `min_deposit_of_output` micro, which is 1 IOTA in the above example. To prevent Bob from accessing these additional funds called the `storage deposit`, Alice adds the optional `Storage Deposit Return Unlock Condition` to the `Basic Output`. Now Bob can only consume the newly created output, if the unlocking transaction deposits the specified `Return Amount` micros, in this case 1 IOTA, to the `Return Address` value defined by Alice. By consuming another UTXO and adding its amount to the received 1 micro, Bob takes care to create a valid output according to the dust protection rules. | |
| The preceding picture shows the process of the `conditional sending` mechanism. Alice uses the `Basic Output` to send a microtransaction of 1 `micro` to Bob's `Address`. To fulfill the `min_deposit_of_output` requirement, the `Amount` is increased by `min_deposit_of_output` `micros`, which is 1 IOTA (or 1000000 `micros`) in the above example. To prevent Bob from accessing these additional funds called the `storage deposit`, Alice adds the optional `Storage Deposit Return Unlock Condition` to the `Basic Output`. Now Bob can only consume the newly created output, if the unlocking transaction deposits the specified `Return Amount` `micros`, in this case 1 IOTA (or 1000000 `micros`), to the `Return Address` value defined by Alice. By consuming another UTXO and adding its amount to the received 1 `micro`, Bob takes care to create a valid output according to the dust protection rules. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce micro denomination
TODO:
@muXxer do you by any chance still have the originals somewhere? The images only contain old chrysalis versions of the image 😅