Skip to content

Commit

Permalink
Use 's' instead of 'i' for signed integers
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bast authored and niftynei committed Jun 22, 2023
1 parent 580811f commit 34e7787
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions 01-messaging.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,13 @@ receiver to parse individual elements from `value`.
Various fundamental types are referred to in the message specifications:

* `byte`: an 8-bit byte
* `i8`: an 8-bit signed integer
* `s8`: an 8-bit signed integer
* `u16`: a 2 byte unsigned integer
* `i16`: a 2 byte signed integer
* `s16`: a 2 byte signed integer
* `u32`: a 4 byte unsigned integer
* `i32`: a 4 byte signed integer
* `s32`: a 4 byte signed integer
* `u64`: an 8 byte unsigned integer
* `i64`: an 8 byte signed integer
* `s64`: an 8 byte signed integer

Signed integers use standard big-endian two's complement representation
(see test vectors [below](#appendix-d-signed-integers-test-vectors)).
Expand Down Expand Up @@ -978,8 +978,8 @@ be able to correctly verify signatures.

## Appendix D: Signed Integers Test Vectors

The following test vector show how signed integers (`i8`, `i16`, `i32`
and `i64`) are encoded using big-endian two's complement.
The following test vector show how signed integers (`s8`, `s16`, `s32`
and `s64`) are encoded using big-endian two's complement.

```json
[
Expand Down
4 changes: 2 additions & 2 deletions 02-peer-protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ completed.
2. types:
1. type: 0 (`funding_output_contribution`)
2. data:
* [`i64`:`satoshis`]
* [`s64`:`satoshis`]

#### Requirements

Expand Down Expand Up @@ -492,7 +492,7 @@ not contributing to the funding output.
2. types:
1. type: 0 (`funding_output_contribution`)
2. data:
* [`i64`:`satoshis`]
* [`s64`:`satoshis`]

#### Requirements

Expand Down

0 comments on commit 34e7787

Please sign in to comment.