-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from scott-klaytn/reorganize-learn-section
Reorganize learn section
- Loading branch information
Showing
30 changed files
with
393 additions
and
291 deletions.
There are no files selected for viewing
55 changes: 25 additions & 30 deletions
55
docs/learn/transactions/basic.md → docs/build/transactions/basic.md
Large diffs are not rendered by default.
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
66 changes: 33 additions & 33 deletions
66
docs/learn/transactions/fee-delegation.md → docs/build/transactions/fee-delegation.md
Large diffs are not rendered by default.
Oops, something went wrong.
66 changes: 33 additions & 33 deletions
66
...rn/transactions/partial-fee-delegation.md → ...ld/transactions/partial-fee-delegation.md
Large diffs are not rendered by default.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Implementing Transactions | ||
|
||
This guide provides a comprehensive overview of implementing transactions on the Kaia network, covering various transaction types, encoding, signing, and network interaction. | ||
|
||
## Kaia Transaction Components | ||
|
||
Kaia transactions generally include the following components: | ||
|
||
| Components | Description | | ||
| :--- | :--- | | ||
| `from` | The sender's address. Required for most Kaia transaction types due to the decoupling of key pairs and addresses. | | ||
| `to` | The account address that will receive the transferred value. | | ||
| `value` | The amount of KAIA in `kei` to be transferred. | | ||
| `input` | Data attached to the transaction, used for transaction execution. | | ||
| `v`, `r`, `s` | The cryptographic signature generated by the sender to let the receiver obtain the sender's address. | | ||
| `nonce` | A value used to uniquely identify a sender’s transaction. If two transactions with the same nonce are generated by a sender, only one is executed. | | ||
| `gas` | The maximum amount of transaction fee the transaction is allowed to use. | | ||
| `gasPrice` | A multiplier to get how much the sender will pay in tokens. The amount of tokens the sender will pay is calculated via `gas` \* `gasPrice`. For example, the sender will pay 10 KAIA for a transaction fee if gas is 10 and gasPrice is 10^18. Unit of KAIA is described [here](../../learn/token-economics/kaia-native-token.md#units-of-kaia). | | ||
|
||
## Signature Validation | ||
|
||
Because Kaia decouples key pairs from addresses, signature validation differs from typical blockchains. The `from` field is crucial, as it identifies the sender. The [AccountKey](../../learn/accounts.md#account-key) associated with the `from` address is used to validate the signature. | ||
|
||
## Fee Delegation and SenderTxHash | ||
|
||
Kaia's fee delegation feature allows a third party to pay transaction fees. This requires two signatures – one from the sender and one from the fee payer. The `SenderTxHash` is crucial for tracking fee-delegated transactions. It's a hash of the transaction *without* the fee payer's information, allowing the sender to track the transaction before the fee payer signs it. The sender can use the `SenderTxHash` to retrieve the complete transaction via the [kaia_getTransactionBySenderTxHash](../../references/json-rpc/kaia/get-transaction-by-sender-tx-hash) RPC method. | ||
|
||
## Transaction Types | ||
|
||
While typical Blockchain platforms provide a single transaction type, Kaia provides multiple transaction types that empower transactions with new capabilities and optimizations for memory footprint and performance. The following table provides an overview of the transaction types available on Kaia: | ||
|
||
| | Basic | Fee Delegation | Partial Fee Delegation | | ||
| :--- | :--- | :--- | :--- | | ||
| Legacy | [TxTypeLegacyTransaction](./basic.md#txtypelegacytransaction) | N/A | N/A | | ||
| ValueTransfer | [TxTypeValueTransfer](./basic.md#txtypevaluetransfer) | [TxTypeFeeDelegatedValueTransfer](./fee-delegation.md#txtypefeedelegatedvaluetransfer) | [TxTypeFeeDelegatedValueTransferWithRatio](./partial-fee-delegation.md#txtypefeedelegatedvaluetransferwithratio) | | ||
| ValueTransferMemo | [TxTypeValueTransferMemo](./basic.md#txtypevaluetransfermemo) | [TxTypeFeeDelegatedValueTransferMemo](./fee-delegation.md#txtypefeedelegatedvaluetransfermemo) | [TxTypeFeeDelegatedValueTransferMemoWithRatio](./partial-fee-delegation.md#txtypefeedelegatedvaluetransfermemowithratio) | | ||
| SmartContractDeploy | [TxTypeSmartContractDeploy](./basic.md#txtypesmartcontractdeploy) | [TxTypeFeeDelegatedSmartContractDeploy](./fee-delegation.md#txtypefeedelegatedsmartcontractdeploy) | [TxTypeFeeDelegatedSmartContractDeployWithRatio](./partial-fee-delegation.md#txtypefeedelegatedsmartcontractdeploywithratio) | | ||
| SmartContractExecution | [TxTypeSmartContractExecution](./basic.md#txtypesmartcontractexecution) | [TxTypeFeeDelegatedSmartContractExecution](./fee-delegation.md#txtypefeedelegatedsmartcontractexecution) | [TxTypeFeeDelegatedSmartContractExecutionWithRatio](./partial-fee-delegation.md#txtypefeedelegatedsmartcontractexecutionwithratio) | | ||
| AccountUpdate | [TxTypeAccountUpdate](./basic.md#txtypeaccountupdate) | [TxTypeFeeDelegatedAccountUpdate](./fee-delegation.md#txtypefeedelegatedaccountupdate) | [TxTypeFeeDelegatedAccountUpdateWithRatio](./partial-fee-delegation.md#txtypefeedelegatedaccountupdatewithratio) | | ||
| Cancel | [TxTypeCancel](./basic.md#txtypecancel) | [TxTypeFeeDelegatedCancel](./fee-delegation.md#txtypefeedelegatedcancel) | [TxTypeFeeDelegatedCancelWithRatio](./partial-fee-delegation.md#txtypefeedelegatedcancelwithratio) | | ||
| ChainDataAnchoring | [TxTypeChainDataAnchoring](./basic.md#txtypechaindataanchoring) | [TxTypeFeeDelegatedChainDataAnchoring](./fee-delegation.md#txtypefeedelegatedchaindataanchoring) | [TxTypeFeeDelegatedChainDataAnchoringWithRatio](./partial-fee-delegation.md#txtypefeedelegatedchaindataanchoringwithratio)| | ||
|
||
## Implementation Details | ||
|
||
* **RLP Encoding:** Transactions are serialized using Recursive Length Prefix (RLP) encoding before submission. | ||
* **Signatures:** Transactions are signed using [Specify signature algorithm, e.g., ECDSA] to ensure authenticity. | ||
* **Examples and RPC Outputs:** This section will provide practical examples and expected RPC outputs for each transaction type. (Note: `TxTypeValueTransfer` sends KAIA without any additional data, while `TxTypeValueTransferMemo` allows for including a short memo field along with the transfer.) | ||
|
||
By understanding these components and implementation details, developers can effectively build applications on the Kaia network. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
# Computation | ||
# Transaction Execution | ||
|
||
```mdx-code-block | ||
import DocCardList from '@theme/DocCardList'; | ||
This section provides a comprehensive guide to how transactions are processed, executed, and analyzed on the Kaia blockchain. Understanding these processes is critical for developers building applications on Kaia, as it directly impacts performance, cost, and debugging strategies. | ||
|
||
<DocCardList /> | ||
``` | ||
- [Execution Model](./execution-model.md) details the complete lifecycle of a Kaia transaction, from its initial submission to its final inclusion in a block. Learn how transactions are validated by Consensus Nodes (CNs), the process of block creation, and the role of the BFT consensus mechanism in finalizing transactions. This includes details on Kaia's enhanced randomness for block proposer selection, as well as crucial restrictions on both transaction execution and smart contract deployment. Understanding these limitations is essential for avoiding unexpected transaction failures. | ||
|
||
- [Computation Cost](./computation-cost.md) explains the mechanics of transaction costs on the Kaia network. Dive into the gas mechanism, including how gas pricing is determined, the network's computation cost limit, and the gas costs associated with specific EVM operations. This section also details the additional gas costs incurred for contract creation based on initcode length, introduced with the Shanghai hardfork, enabling developers to accurately estimate and manage transaction expenses. | ||
|
||
- [Debug Tracing](debug-tracing.md) explores the tools and techniques available for monitoring and debugging transaction execution. Gain insights into how to identify and resolve issues within your Kaia applications, ensuring smooth operation and efficient resource utilization. This includes information on how to trace the execution flow of transactions and pinpoint potential bottlenecks or errors. |
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.