LTO Network
  • Getting started
  • What is LTO Network?
  • Tutorials
    • Buying and staking LTO
      • Exchanges
        • Binance
        • AscendEX (Bitmax)
        • Uniswap
        • PancakeSwap
        • Other exchanges
      • Creating your LTO web wallet
      • Using the LTO token bridge
      • Staking LTO tokens
    • Mining
      • Setup your node wallets
      • Node management
      • Public community nodes
    • Anchoring
      • Hashing
    • LetsFlow
  • Wallets
    • LTO Web Wallet
      • Using Ledger
    • Universal Wallet
    • LTO CLI
    • Third-Party Wallets
      • Stakely.io wallet
        • Web wallet
        • Commandline
    • ERC20 Token Swap
  • Running a node
    • Public node
      • Installation Guide
        • Mainnet & Testnet
        • Requirements
        • Configuration
        • (Virtual) Machine
        • Nginx reverse proxy (optional)
        • Troubleshooting FAQ
      • Cloud installation
        • Alibaba Cloud
        • AWS Elastic Beanstalk
        • Google Cloud
        • IBM Cloud
        • Microsoft Azure
        • OKD (OpenShift)
        • Raspberry Pi (Expert)
        • Ubuntu Linux with Container
        • Windows with Container
      • REST API
        • Address
        • Wallet
        • Lease Transactions
        • Peers
        • Blocks
        • Utils
        • FAQ
      • Security Notes
      • FAQ
      • Exchange integration guide
    • Anchor node
      • Installation Guide
        • Linux
        • MacOS
        • Windows
      • REST API
    • Identity node
      • Installation guide
        • Linux
        • MacOs
        • Windows
      • Configuration
        • Trust network
      • REST API
    • Workflow node
      • Installation Guide
        • MacOS
        • Windows
        • Ubuntu Linux
      • REST API
  • Ownables
    • What are Ownables?
    • Making your first ownable
    • Ownables SDK
      • Prerequisites
      • Setup
    • Ownables Architecture
      • Smart Contract
      • Widget
    • Ownables Bridge
  • Templates Overview
  • Libraries
    • JavaScript
      • Accounts
      • Transactions
      • Event chain
      • Messages
      • Identities
      • HTTP Authentication
    • Python
      • Accounts
      • Public layer
    • PHP
      • Accounts
      • Identities
      • Public layer
      • Private layer
      • HTTP Authentication
      • Commandline scripts
    • Java
  • Protocol
    • Cryptography
    • Accounts
      • ED25519
      • secp256k1
      • secp256r1
    • Identities
      • Decentralized identifiers (DID)
      • Trust network
      • Verifiable credentials
    • Public layer
      • Transactions
        • Transfer
        • Lease
        • Cancel Lease
        • Mass Transfer
        • Set Script
        • Data
        • Anchor
        • Association
        • Revoke Association
        • Sponsorship
        • Cancel Sponsorship
        • Register
        • Burn
        • Mapped Anchor
        • Statement
      • Transaction fees
      • Consensus protocol
      • Activation Protocol
      • Data Structures
    • Private layer
      • Event chain
        • Event
      • Messaging
        • Sending messages
Powered by GitBook
On this page
  • JSON
  • Association identifier
  • Data entries
  • Binary schema
  1. Protocol
  2. Public layer
  3. Transactions

Association

Create an association between account. An association can represent any kind of relationship. The meaning is defined by the association type.

JSON

{
  "type": 16,
  "version": 4,
  "id": "7xzhQ5dkehS547ejG4X17QRBvJigT7ruELgLp7qff6G9",
  "sender": "3NBcx7AQqDopBj3WfwCVARNYuZyt1L9xEVM",
  "senderKeyType": "ed25519",
  "senderPublicKey": "7gghhSwKRvshZwwh6sG97mzo1qoFtHEQK7iM4vGcnEt7",
  "fee": 60000000,
  "timestamp": 1689090586785,
  "associationType": 1,
  "recipient": "3N2XoMuukk4BPiLn95vDkv4ocU5szMXuxVN",
  "expires": 1704067200000,
  "subject": "3yZe7d",
  "data": [
    {
      "key": "str",
      "type": "string",
      "value": "some text"
    },
    {
      "key": "int",
      "type": "integer",
      "value": 1234567
    },
    {
      "key": "bool",
      "type": "boolean",
      "value": true
    },
    {
      "key": "bin",
      "type": "binary",
      "value": "base64:aGVsbG8="
    }
  ],
  "proofs": [
    "2k6hCWSQdJhMkSni4q6Y76X1obGCx2B3FPEsJXtJLyG3aaJAYeCNMAmGhdTqHxzM7m4SKLgJ7iV8UFF2Dmq5jAJa"
  ],
  "height": 2546397,
  "effectiveFee": 49587000
}
  • id and height should be omitted when broadcasting. These fields are set by the node.

  • subject is optional.

  • Binary strings are base58 encoded.

  • timestamp and expires is in microseconds since epoch.

  • fee includes 8 digits, so LTO * 10^8

Associations that are recently expired may still be returned by the node. The public node will use the time of the last mined block to determine if an association is expired or not.

Association identifier

Submitting a new association transaction with the same sender, recipient, association type, and subject will overwrite the expiry date and data.

Since the subject is part of the identifier, it's not possible to change the subject of an existing association.

Data entries

Binary schema

The binary data structure of the unsigned transaction.

Version 4 of the anchor transaction is part of the Titanium release.

#
Field Name
Type
Length

1

Transaction type

Byte (constant, value=16)

1

2

Version

Byte (constant, value=3)

1

3

Network id

Byte

1

4

Timestamp

Long

8

5

Sender's key type

KeyType (Byte)

1

6

Sender's public key

PublicKey (Array[Byte])

32 | 33

7

Fee

Long

8

8

Recipient

Address (Array[Byte])

26

9

Association type

Int

4

10

Expires

Long

8

11

Subject length (N)

Short

2

12

Subject

Array[Byte]

N

13

Number of entries

Short

2

14

Entry 1

...

  • If the association doesn't expire, the expiry timestamp in the binary data must be zero.

  • Network id can be obtained by taking the 2nd byte from the sender address.

  • Integers (short, int, long) have a big endian byte order.

#
Field Name
Type
Length

1

Transaction type

Byte (constant, value=16)

1

2

Version

Byte (constant, value=3)

1

3

Network id

Byte

1

4

Timestamp

Long

8

5

Sender's key type

KeyType (Byte)

1

6

Sender's public key

PublicKey (Array[Byte])

32 | 33

7

Fee

Long

8

8

Recipient

Address (Array[Byte])

26

9

Association type

Int

4

10

Expires

Long

8

11

Subject length (N)

Short

2

12

Subject

Array[Byte]

N

  • If the association doesn't expire, the expiry timestamp in the binary data must be zero.

  • Network id can be obtained by taking the 2nd byte from the sender address.

  • Integers (short, int, long) have a big endian byte order.

#
Field Name
Type
Length

1

Transaction type

Byte (constant, value=16)

1

2

Version

Byte (constant, value=1)

1

3

Chain id

Byte

1

4

Sender's public key

PublicKey (Array[Byte])

32

5

Party

Address (Array[Byte])

26

6

Association type

Int

4

7

Includes subject

Boolean (Byte)

1

8

Subject length (N)

Short

2

9

Subject

Array[Byte]

N

10

Timestamp

Long

8

11

Fee

Long

8

If the association doesn't include a hash, the hash length and hash should be omitted from the binary data.

  • Chain id can be obtained by taking the 2nd byte from the sender or recipient address.

  • Integers (short, int, long) have a big endian byte order.

PreviousAnchorNextRevoke Association

Last updated 1 year ago

An association is identified by the sender, recipient, association type, and subject. With this information, the association can be .

Since version 4, association transactions can have data entries. These are similar to those of the .

Each has a numeric id in addition to the reference from the JSON.

Each has a numeric id in addition to the reference from the JSON.

The encoding of a data entry depends on the type. For more information see .

revoked
data transaction
key type
key type
"Binary schema of data entries"