Skip to content

Commit

Permalink
nut13 specify keyset ID integer size: 32 bits
Browse files Browse the repository at this point in the history
  • Loading branch information
vnprc committed Nov 12, 2024
1 parent 14bd2ff commit aecde9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 13.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The wallet starts with `counter_k := 0` upon encountering a new keyset and incre

#### Keyset ID

The integer representation `keyset_id_int` of a keyset is calculated from its [hexadecimal ID][02] which has a length of 8 bytes or 16 hex characters. First, we convert the hex string to a big-endian sequence of bytes. This value is then modulo reduced by `2^31 - 1` to arrive at an integer that is a unique identifier `keyset_id_int`.
The 32 bit integer representation `keyset_id_int` of a keyset is calculated from its [hexadecimal ID][02] which has a length of 8 bytes or 16 hex characters. First, we convert the hex string to a big-endian sequence of bytes. This value is then modulo reduced by `2^31 - 1` to arrive at an integer that is a unique identifier `keyset_id_int`.

Example in Python:
```python
Expand Down

0 comments on commit aecde9f

Please sign in to comment.