Skip to content
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

feat: add kintsugi basics page #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* **Kintsugi Canarynet (Kusama)**

* [Overview](kintsugi/overview.md)
* [Basics](kintsugi/basics.md)
* [Tokenomics](kintsugi/tokenomics.md)
* [Crowdloans - **Airdrop live!**](kintsugi/crowdloans.md)
* [Governance](kintsugi/governance.md)
Expand Down
55 changes: 55 additions & 0 deletions docs/kintsugi/basics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## Address Format

Kintsugi uses the Substrate SS58 address format as [described here](https://wiki.polkadot.network/docs/learn-accounts).

- Polkadot addresses **always start with** the number **1**.
- Kusama addresses always start with a capital letter like **C, D, F, G, H, J**.
- Generic Substrate addresses **always start with** the number **5**.
- Kintsugi addresses **always start with** the value **a3**.
- Interlay addresses **always start with** the value **wd**.

## Transaction Fees

Resources such as computation and storage are limited, transaction fees are used to prevent users from over-consuming them. As in [Polkadot](https://wiki.polkadot.network/docs/learn-transaction-fees), Kintsugi uses a weight-based fee model that charges the user prior to execution. These fees are paid in $KINT based on the complexity of the interaction.

There are three parameters to consider in the calculation of a transaction fee:

- The per-byte fee (also known as the "length fee").
- The weight fee.
- A tip (optional).

In the following snippet we have included some rough code to estimate the inclusion fee for an encoded extrinsic.

```rust
fn compute_fee<T: pallet_transaction_payment::Config>(encoded_xt: Bytes) -> Balance {
let unchecked_xt: Block::Extrinsic = Decode::decode(&mut &*encoded_xt).unwrap();
let dispatch_info = <Extrinsic as GetDispatchInfo>::get_dispatch_info(&unchecked_xt);

let base_fee = T::ExtrinsicBaseWeight::get();
let len_fee = T::TransactionByteFee::get() * encoded_xt.len();

let unadjusted_weight_fee = min(dispatch_info.weight, T::BlockWeights::get().max_block);
let multiplier = pallet_transaction_payment::Pallet::<T>::next_fee_multiplier();
let adjusted_weight_fee = multiplier * unadjusted_weight_fee;

let inclusion_fee = base_fee + len_fee + adjusted_weight_fee;
return inclusion_fee;
}
```

It is also possible to use the `payment.queryFeeDetails(encoded_xt)` RPC to calculate this dynamically.

Weights are 1:1 with $KINT which means that an extrinsic marked with `#[pallet::weight(100000000)]` will cost at least 0.0001 $KINT in addition to the base and length fees.

Tips are optional and can be added atop the inclusion fee to increase priority.

### Fee Estimates

The following are rough fee estimates measured on the `standalone` node:

- **Kintsugi**
- **tokens.transfer**: 0.00073 KINT
- **vaultRegistry.registerVault**: 0.0015 KINT
- **issue.requestIssue**: 0.0014 KINT

?> Real transactions will be charged on other factors including network congestion.