{% extends "_layout.html" %} {% block title %}Data types Specification{% endblock %} {% block content %}

Data types Specification

This document describes some data types common to all I2P-protocols, like I2NP, I2CP, NTCP, etc.

Integer

Description

Represents a nonnegative integer.

Contents

1 or more bytes in network byte order representing an unsigned integer

Date

Description

The number of milliseconds since midnight on January 1, 1970 in the GMT timezone. If the number is 0, the date is undefined or null.

Contents

8 byte Integer

String

Description

Represents a UTF-8 encoded string.

Contents

1 or more bytes where the first byte is the number of bytes(not characters!) in the string and the remaining 0-255 bytes are the non-null terminated UTF-8 encoded character array

Description

A boolean value, supporting null/unknown representation 0=false, 1=true, 2=unknown/null

Contents

1 byte Integer

PublicKey

Description

This structure is used in ElGamal encryption, representing only the exponent, not the primes, which are constant and defined in the appropiate spec.

Contents

256 byte Integer

PrivateKey

Description

This structure is used in ElGama decryption, representing only the exponent, not the primes which are constant and defined in the appropiate spec.

Contents

256 byte Integer

SessionKey

Description

This structure is used for AES256 encryption and decryption.

Contents

32 byte Integer

SigningPublicKey

Description

This structure is used for verifying DSA signatures.

Contents

256 byte Integer

SigningPrivateKey

Description

This structure is used for creating DSA signatures.

Contents

20 byte Integer

Signature

Description

This structure represents the DSA signature of some data.

Contents

40 byte Integer

Hash

Description

Represents the SHA256 of some data.

Contents

32 bytes

Certificate

Description

A certificate is a container for various receipts or proof of works used throughout the I2P network.

Contents

1 byte Integer specifying certificate type, followed by a 2 Integer specifying the size of the certificate payload, then that many bytes.

{% filter escape %}
+----+----+----+----+----+--//
|type| length  | payload
+----+----+----+----+----+--//

type :: Integer
        length -> 1 byte

        case 0 -> NULL
        case 1 -> HASHCASH
        case 2 -> HIDDEN
        case 3 -> SIGNED
        case 4 -> MULTIPLE

length :: Integer
          length -> 2 bytes

payload :: data
           length -> $length bytes
{% endfilter %}
{% endblock %}