Last updated
Last updated
TxTypeLegacyTransaction은 이전에 Klaytn에 존재했던 트랜잭션 유형을 의미합니다. Since this transaction type exists to support compatibility, it only works with EOAs associated with . 다른 계정 키 유형과 연결된 EOA는 TxTypeValueTransfer, TxTypeSmartContractExecution 같은 다른 트랜잭션 유형을 사용해야 합니다. 이 유형의 트랜잭션은 계정 생성, 토큰 전송, 스마트 컨트랙트 배포, 스마트 컨트랙트 실행 또는 앞에서 언급한 것들을 혼합하여 실행할 수 있습니다. 이 트랜잭션 유형은 다음과 같은 변경 사항을 만듭니다.
발신자의 잔고는 트랜잭션 수수료만큼 줄어듭니다.
발신자의 논스가 1 증가합니다.
If to
does not exist on Klaytn, an EOA associated with is created.
value
KLAY가 발신자로부터 수신자로 전송됩니다.
to
가 nil이라면 스마트컨 트랙트 배포를 위한 트랜잭션으로 간주됩니다. 스마트 컨트랙트 코드는 input
을 통해 전달되어야 합니다.
to
가 스마트 컨트랙트라면 input
에 명시된 스마트 컨트랙트 함수가 실행됩니다.
이 트랜잭션 유형의 서명을 만들려면 다음과 같이 RLP 직렬화를 수행해야합니다.
SenderTxHash를 만들려면 다음과 같이 RLP 직렬화를 수행해야합니다.
트랜잭션 해시를 만들려면 다음과 같이 RLP 직렬화를 수행해야합니다.
다음은 RLP 직렬화의 결과와 트랜잭션 오브젝트를 보여줍니다.
다음은 JSON RPC를 통해 반환된 트랜잭션 오브젝트를 보여줍니다.
The sender's balance decreases by the amount of the transaction fee.
The sender's nonce increases by one.
value
KLAY is transferred from the sender to the recipient.
트랜잭션 서명을 만들려면 다음과 같이 RLP 직렬화를 수행해야합니다.
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
다음은 주어진 인수에 대한 RLP 직렬화의 결과와 트랜잭션 오브젝트의 정보를 보여줍니다.
The following shows a transaction object returned via JSON RPC.
The sender's balance decreases by the amount of the transaction fee.
The sender's nonce increases by one.
value
KLAY is transferred from the sender to the recipient.
To make a transaction signature, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
TxTypeSmartContractDeploy deploys a smart contract to the given address. The following changes will be made by this transaction type.
The sender's balance decreases by the amount of the transaction fee.
The sender's nonce increases by one.
input
에 기입된 코드로 스마트 컨트랙트가 배포됩니다. 배포된 주소는 영수증의 contractAddress
를 통해 반환됩니다.
value
KLAY is transferred from the sender to the recipient.
To make a signature of this transaction type, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
수수료 납부자의 서명을 만들려면 RLP 직렬화를 다음과 같이 수행해야합니다.
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
to
가 스마트 컨트랙트라면 input
을 이용하여 코드가 실행됩니다. 그렇지 않으면 트랜잭션은 거절됩니다.
The sender's balance decreases by the amount of the transaction fee.
The sender's nonce increases by one.
value
에 값이 입력되었으면 발신자에서 to
로value
KLAY가 전송됩니다. 컨트랙트가 KLAY를 받기 위해서는 컨트랙트는 payable fallback function을 가져야 합니다.
To make a signature of this transaction type, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
TxTypeAccountUpdate updates the key of the given account. 이 트랜잭션 유형은 다음과 같은 변경 사항을 만듭니다.
The sender's balance decreases by the amount of the transaction fee.
The sender's nonce increases by one.
계정의 키는 key
로 업데이트됩니다.
이 유형의 트랜잭션이 실행되고 나면 계정에서 전송된 트랜잭션은 새 key
로 검증됩니다.
To make a signature of this transaction type, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
TxTypeCancel cancels the execution of the transaction with the same nonce in the transaction pool. 이 트랜잭션 유형은 제출된 트랜잭션이 일정 시간 동안 처리되지 않은 것으로 보일 때 유용합니다. 트랜잭션이 처리되지 않은 것처럼 보이는 경우가 몇 가지 있습니다: 1. 트랜잭션이 어딘가에서 손실되어 컨센서스 노드에 도달하지 못하는 경우 2. 어떤 컨센서스 노드에서도 아직 트랜잭션이 처리되지 않은 경우 3. 트랜잭션이 처리되었지만 트랜잭션이 포함된 블록이 전달되지 않은 경우
클라이언트 쪽에서는 정확한 원인을 파악하기가 매우 어렵습니다. 이유를 파악하려면 모든 컨센서스 노드를 살펴봐야 합니다. 단, 일반 사람들이 컨센서스 노드에 연결하는 것은 금지됩니다. 이러한 상황에서 일반적인 블록체인 플랫폼에서는 사용자가 이전 트랜잭션을 대체하기 위해 다른 트랜잭션을 더 높은 가스 가격으로 제출하는 경우가 많습니다. 다만, Klaytn에서는 가스 가격이 고정돼 있기 때문에, 기존 트랜잭션을 더 높은 가스 가격으로 대체하는 것은 불가능합니다.
트랜잭션이 처리되지 않은 상태로 유지되는 경우, 더 높은 논스를 가진 다른 트랜잭션이 처리될 수 없습니다. 논스로 트랜잭션 실행 순서가 결정되기 때문입니다.
이 문제를 해결하기 위해 Klaytn은 트랜잭션 유형 TxTypeCancel을 제공합니다. 사용자는 이러한 상황에 직면하면 TxTypeCancel 트랜잭션을 전송할 수 있습니다.
위의 각 상황은 다음과 같이 처리됩니다. 1. 이전 트랜잭션이 손실된 경우 TxTypeCancel 트랜잭션이 실행되어 블록에 포함됩니다. 2. 이전 트랜잭션이 아직 처리되지 않은 경우 TxTypeCancel은 이전 트랜잭션을 대체합니다. 그런 다음 실행되어 블록에 포함됩니다. 3. 이전 트랜잭션이 이미 실행된 경우, 논스가 증가했으므로 TxTypeCancel 트랜잭션은 논스가 낮아서 삭제됩니다.
TxTypeCancel 트랜잭션은 동일한 논스의 트랜잭션을 대체 할 수 있는 유일한 트랜잭션입니다. 다른 트랜잭션 유형은동일한 논스의 트랜잭션으로 바꿀 수 없습니다.
이 트랜잭션 유형은 다음과 같은 변경 사항을 만듭니다. 1. The sender's balance decreases by the amount of the transaction fee. 2. The sender's nonce increases by one.
결과:
같은 논스를 가진 트랜잭션이 있으면, 이 취소 트랜잭션으로 대체됩니다.
만약 같은 논스가 없으면 이 트랜잭션은 보통 트랜잭션으로 삽입됩니다.
취소 트랜잭션은 다른 트랜잭션 유형으로 대체되지 않습니다.
To make a transaction signature, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
To make a signature of this transaction type, RLP serialization should be done like the following:
To make a SenderTxHash, RLP serialization should be done like the following:
To make a transaction hash, RLP serialization should be done like the following:
The following shows the result of RLP serialization and the transaction object:
The following shows a transaction object returned via JSON RPC.
TxTypeValueTransfer is used when a user wants to send KLAY. Klaytn은 각 목적에 맞는 여러가지 트랜잭션 유형들을 제공하는데, TxTypeValueTransfer는 KLAY를 EOA에 전송할 때 사용하는 기능입니다. 따라서 TxTypeValueTransfer는 to
가 EOA일때만 작동합니다. KLAY를 스마트 컨트랙트로 전송하려면 를 대신 사용하여야 합니다. 이 트랜잭션 유형은 다음과 같은 변경 사항을 만듭니다.
TxTypeValueTransferMemo is used when a user wants to send KLAY with a specific message. 따라서 TxTypeValueTransferMemo는 to
가 EOA일때만 작동합니다. To transfer KLAY to a smart contract account, use instead. The following changes will be made by this transaction type.
TxTypeSmartContractExecution executes a smart contract with the given data in input
. TxTypeSmartContractExecution는 to
가 스마트 컨트랙트 계정일 때만 실행됩니다. KLAY를 외부 소유 계정으로 전송하려면 를 대신 사용하십시오. The following changes will be made by this transaction type.
TxTypeChainDataAnchoringTransaction는 서비스체인 데이터를 Klaytn 메인체인에 앵커링하는 트랜잭션입니다. 서비스체인은 주기적으로 이러한 종류의 트랜잭션을 Klaytn 메인체인에 보내어 자신의 데이터 보안과 신뢰성을 검증받습니다. 데이터 앵커링에 관한 더 자세한 내용은 을 참조하시기 바랍니다. 이 트랜잭션은 RPC 호출로 전송하시면 안 된다는 점을 유의하시기 바랍니다. 현재 이 트랜잭션은 보안상의 이유로 비공개 p2p 채널을 통해 실행됩니다. 이 트랜잭션은 발신자의 논스를 1씩 증가시키는 것을 제외하고는 Klaytn 블록 체인의 상태를 변경하지 않습니다.