收費代表團
TxTypeFeeDelegatedValueTransfer
TxTypeFeeDelegatedValueTransfer 用於用戶發送 KAIA。 由於 Kaia 提供了多種交易類型,使每種交易類型只服務於一個目的,因此 TxTypeFeeDelegatedValueTransfer 只限於將 KAIA 發送到外部擁有的賬戶。 因此,TxTypeFeeDelegatedValueTransfer 只有在 to
是外部擁有的賬戶時才會被接受。 要將 KAIA 轉入智能合約賬戶,請使用 TxTypeFeeDelegatedSmartContractExecution。 該交易類型將進行以下更改。
- 付費者的餘額會減少交易費的金額。
- 發送方的 nonce 增加一個。
value
KAIA 由發送方傳送給接收方。
屬性
屬性 | 類型 | 說明 |
---|---|---|
type | uint8(Go) | TxTypeFeeDelegatedValueTransfer 的類型。 必須為 0x09。 |
nonce | uint64 (Go) | 用於唯一標識發件人交易的值。 如果一個發送方生成了兩個具有相同 nonce 的交易,則只執行其中一個。 |
gasPrice | *big.Int ( Go) | 以 kei 為單位的氣體單價,發件人將支付交易費。 交易費的計算公式為 gas * gasPrice 。 例如,如果交易消耗了 10 單位天然氣,而 gasPrice 為 10^18,則交易費為 10 KAIA。 See Unit of KAIA. |
gas | uint64 (Go) | 交易允許使用的最大燃氣量。 |
to | common.Address(Go) | 接收轉賬金額的賬戶地址。 |
value | *big.Int ( Go) | 以 kei 為單位的 KAIA 轉賬金額。 |
from | common.Address(Go) | 發件人地址。 For more details, see Signature Validation. |
txSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 發件人簽名。 For more details, see Signature Validation. |
feePayer | common.Address(Go) | 繳費人地址。 |
feePayerSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 繳費人簽名。 |
寄件人簽名的 RLP 編碼
要對發送方進行簽名,RLP 序列化的方法如下:
SigRLP = encode([encode([type, nonce, gasPrice, gas, to, value, from]), chainid, 0, 0])SigHash = keccak256(SigRLP)Signature = sign(SigHash, <the sender's private key>)
繳費人簽名的 RLP 編碼
要製作繳費人簽名,RLP 序列化工作應如下進行:
SigFeePayerRLP = encode([ encode([type, nonce, gasPrice, gas, to, value, from]), feePayer, chainid, 0, 0 ])SigFeePayerHash = keccak256(SigFeePayerRLP)SignatureFeePayer = sign(SigFeePayerHash, <the fee payer's private key>)
SenderTxHash 的 RLP 編碼
要製作 SenderTxHash,RLP 序列化過程如下:
txSignatures (a single signature) = [[v, r, s]]txSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]SenderTxHashRLP = type + encode([nonce, gasPrice, gas, to, value, from, txSignatures])SenderTxHash = keccak256(SenderTxHashRLP)
交易哈希的 RLP 編碼
要製作事務哈希值,RLP 序列化的步驟如下:
txSignatures (a single signature) = [[v, r, s]]txSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]feePayerSignatures (a single signature) = [[v, r, s]]feePayerSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]TxHashRLP = type + encode([nonce, gasPrice, gas, to, value, from, txSignatures, feePayer, feePayerSignatures])`TxHash = keccak256(TxHashRLP)
RLP 編碼 (示例)
下面顯示的是 RLP 序列化的結果和事務對象:
ChainID 0x1PrivateKey 0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8PublicKey.X 0x3a514176466fa815ed481ffad09110a2d344f6c9b78c1d14afc351c3a51be33dPublicKey.Y 0x8072e77939dc03ba44790779b7a1025baf3003f6732430e20cd9b76d953391b3SigRLP 0xf839b5f4098204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b018080SigHash 0xb86e4cc0955f7c2cda1b36038c9d43a2724fc956c11e09c37625379b7eb2bd21Signature f845f84325a09f8e49e2ad84b0732984398749956e807e4b526c786af3c5f7416b293e638956a06bf88342092f6ff9fabe31739b2ebfa1409707ce54a54693e91a6b9bb77df0e7FeePayerPrivateKey 0xb9d5558443585bca6f225b935950e3f6e69f9da8a5809a83f51c3365dff53936FeePayerPublicKey.X 0x327434d4cfc66ef8857d431419e9deebdc53a3e415edcc55382e2d417b8dd102FeePayerPublicKey.Y 0x65fc97045707faf7b8f81ac65089d4cc71f69ad0bf1bc8559bc24f13fc284cedSigRLPFeePayer 0xf84eb5f4098204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b945a0043070275d9f6054307ee7348bd660849d90f018080SigHashFeePayer 0x3e7c5f40e826d1d22493be59bf62928dc397de5c972bd9bfa3fe5206c24a5f82SignatureFeePayer f845f84326a0f45cf8d7f88c08e6b6ec0b3b562f34ca94283e4689021987abb6b0772ddfd80aa0298fe2c5aeabb6a518f4cbb5ff39631a5d88be505d3923374f65fdcf63c2955bTxHashRLP 0x09f8d68204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0bf845f84325a09f8e49e2ad84b0732984398749956e807e4b526c786af3c5f7416b293e638956a06bf88342092f6ff9fabe31739b2ebfa1409707ce54a54693e91a6b9bb77df0e7945a0043070275d9f6054307ee7348bd660849d90ff845f84326a0f45cf8d7f88c08e6b6ec0b3b562f34ca94283e4689021987abb6b0772ddfd80aa0298fe2c5aeabb6a518f4cbb5ff39631a5d88be505d3923374f65fdcf63c2955bTxHash e1e07f9971153499fc8c7bafcdaf7abc20b37aa4c18fb1e53a9bfcc259e3644cSenderTxHashRLP 0x09f87a8204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0bf845f84325a09f8e49e2ad84b0732984398749956e807e4b526c786af3c5f7416b293e638956a06bf88342092f6ff9fabe31739b2ebfa1409707ce54a54693e91a6b9bb77df0e7SenderTxHash 40f8c94e01e07eb5353f6cd4cd3eabd5893215dd53a50ba4b8ff9a447ac51731 TX(e1e07f9971153499fc8c7bafcdaf7abc20b37aa4c18fb1e53a9bfcc259e3644c) Type: TxTypeFeeDelegatedValueTransfer From: 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B To: 0x7b65B75d204aBed71587c9E519a89277766EE1d0 Nonce: 1234 GasPrice: 0x19 GasLimit: 0xf4240 Value: 0xa Signature: [{"V":"0x25","R":"0x9f8e49e2ad84b0732984398749956e807e4b526c786af3c5f7416b293e638956","S":"0x6bf88342092f6ff9fabe31739b2ebfa1409707ce54a54693e91a6b9bb77df0e7"}] FeePayer: 0x5A0043070275d9f6054307Ee7348bD660849D90f FeePayerSig: [{"V":"0x26","R":"0xf45cf8d7f88c08e6b6ec0b3b562f34ca94283e4689021987abb6b0772ddfd80a","S":"0x298fe2c5aeabb6a518f4cbb5ff39631a5d88be505d3923374f65fdcf63c2955b"}] Hex: 09f8d68204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0bf845f84325a09f8e49e2ad84b0732984398749956e807e4b526c786af3c5f7416b293e638956a06bf88342092f6ff9fabe31739b2ebfa1409707ce54a54693e91a6b9bb77df0e7945a0043070275d9f6054307ee7348bd660849d90ff845f84326a0f45cf8d7f88c08e6b6ec0b3b562f34ca94283e4689021987abb6b0772ddfd80aa0298fe2c5aeabb6a518f4cbb5ff39631a5d88be505d3923374f65fdcf63c2955b
RPC 輸出 (示例)
下面顯示的是通過 JSON RPC 返回的事務對象。
{ "blockHash": "0x7ad6ed1f9955be00db8fb5452125f0e9a3c0856abb5b4cc4aed91ffc134321da", "blockNumber": "0x1", "contractAddress": null, "feePayer": "0x029fdce0457db02f05c4be9f67b7115cb8ea15ca", "feePayerSignatures": [ { "V": "0x26", "R": "0x984e9d43c496ef39ef2d496c8e1aee695f871e4f6cfae7f205ddda1589ca5c9e", "S": "0x46647d1ce8755cd664f5fb4eba3082dd1a13817488029f3869662986b7b1a5ae" } ], "from": "0x0fcda0f2efbe1b4e61b487701ce4f2f8abc3723d", "gas": "0x174876e800", "gasPrice": "0x5d21dba00", "gasUsed": "0x7918", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x2", "senderTxHash": "0x6a8cf9a2f6d16561303445309d4f210c8be862f0d0c0e6f4998775fef9b4f957", "signatures": [ { "V": "0x25", "R": "0x368b3324b37831b51711a2eba2a7608438a2bd5956ccecbcdb07d9163ff8bc87", "S": "0x7ee2e86ad6f01c867b2ced9d69e614ba22e539726451400fccdd56acbbc7a6f7" } ], "status": "0x1", "to": "0x75c3098be5e4b63fbac05838daaee378dd48098d", "transactionHash": "0xea4341b5c95fd5a0c3a8a15a4177ab6394725c24f722a9e31f53474a6dcf086a", "transactionIndex": "0x2", "type": "TxTypeFeeDelegatedValueTransfer", "typeInt": 9, "value": "0x21e19e0c9bab2400000"}
TxTypeFeeDelegatedValueTransferMemo
TxTypeFeeDelegatedValueTransferMemo 用於用戶發送帶有特定信息的 KAIA。 TxTypeFeeDelegatedValueTransferMemo 僅在 to
為外部所有賬戶時才被接受。 要將 KAIA 轉入智能合約賬戶,請使用 TxTypeFeeDelegatedSmartContractExecution。 該交易類型將進行以下更改。
- 付費者的餘額會減少交易費的金額。
- 發送方的 nonce 增加一個。
value
KAIA 由發送方傳送給接收方。
屬性
屬性 | 說明 | 類型 | 示例值 |
---|---|---|---|
type | uint8(Go) | TxTypeFeeDelegatedValueTransferMemo 的類型。 必須為 0x11。 | |
nonce | uint64 (Go) | 用於唯一標識發件人交易的值。 如果一個發送方生成了兩個具有相同 nonce 的交易,則只執行其中一個。 | |
gasPrice | *big.Int ( Go) | 以 kei 為單位的氣體單價,發件人將支付交易費。 交易費的計算公式為 gas * gasPrice 。 例如,如果交易消耗了 10 單位天然氣,而 gasPrice 為 10^18,則交易費為 10 KAIA。 See Unit of KAIA. | |
gas | uint64 (Go) | 交易允許使用的最大燃氣量。 | |
to | common.Address(Go) | 接收轉賬金額的賬戶地址。 | |
value | *big.Int ( Go) | 以 kei 為單位的 KAIA 轉賬金額。 | |
from | common.Address(Go) | 發件人地址。 For more details, see Signature Validation. | |
input | []byte (Go) | 交易附帶的數據。 信息應傳遞給該屬性。 | |
txSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 發件人簽名。 For more details, see Signature Validation. | |
feePayer | common.Address(Go) | 繳費人地址。 | |
feePayerSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 繳費人簽名。 |
寄件人簽名的 RLP 編碼
要對發送方進行簽名,RLP 序列化的方法如下:
SigRLP = encode([encode([type, nonce, gasPrice, gas, to, value, from, input]), chainid, 0, 0])SigHash = keccak256(SigRLP)Signature = sign(SigHash, <the sender's private key>)
繳費人簽名的 RLP 編碼
要製作繳費人簽名,RLP 序列化工作應如下進行:
SigFeePayerRLP = encode([encode([type, nonce, gasPrice, gas, to, value, from, input]), feePayer, chainid, 0, 0])SigFeePayerHash = keccak256(SigFeePayerRLP)SignatureFeePayer = sign(SigFeePayerHash, <the fee payer's private key>)
SenderTxHash 的 RLP 編碼
要製作 SenderTxHash,RLP 序列化過程如下:
txSignatures (a single signature) = [[v, r, s]]txSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]SenderTxHashRLP = type + encode([nonce, gasPrice, gas, to, value, from, input, txSignatures])SenderTxHash = keccak256(SenderTxHashRLP)
交易哈希的 RLP 編碼
要製作事務哈希值,RLP 序列化的步驟如下:
txSignatures (a single signature) = [[v, r, s]]txSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]feePayerSignatures (a single signature) = [[v, r, s]]feePayerSignatures (two signatures) = [[v1, r1, s1], [v2, r2, s2]]TxHashRLP = type + encode([nonce, gasPrice, gas, to, value, from, input, txSignatures, feePayer, feePayerSignatures])TxHash = keccak256(TxHashRLP)
RLP 編碼 (示例)
下面顯示的是 RLP 序列化的結果和事務對象:
ChainID 0x1PrivateKey 0x45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8PublicKey.X 0x3a514176466fa815ed481ffad09110a2d344f6c9b78c1d14afc351c3a51be33dPublicKey.Y 0x8072e77939dc03ba44790779b7a1025baf3003f6732430e20cd9b76d953391b3SigRLP 0xf841b83cf83a118204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b8568656c6c6f018080SigHash 0x3333b9336d431ffa53b795fedcf03cc2217cea3f26825ea5cbf7d69f0b99fde9Signature f845f84326a064e213aef0167fbd853f8f9989ef5d8b912a77457395ccf13d7f37009edd5c5ba05d0c2e55e4d8734fe2516ed56ac628b74c0eb02aa3b6eda51e1e25a1396093e1FeePayerPrivateKey 0xb9d5558443585bca6f225b935950e3f6e69f9da8a5809a83f51c3365dff53936FeePayerPublicKey.X 0x327434d4cfc66ef8857d431419e9deebdc53a3e415edcc55382e2d417b8dd102FeePayerPublicKey.Y 0x65fc97045707faf7b8f81ac65089d4cc71f69ad0bf1bc8559bc24f13fc284cedSigRLPFeePayer 0xf856b83cf83a118204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b8568656c6c6f945a0043070275d9f6054307ee7348bd660849d90f018080SigHashFeePayer 0xed015096fb27764f576415e23576228cbf7c4fdad464ea7ffc3a1856dfe391c9SignatureFeePayer f845f84326a087390ac14d3c34440b6ddb7b190d3ebde1a07d9a556e5a82ce7e501f24a060f9a037badbcb12cda1ed67b12b1831683a08a3adadee2ea760a07a46bdbb856fea44TxHashRLP 0x11f8dc8204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b8568656c6c6ff845f84326a064e213aef0167fbd853f8f9989ef5d8b912a77457395ccf13d7f37009edd5c5ba05d0c2e55e4d8734fe2516ed56ac628b74c0eb02aa3b6eda51e1e25a1396093e1945a0043070275d9f6054307ee7348bd660849d90ff845f84326a087390ac14d3c34440b6ddb7b190d3ebde1a07d9a556e5a82ce7e501f24a060f9a037badbcb12cda1ed67b12b1831683a08a3adadee2ea760a07a46bdbb856fea44TxHash 8f68882f6192a53ba470aeca1e83ed9b9e519906a91256724b284dee778b21c9SenderTxHashRLP 0x11f8808204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b8568656c6c6ff845f84326a064e213aef0167fbd853f8f9989ef5d8b912a77457395ccf13d7f37009edd5c5ba05d0c2e55e4d8734fe2516ed56ac628b74c0eb02aa3b6eda51e1e25a1396093e1SenderTxHash fffaa2b38d4e684ea70a89c78fc7b2659000d130c76ad721d68175cbfc77c550 TX(8f68882f6192a53ba470aeca1e83ed9b9e519906a91256724b284dee778b21c9) Type: TxTypeFeeDelegatedValueTransferMemo From: 0xa94f5374Fce5edBC8E2a8697C15331677e6EbF0B To: 0x7b65B75d204aBed71587c9E519a89277766EE1d0 Nonce: 1234 GasPrice: 0x19 GasLimit: 0xf4240 Value: 0xa Signature: [{"V":"0x26","R":"0x64e213aef0167fbd853f8f9989ef5d8b912a77457395ccf13d7f37009edd5c5b","S":"0x5d0c2e55e4d8734fe2516ed56ac628b74c0eb02aa3b6eda51e1e25a1396093e1"}] FeePayer: 0x5A0043070275d9f6054307Ee7348bD660849D90f FeePayerSig: [{"V":"0x26","R":"0x87390ac14d3c34440b6ddb7b190d3ebde1a07d9a556e5a82ce7e501f24a060f9","S":"0x37badbcb12cda1ed67b12b1831683a08a3adadee2ea760a07a46bdbb856fea44"}] Data: 36383635366336633666 Hex: 11f8dc8204d219830f4240947b65b75d204abed71587c9e519a89277766ee1d00a94a94f5374fce5edbc8e2a8697c15331677e6ebf0b8568656c6c6ff845f84326a064e213aef0167fbd853f8f9989ef5d8b912a77457395ccf13d7f37009edd5c5ba05d0c2e55e4d8734fe2516ed56ac628b74c0eb02aa3b6eda51e1e25a1396093e1945a0043070275d9f6054307ee7348bd660849d90ff845f84326a087390ac14d3c34440b6ddb7b190d3ebde1a07d9a556e5a82ce7e501f24a060f9a037badbcb12cda1ed67b12b1831683a08a3adadee2ea760a07a46bdbb856fea44
RPC 輸出 (示例)
下面顯示的是通過 JSON RPC 返回的事務對象。
{ "blockHash": "0x7ad6ed1f9955be00db8fb5452125f0e9a3c0856abb5b4cc4aed91ffc134321da", "blockNumber": "0x1", "contractAddress": null, "feePayer": "0x029fdce0457db02f05c4be9f67b7115cb8ea15ca", "feePayerSignatures": [ { "V": "0x25", "R": "0xb5d80dc924c51f58eb674a142ebfd8ca1c0bc722bc85b001a5a6905ba8226b1", "S": "0x79852418faacd4407aee4a461a08602fcf6a3a3cb63b9ba69d70ffe2f5fe3cd" } ], "from": "0x0fcda0f2efbe1b4e61b487701ce4f2f8abc3723d", "gas": "0x174876e800", "gasPrice": "0x5d21dba00", "gasUsed": "0x7b0c", "input": "0x68656c6c6f", "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "nonce": "0x5", "senderTxHash": "0x5a4e42bac0b2bc8dda4ee82bfafc83e7f156f74d81d367a3db430abd40b2cd47", "signatures": [ { "V": "0x26", "R": "0xe8f5484b057b542c80f16c5bb8707e040619c3dc9ac5628d2797aa3d8a2fc0d0", "S": "0x5d598f2f10283ded6f6e6a216f4278b27fdf4d431272fa090064ac0fd3fc8102" } ], "status": "0x1", "to": "0x75c3098be5e4b63fbac05838daaee378dd48098d", "transactionHash": "0x66fe4d1abdf15a250f9391646e0242c8e4c3310250ca316d8fd00856aac16172", "transactionIndex": "0x5", "type": "TxTypeFeeDelegatedValueTransferMemo", "typeInt": 17, "value": "0x989680"}
TxTypeFeeDelegatedSmartContractDeploy
TxTypeFeeDelegatedSmartContractDeploy 部署具有費用委託功能的智能合約。 該交易類型將進行以下更改。
- 付費者的餘額會減少交易費的金額。
- 發送方的 nonce 增加一個。
- 智能合約與
input
中的代碼一起部署。 部署地址將通過收據中的contractAddress
返回。 value
KAIA 由發送方傳送給接收方。
屬性
屬性 | 類型 | 說明 |
---|---|---|
type | uint8(Go) | TxTypeFeeDelegatedSmartContractDeploy 的類型。 必須為 0x29。 |
nonce | uint64 (Go) | 用於唯一標識發件人交易的值。 如果一個發送方生成了兩個具有相同 nonce 的交易,則只執行其中一個。 |
gasPrice | *big.Int ( Go) | 以 kei 為單位的氣體單價,發件人將支付交易費。 交易費的計算公式為 gas * gasPrice 。 例如,如果交易消耗了 10 單位天然氣,而 gasPrice 為 10^18,則交易費為 10 KAIA。 See Unit of KAIA. |
gas | uint64 (Go) | 交易允許使用的最大燃氣量。 |
to | *common.Address(Go\) | 接收轉賬金額的賬戶地址。 目前,該值必須為零。 今後將支持指定地址。 |
value | *big.Int ( Go) | 以 kei 為單位的 KAIA 轉賬金額。 |
from | common.Address(Go) | 發件人地址。 For more details, see Signature Validation. |
input | []byte (Go) | 附屬於事務的數據,用於執行事務。 |
humanReadable | bool (Go) | 必須為假,因為目前還不支持人類可讀地址。 如果為 "true",交易將被拒絕。 |
codeFormat | uint8(Go) | 智能合約代碼的代碼格式。 目前僅支持 EVM(0x00) 值。 |
txSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 發件人簽名。 For more details, see Signature Validation. |
feePayer | common.Address(Go) | 繳費人地址。 |
feePayerSignatures | []{*big.Int, *big.Int, *big.Int} (Go) | 繳費人簽名。 |
寄件人簽名的 RLP 編碼
要對發送方進行簽名,RLP 序列化的方法如下:
SigRLP = encode([encode([type, nonce, gasPrice, gas, to, value, from, input, humanReadable, codeFormat]), chainid, 0, 0])SigHash = keccak256(SigRLP)Signature = sign(SigHash, <the sender's private key>)