Skip to content

Commit 642ae4a

Browse files
authored
Merge pull request #3378 from XRPLF/add-int32
Add Int32 data type
2 parents 864c412 + c248c60 commit 642ae4a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/references/protocol/binary-format.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,8 @@ Transactions and ledger entries may contain fields of any of the following types
189189
| [UInt256][] | 5 | 256 | No | A 256-bit binary value. This usually represents the hash of a transaction, ledger version, or ledger entry. |
190190
| [UInt384][] | 22 | 384 | No | **UNUSED.** A 384-bit binary value. |
191191
| [UInt512][] | 23 | 512 | No | **UNUSED.** A 512-bit binary value. |
192+
| [Int32][] | 10 | 32 | No | **UNUSED.** A 32-bit signed integer. |
193+
| [Int64][] | 11 | 64 | No | **UNUSED.** A 64-bit signed integer. |
192194
| [Vector256][] | 19 | Variable | Yes | A list of 256-bit binary values. This may be a list of ledger entries or other hash values. |
193195
| [XChainBridge][] | 25 | Variable | No | A bridge between two blockchains, identified by the door accounts and issued assets on both chains. |
194196
@@ -394,6 +396,21 @@ The types UInt96, UInt384, and UInt512 are currently defined but not used.
394396
395397
The `TransactionType` field is a special case. In JSON, this field is conventionally represented as a string with the name of the transaction type. In binary, this field is a UInt16. The `TRANSACTION_TYPES` object in the [definitions file](#definitions-file) maps these strings to the numeric values used in the binary format.
396398
399+
400+
### Int Fields
401+
[Int32]: #int-fields
402+
[Int64]: #int-fields
403+
404+
The XRP Ledger supports signed 32-bit integers (Int32), which use standard big-endian binary signed integer representation with two's complement to handle negative values.
405+
406+
In JSON format, Int32 fields can be represented as:
407+
408+
- JSON numbers (for values within JavaScript's safe integer range).
409+
- Strings containing decimal numbers.
410+
411+
Although the protocol supports the Int32 type, no fields currently use it. An Int64 type has also been defined, but is unsupported.
412+
413+
397414
### Vector256 Fields
398415
[Vector256]: #vector256-fields
399416

0 commit comments

Comments
 (0)