이 페이지는 영어로 된 기계 번역을 사용하므로 오류나 불명확한 언어가 포함될 수 있습니다. 가장 정확한 정보는 영어 원문을 참조하시기 바랍니다. 잦은 업데이트로 인해 일부 콘텐츠는 원래 영어로 되어 있을 수 있습니다. Crowdin에서 이 페이지의 번역을 개선하는 데 동참하여 도움을 주세요. (Crowdin translation page, Contributing guide)
Partial Fee Delegation
TxTypeFeeDelegatedValueTransferWithRatio
TxTypeFeeDelegatedValueTransferWithRatio is used when a user wants to send KAIA. As Kaia provides multiple transaction types to make each transaction type serve a single purpose, TxTypeFeeDelegatedValueTransferWithRatio is limited to send KAIA to an externally owned account. Therefore, TxTypeFeeDelegatedValueTransferWithRatio is accepted only if to
is an externally owned account. To transfer KAIA to a smart contract account, use TxTypeFeeDelegatedSmartContractExecutionWithRatio instead. The following changes will be made by this transaction type.
- The fee payer's balance decreases by the given ratio of the transaction fee.
- The sender's balance decreases by the remaining transaction fee. e.g., If the
feeRatio
is 30, 30% of the fee will be paid by the fee payer, and the remaining 70% of the fee will be paid by the sender. - The sender's nonce increases by one.
value
KAIA is transferred from the sender to the recipient.
Attributes
Attribute | Type | Description |
---|---|---|
type | uint8 (Go) | The type of TxTypeFeeDelegatedValueTransferWithRatio. This must be 0x0a. |
nonce | uint64 (Go) | 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. |
gasPrice | *big.Int (Go) | A unit price of gas in kei the sender will pay for a transaction fee. The amount of transaction fee is calculated as gas * gasPrice . For example, if the transaction consumes 10 units of gas and gasPrice is 10^18, the transaction fee will be 10 KAIA. See Unit of KAIA. |
gas | uint64 (Go) | The maximum amount of gas the transaction is allowed to use. |
to | common.Address (Go) | The account address that will receive the transferred value. |
value | *big.Int (Go) | The amount of KAIA in kei to be transferred. |
from | common.Address (Go) | The address of the sender. For more details, see Signature Validation. |
feeRatio | uint8 (Go) | Fee ratio of the fee payer. The valid range is between 1 and 99. Zero(0) is not allowed. 100 and above are not allowed as well. |
txSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | The sender's signatures. For more details, see Signature Validation. |
feePayer | common.Address (Go) | The address of the fee payer. |
feePayerSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | The fee payer's signatures. |
RLP Encoding for Signature of the Sender
To make a signature of the sender, RLP serialization should be done like the following:
SigRLP = encode([encode([type, nonce, gasPrice, gas, to, value, from, feeRatio]), chainid, 0, 0])SigHash = keccak256(SigRLP)Signature = sign(SigHash, <the sender's private key>)