Skip to content

wip: named offsets experiment#811

Open
charmful0x wants to merge 5 commits intoneo/edgefrom
feat/named-offsets
Open

wip: named offsets experiment#811
charmful0x wants to merge 5 commits intoneo/edgefrom
feat/named-offsets

Conversation

@charmful0x
Copy link
Copy Markdown

@charmful0x charmful0x commented Mar 31, 2026

About

deterministic, HRA names (aliases) for ~arweave@2.9 offsets. the names are derived from the offset itself and take the form:

<adjective>-<noun>-<base32-offset>

For example:
386268681550466 -> frozen-campfire-az9wqrtem2

the trailing base32 segment is canonical and sufficient to recover the exact offset. The two words are a checksum-like human layer derived from the offset.

The resolver works by:

  • decoding the alias back to its canonical offset
  • validating that the words match the decoded offset
  • delegating the actual load to ~arweave@2.9

This means that:

  • each offset has exactly one canonical alias under the current word lists
  • aliases remain reversible without a registry
  • ~arweave@2.9 remains the canonical offset resolver

the current dictionary fixed-word pools contain 100 adjectives and 100 nouns, giving 10k HRA word pairs. N.B: updating the dictionary means new alias for an offset (breaks the pre-change dictionary resolved aliases, so if we change the dict in prod, we need to version it with something like v1-word1-word2-base32offset

Alias construction

  • compute sha256(integer_to_binary(Offset))
  • use the first byte of the hash, modulo the adjective list length, to choose the adjective
  • use the second byte of the hash, modulo the noun list length, to choose the noun
  • encode the offset itself as a lowercase base32 tail
  • join the three parts with -

Alias reverse-resolving

  • split the alias into <adjective>-<noun>-<tail>
  • decode the lowercase base32 tail back into the numeric offset
  • recompute the canonical alias from that offset
  • accept only if the recomputed alias exactly matches the input
  • resolve the resulting offset through ~arweave@2.9

HTTP API

  • offset -> alias resolver: http://localhost:8734/~offset-name@1.0/alias/152974576623958
  • alias -> offset reverse resolver: http://localhost:8734/~offset-name@1.0/offset/ocean-tower-4b44nms8ap
image
======================== EUnit ========================
module 'dev_offset_name'
dev_offset_name: roundtrip_test...ok
dev_offset_name: word_pool_size_test...ok
dev_offset_name: format_shape_test...ok
dev_offset_name: uppercase_alias_rejected_test...ok
dev_offset_name: invalid_alias_test...ok
dev_offset_name: leading_zero_tail_rejected_test...ok
dev_offset_name: get_delegates_to_offset_target_test...[0.018 s] ok
dev_offset_name: reverse_alias_resolve_test...ok
dev_offset_name: reverse_known_alias_fixture_test...ok
dev_offset_name: name_resolver_lookup_test...[0.002 s] ok
[done in 0.050 s]
=======================================================
All 10 tests passed.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant