<!-- XE-0064 · openapi: uint64 fields (timestamp, pow_nonce) typed as plain integer exceed 2^53; generated JS clients corrupt them and cannot verify block hashes (Medium) · testnet -->
*Markdown view of <https://bounty.xe.network/XE-0064>. The page is the record; this is the same page for reading.*

XE-0064 · Bounty

# openapi: uint64 fields (timestamp, pow\_nonce) typed as plain integer exceed 2^53; generated JS clients corrupt them and cannot verify block hashes (Medium)

Accepted
claimed Medium
[xe#87](https://github.com/xeprotocol/xe/issues/87)
filed 2026-10-26 21:28 UTC
by BoomGone

Verdict
:   published when the fix ships

Tier
:   published when the fix ships

Claimed
:   Medium

Area
:   SDK / docs / web

Duplicate of
:   —

Tracked
:   internally

Updated
:   2026-11-10 11:38 UTC

Told
:   2026-11-10 00:15 UTC

### Patches

- [xe#344](https://github.com/xeprotocol/xe/pull/344) open by ocakciomursel-pixel
  fix(core,web,docs): preserve 64-bit integer precision across JSON block parsing and unmarshaling (Fixes #87)

### History

- [86629](https://bounty.xe.network/log/86629) 2026-11-10 18:23 UTC patch.linked
- [61394](https://bounty.xe.network/log/61394) 2026-11-10 00:15 UTC reply.mirrored
- [61351](https://bounty.xe.network/log/61351) 2026-11-10 00:15 UTC reply.sent
- [17836](https://bounty.xe.network/log/17836) 2026-11-07 16:09 UTC proposal.adopted
- [17835](https://bounty.xe.network/log/17835) 2026-11-07 16:09 UTC ticket.award
- [17834](https://bounty.xe.network/log/17834) 2026-11-07 16:09 UTC proposal.rejected
- [6896](https://bounty.xe.network/log/6896) 2026-11-05 13:45 UTC proposal.created
- [1821](https://bounty.xe.network/log/1821) 2026-11-02 19:16 UTC proposal.created
- [1475](https://bounty.xe.network/log/1475) 2026-11-02 10:11 UTC note.added
- [785](https://bounty.xe.network/log/785) 2026-10-29 14:22 UTC note.added
- [784](https://bounty.xe.network/log/784) 2026-10-29 14:22 UTC ticket.facts area
- [597](https://bounty.xe.network/log/597) 2026-10-29 14:04 UTC github.labels

[Full history](https://bounty.xe.network/log?ref=XE-0064) · [JSON](https://bounty.xe.network/v1/tickets/XE-0064) · [markdown](https://bounty.xe.network/XE-0064.md)

### Report

- Suggested tier: Medium ("inconsistent API responses"), may be seen as related to #13
- Area: openapi.json field typing; every read endpoint that returns blocks
- Found: 2026-10-26, node `xe/92d83d1`, openapi.json 1.0.0

## Summary

Block `timestamp` (unix nanoseconds, about 1.79e18) and `pow_nonce` (up to 2^64-1) always exceed JavaScript's `Number.MAX_SAFE_INTEGER` (2^53-1 \= 9007199254740991). The OpenAPI document types them as plain `{"type": "integer"}` with no `format: int64`, no string representation, and no warning, and the API returns them as bare JSON numbers. Any client generated from the contract, or any client using standard `JSON.parse`, silently corrupts these values.

Because `timestamp` and `pow_nonce` are both inputs to the block hash preimage (`core/encoding.go`), a standard JS client that reads a block and tries to verify or re-derive its hash gets the wrong bytes and cannot verify ANY block. The official SDK avoids this only by shipping a custom lossless (bigint) JSON parser; the documented contract gives no signal that this is required.

## Evidence

Live value from `GET /blocks/recent`: `"timestamp":1793041910652017920`, `"pow_nonce":2032484613864776222`.

```
JSON.parse('{"timestamp":1793041910652017920,"pow_nonce":2032484613864776222}')
// -> timestamp 1793041910652018000   (wrong: last digits lost)
// -> pow_nonce 2032484613864776200   (wrong)
```

Spec (openapi.json 1.0.0, schema `Block`):

```
timestamp -> {"type":"integer","description":"Block time as unix nanoseconds."}
pow_nonce -> {"type":"integer","description":"Proof-of-work nonce ..."}
balance   -> {"type":"integer","minimum":0, ...}      // micro-units; can exceed 2^53 for large holdings
amount    -> {"type":"integer", ...}
```

No `format: int64`, no `type: string`, no note. A typical generator emits `number` for `integer`, so the corruption is silent.

## Impact

- Every non-SDK JS consumer of the API corrupts `timestamp` and `pow_nonce` on every block, and `balance`/`amount` once they pass 2^53 micro-units.
- Block hash verification is impossible for such a client, since the corrupted timestamp/nonce change the preimage. This defeats the point of exposing the fields.
- #13 (explorer rounds pow\_nonce) is one downstream symptom of this same contract defect; this report is the contract-level cause plus the hash-verification consequence.
- No fund risk.

## Suggested fix

- Mark these fields `format: int64` and, better for JSON, serialise uint64 fields as strings (as many chains do) or document that clients MUST use a lossless parser. Whichever is chosen, the contract should signal it so generated clients do not silently corrupt data.

## Payout

XE address: `6591eab453dbd93b27e2cd674712f94b42d9e7e4d52980b966fa6da4ccd832dc` (same as #75).

### Thread

**XE desk**team2026-11-10 00:15 UTCgithub

Read and accepted. It is tracked internally and the fix will land in a public PR; this issue is
updated when it does, and the tier and award follow the fix. The desk entry is https://bounty.xe.network/XE-0064.
