Skip to content

Latest commit

 

History

History
66 lines (55 loc) · 4.86 KB

transfer-transaction.md

File metadata and controls

66 lines (55 loc) · 4.86 KB
description
The transfer transaction allows the sender to transfer LTO tokens to the recipient.

Transfer

{
  "type": 4,
  "version": 3,
  "id": "5a1ZVJTu8Y7mPA6BbkvGdfmbjvz9YSppQXPnb5MxihV5",
  "sender": "3N9ChkxWXqgdWLLErWFrSwjqARB6NtYsvZh",
  "senderKeyType": "ed25519",
  "senderPublicKey": "9NFb1rvMyr1k8f3wu3UP1RaEGsozBt9gF2CmPMGGA42m",
  "fee": 100000000,
  "timestamp": 1609639213556,
  "amount": 100000000000,
  "recipient": "3NBcx7AQqDopBj3WfwCVARNYuZyt1L9xEVM",
  "attachment": "9Ajdvzr",
  "proofs": [
    "3ftQ2ArKKXw655WdHy2TK1MGXeyzKRqMQYwFidekkyxLpzFGsTziSFsbM5RCFxrn32EzisMgPWtQVQ4e5UqKUcES"
  ],
  "height": 1212761
}

{% hint style="info" %}

  • id and height should be omitted when broadcasting. These fields are set by the node.
  • Binary strings (including attachment) are base58 encoded.
  • timestamp is in microseconds since epoch.
  • fee and amount include 8 digits, so LTO * 10^8 {% endhint %}

Binary schema

The binary data structure of the unsigned transaction.

{% tabs %} {% tab title="V3 (current)" %}

#Field NameTypeLength
1Transaction typeByte (constant, value=4)1
2VersionByte (constant, value=3)1
3Network idByte1
4TimestampLong8
5Sender's key typeKeyType (Byte)1
6Sender's public keyPublicKey (Array[Byte])32 | 33
7FeeLong8
8RecipientAddress (Array[Byte])26
9AmountLong8
10Attachment length (N)Short2
11AttachmentArray[Byte]N

{% hint style="info" %}

  • Network id can be obtained by taking the 2nd byte from the sender address.
  • Each key type has a numeric id in addition to the reference from the JSON.
  • Integers (short, int, long) have a big endian byte order. {% endhint %} {% endtab %}

{% tab title="V2" %}

#Field NameTypeLength
1Transaction typeByte (constant, value=4)1
2VersionByte (constant, value=2)1
3Sender's public keyPublicKey (Array[Byte])32
4TimestampLong8
5AmountLong8
6FeeLong8
7RecipientAddress (Array[Byte])26
8Attachment length (N)Short2
9AttachmentArray[Byte]N

{% hint style="info" %} Integers (short, int, long) have a big endian byte order. {% endhint %} {% endtab %}

{% tab title="V1" %}

#Field NameTypeLength
1Transaction typeByte (constant, value=4)1
2Sender's public keyPublicKey (Array[Byte])32
3TimestampLong8
4AmountLong8
5FeeLong8
6RecipientAddress (Array[Byte])26
7Attachment length (N)Short2
8AttachmentArray[Byte]N

{% hint style="info" %} Integers (short, int, long) have a big endian byte order. {% endhint %} {% endtab %} {% endtabs %}