macula_address (macula v4.2.7)
View Sourcemacula-net address derivation: pubkey -> IPv6.
Per the macula-net spec (PLAN_MACULA_NET.md §3.1):
addr = 0xfd | blake3(realm_master_pubkey)[0:40 bits]
| blake3(identity_pubkey)[0:80 bits]
Uses macula_blake3_nif:hash/1 for the BLAKE3 primitive — no new NIF; reuses the SDK's existing crypto layer.
Realm-scoped identity
An "identity" here is a realm-scoped Ed25519 keypair. A user/daemon in N realms holds N realm-scoped keypairs and gets N addresses (one per realm, all unlinkable at L3). See spec §3.6 for the full model.
Summary
Functions
Derive a macula-net IPv6 address from a realm + identity keypair.
Convenience: derive + format in one call.
Render a 16-byte IPv6 binary as RFC 5952 lowercase text.
Types
-type ipv6_address() :: <<_:128>>.
16-byte IPv6
-type ipv6_text() :: binary().
RFC 5952 lowercase
-type pubkey() :: <<_:256>>.
32-byte Ed25519 pubkey
Functions
-spec derive(RealmMasterPubkey :: pubkey(), IdentityPubkey :: pubkey()) -> ipv6_address().
Derive a macula-net IPv6 address from a realm + identity keypair.
Convenience: derive + format in one call.
-spec format(ipv6_address()) -> ipv6_text().
Render a 16-byte IPv6 binary as RFC 5952 lowercase text.