Skip to content

docs(decimal-precision): add decimal precision analysis doc#113

Open
glevco wants to merge 1 commit into
masterfrom
docs/decimal/analysis
Open

docs(decimal-precision): add decimal precision analysis doc#113
glevco wants to merge 1 commit into
masterfrom
docs/decimal/analysis

Conversation

@glevco
Copy link
Copy Markdown
Contributor

@glevco glevco commented May 14, 2026

@glevco glevco self-assigned this May 14, 2026
@glevco glevco moved this from Todo to In Progress (WIP) in Hathor Network May 14, 2026
@glevco glevco force-pushed the docs/decimal/analysis branch 5 times, most recently from 6198b63 to 749d119 Compare May 14, 2026 23:50
@glevco glevco force-pushed the docs/decimal/analysis branch from 749d119 to d8cd007 Compare May 14, 2026 23:51
@glevco glevco moved this from In Progress (WIP) to In Review (Done) in Hathor Network May 14, 2026
@glevco glevco moved this from In Review (Done) to In Progress (Done) in Hathor Network May 14, 2026
Copy link
Copy Markdown

@trondbjoroy trondbjoroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The technical tradeoff looks to be essentially free so we can base our decision on business and ecosystem needs. From that perspective, I agree with 18 decimals. 3 main reasons for that:

  • EVM compatibility. Nearly all EVM tokens default to 18 decimals as it's the default in OpenZeppelin contracts. Bridging any of them to Hathor without a 1:1 decimal match would require truncation or rounding, introducing precision loss and potential trust issues as users expect exact amounts.

  • Integration cost reduction. Developers bridging EVM assets or building cross-chain applications would need to handle decimal conversion logic if we used 8 decimals.

  • Avoiding a second migration. Going to 8 decimals and later finding it insufficient for EVM would mean a second protocol change.

@obiyankenobi
Copy link
Copy Markdown
Member

I also agree with 18 decimals, given the analysis.

One other question: I imagine network impact is also minimal, right? That could impact TPS. I mean, it will just be a couple of extra bytes per tx.

@glevco glevco moved this from In Progress (Done) to In Review (WIP) in Hathor Network May 15, 2026
@glevco
Copy link
Copy Markdown
Contributor Author

glevco commented May 15, 2026

@obiyankenobi

One other question: I imagine network impact is also minimal, right? That could impact TPS. I mean, it will just be a couple of extra bytes per tx.

Yes, it would be at most 5 extra bytes per output, for extremely large values (comparing 13 bytes to 8 bytes of the current encoding of large values). This is small in comparison to other recent additions to transaction size, such as headers (nano, fees), and shielded outputs in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review (WIP)

Development

Successfully merging this pull request may close these issues.

3 participants