Avalanche Francophone
  • Documentation du développeur
  • Apprendre
    • Aperçu de la plateforme
      • Staking
      • Frais de transaction
    • Les bases de la blockchain
    • FAQ
    • Forum
    • Communauté
  • Créer
  • Pour commencer: exécuter un nœud Avalanche
  • Notes de version
    • Alertes par email
    • Notes de mise à jour d'AvalancheGo
    • Notes de mise à jour d'Ortelius
  • Tutoriels
    • Plateforme
      • Créer une nouvelle blockchain
      • Créer un Réseau Local Testnet
      • Créer un sous-réseau (subnet)
      • Créer une Machine Virtuelle (VM)
      • Configurez votre Ledger Nano S avec Avalanche
      • Transférer de l'AVAX entre la X-Chain et la C-Chain
      • Transférer de l'AVAX entre la X-Chain et la P-Chain
    • Nœuds et mise en jeu
      • Ajouter un validateur
      • Maintenir un nœud Avalanche
      • Exécutez un nœud Avalanche et devenez validateur
      • Exécuter un nœud Avalanche avec Oracle VM VirtualBox
      • Exécutez un nœud Avalanche avec un Raspberry Pi 4
      • Exécutez un nœud Avalanche et faites une mise en jeu avec le portefeuille
      • Exécuter un nœud Avalanche avec OVH
      • Exécuter un nœud Avalanche avec Amazon Web Services (AWS)
      • Exécuter un nœud Avalanche avec Microsoft Azure
      • Exécuter un nœud Avalanche sous Linux à l'aide du script d'installation
      • Configuration du monitoring des nœuds
      • Mise en jeu d'AVAX, en validant ou délégant via le portefeuille Avalanche
      • Déléguer à un nœud
      • Sécurisation d'un serveur VPS
      • Mettez à niveau votre nœud AvalancheGo
    • Contrats intelligents
      • Déployer un contrat intelligent en utilisant Remix et MetaMask
      • Utilisation de Truffle avec la C-Chain d'Avalanche
    • Actifs Numériques Intelligents
      • Créer un token ERC-20
      • Créer un actif à capitalisation fixe
      • Créer un actif à capitalisation variable
      • Création d'un NFT - Partie 1
      • Créez des NFT avec le portefeuille Avalanche
      • Utilisez les Wrapped AVAX (WAVAX) sur Avalanche
  • AvalancheGo APIs
    • Émettre des appels d'API
    • Platform API (P-Chain)
    • EVM API (C-Chain)
    • AVM API (X-Chain)
    • Appels d'API obsolètes
    • API Admin
    • API Auth
    • API Health
    • API Info
    • API IPC
    • API Keystore
    • API Metrics
    • API Timestamp
  • Outils
    • AvalancheJS
      • Créer un actif sur la X-Chain
      • Management des clés sur la X-Chain
      • Envoyer un actif sur la X-Chain
      • API
    • Avash
    • Ortelius
  • Références
    • AVM Transaction Format
    • Command Line Interface
    • Coreth Atomic Transaction Format
    • Cryptographic Primitives
    • Network Protocol
    • Serialization Primitives
    • Platform Transaction Format
  • Papiers
Propulsé par GitBook
Sur cette page
  • Byte
  • Short
  • Integer
  • Long Integers
  • IP Addresses
  • Fixed-Length Array
  • Variable Length Array
  • String

Cet article vous a-t-il été utile ?

  1. Références

Serialization Primitives

PrécédentNetwork ProtocolSuivantPlatform Transaction Format

Dernière mise à jour il y a 4 ans

Cet article vous a-t-il été utile ?

utilise une représentation simple, uniforme et élégante pour toutes les données internes. Ce document décrit comment les types de donnée primitifs sont encodés sur la plateforme Avalanche. Les transactions sont codées en fonction de ces types primitifs de base.

Byte

Bytes are packed as-is into the message payload.

Example:

Packing:
    0x01
Results in:
    [0x01]

Short

Shorts are packed in BigEndian format into the message payload.

Example:

Packing:
    0x0102
Results in:
    [0x01, 0x02]

Integer

Integers are 32-bit values packed in BigEndian format into the message payload.

Example:

Packing:
    0x01020304
Results in:
    [0x01, 0x02, 0x03, 0x04]

Long Integers

Long integers are 64-bit values packed in BigEndian format into the message payload.

Example:

Packing:
    0x0102030405060708
Results in:
    [0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08]

IP Addresses

IP addresses are represented as 16-byte IPv6 format, with the port appended into the message payload as a Short. IPv4 addresses are padded with 12 bytes of leading 0x00s.

IPv4 example:

Packing:
    "127.0.0.1:9650"
Results in:
    [
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x00, 0x00, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x01,
        0x25, 0xb2,
    ]

IPv6 example:

Packing:
    "[2001:0db8:ac10:fe01::]:12345"
Results in:
    [
        0x20, 0x01, 0x0d, 0xb8, 0xac, 0x10, 0xfe, 0x01,
        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
        0x30, 0x39,
    ]

Fixed-Length Array

Fixed-length arrays, whose length is known ahead of time and by context, are packed in order.

Byte array example:

Packing:
    [0x01, 0x02]
Results in:
    [0x01, 0x02]

Integer array example:

Packing:
    [0x03040506]
Results in:
    [0x03, 0x04, 0x05, 0x06]

Variable Length Array

The length of the array is prefixed in Integer format, followed by the packing of the array contents in Fixed Length Array format.

Byte array example:

Packing:
    [0x01, 0x02]
Results in:
    [0x00, 0x00, 0x00, 0x02, 0x01, 0x02]

Int array example:

Packing:
    [0x03040506]
Results in:
    [0x00, 0x00, 0x00, 0x01, 0x03, 0x04, 0x05, 0x06]

String

A String is packed similarly to a variable-length byte array. However, the length prefix is a short rather than an int. Strings are encoded in UTF-8 format.

Example:

Packing:
    "Avax"
Results in:
    [0x00, 0x04, 0x41, 0x76, 0x61, 0x78]
Avalanche