Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ans: Implement enhanced serialization to reduce blockchain space used #189

Open
alamshafil opened this issue Nov 2, 2022 · 0 comments · May be fixed by #194
Open

ans: Implement enhanced serialization to reduce blockchain space used #189

alamshafil opened this issue Nov 2, 2022 · 0 comments · May be fixed by #194
Labels
enhancement New feature or request
Milestone

Comments

@alamshafil
Copy link
Contributor

Right now ANS (Avian Name System) is serialized directly into ASCII hex, using valuable blockchain space. The less space used, the more scalable ANS is.

Right now to serialize ANS17f00000 will look like:

414E533137663030303030

Which is longer then the actual ID.

It is proposed to use a custom format to serialize different types of ANS IDs (which will introduce slight overhead but reduce space used).

To serialize ANS17f00000 in the new format:

17F00000

There is no need to encode the prefix since we know it will be ANS data and therefore we only need the type hex and IPv4 in hex.

Old format for ANS0RXBurnXXXXXXXXXXXXXXXXXXXXXXWUo9FV:

414E533052584275726E5858585858585858585858585858585858585858585857556F394656

New format for ANS0RXBurnXXXXXXXXXXXXXXXXXXXXXXWUo9FV:

03cf05325e90d5211def86b856c9569e5480820129092d35be8

For serializing, use the raw hex of the Base58 string.

It is important that encoding/decoding these ANS IDs are fast and safe.

@alamshafil alamshafil added the enhancement New feature or request label Nov 2, 2022
@alamshafil alamshafil added this to the v4.2.0 milestone Nov 2, 2022
@alamshafil alamshafil linked a pull request Nov 8, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant