-
Notifications
You must be signed in to change notification settings - Fork 82
MASP frontend sustainability fee #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,19 @@ | ||
| import { Callout } from 'nextra-theme-docs' | ||
|
|
||
| # Shielded Transfers | ||
|
|
||
| You can construct shielded transfers similarly to transparent transfers, except that rather than providing implicit addresses as the `source` and `target`, | ||
| you will need to provide a spending key and payment address, respectively. | ||
| You can construct shielded transfers similarly to transparent transfers, except | ||
| that rather than providing implicit addresses as the `source` and `target`, you | ||
| will need to provide a spending key and payment address, respectively. | ||
|
|
||
| Before building your transaction, you will want to make sure the [shielded wallet is synced](./shielded-sync.mdx). | ||
| Before building your transaction, you will want to make sure the | ||
| [shielded wallet is synced](./shielded-sync.mdx). | ||
|
|
||
| ### Constructing the Transfer | ||
|
|
||
| This example assumes you have a spending key with sufficient shielded balance, a recipient payment address, and the | ||
| public key of an implicit account with gas funds. | ||
| This example assumes you have a spending key with sufficient shielded balance, a | ||
| recipient payment address, and the public key of an implicit account with gas | ||
| funds. | ||
|
|
||
| ```rust | ||
| use namada_sdk::Namada; | ||
|
|
@@ -56,4 +61,33 @@ async fn construct_transfer(sdk: impl Namada) { | |
| Err(e) => println!("Tx error: {:?}", e) | ||
| } | ||
| } | ||
| ``` | ||
| ``` | ||
|
|
||
| ### Frontend sustainability fee | ||
|
|
||
| For transactions that move assets into or out of the shielded pool, the namada | ||
| SDK provides the possibility to charge an optional fee to support the operations | ||
| of the frontend provider. The specific transactions are: | ||
|
|
||
| - `TxShieldingTransfer` | ||
| - `TxUnshieldingTransfer` | ||
| - `TxOsmosisSwap` | ||
| - `TxIbcTransfer` | ||
| - `GenIbcShieldingTransfer` | ||
|
|
||
| <Callout type="warning"> | ||
| For fully shielded osmosis swaps (from shieleded address to shielded address), | ||
| the operator should refrain from charging a fee. | ||
|
||
| </Callout> | ||
|
|
||
| These structures provide an optional field in one of two forms: | ||
|
|
||
| ```rust | ||
| pub frontend_sus_fee: Option<(C::TransferTarget, Dec)>, | ||
| pub frontend_sus_fee: Option<(C::PaymentAddress, Dec)>, | ||
| ``` | ||
|
|
||
| where the first element of the tuple is the receiver of the fee (an address | ||
| controlled by the operator) and the second one is the fee expressed as a | ||
| percentage of the shielded/unshielded amount. This percentage will be charged on | ||
| top of the amount specified by the user. | ||
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you provide some more detail on the general flow? Are operators expected to build their own instance of Namadillo on top of some release that makes certain SDK additions? Sorry I kinda have no idea myself. I think there should be more detail on how to integrate the SDK changes into one's own hosted Namada (or let me know if this is obvious and I'm just clueless)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are instructions for the users of the SDK, so our interface team building Namadillo or other teams building alternatives to it. For operators of Namadillo these are not the right docs and I can't help with them as I don't know how this feature has been integrated into it