# Flake IDs

PayNow uses [Snowflake IDs](https://en.wikipedia.org/wiki/Snowflake_ID) (shorted to "flake" in our system) for everything that requires a unique identifier. These IDs are unique across the entire system.

Because our implementation uses signed 64-bit integers (`int64`), they are always returned as a strings in our API to prevent overflows in inferior languages. In our documentation we label ID fields with the `flake` type. When calling routes that expect a `flake`, you should always send it in string form.

#### Flake ID in Binary

```
sign  timestamp                                  node       increment
0     11111111111111111111111111111111111111111  1111111111 111111111111
64    63                                         22         12          0
```

#### PayNow Epoch

The timestamp component is offset by an epoch.

```yaml
Unix ms: 1645568542000
ISO8601: 2022-02-22T22:22:22.000Z
```

Convert ID to time:

```go
TimeFromUnixMillis((id >> 22) + epoch)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.paynow.gg/getting-started/flake-ids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
