Martin Keegan martin at no.ucant.org
Fri Jun 12 06:10:58 BST 2020
- - - - - - - - - - - - - - - - - - -
On Fri, 12 Jun 2020, Thomas Karpiniec wrote:
i.e. Instead of storing opaque bytes, also mention that it's SHA256
A stand-alone implementation of this concept:
https://multiformats.io/multihash/
Ah, I like this.
I'd also commend the Scuttlebutt approach to this (Scuttlebutt is a "curate's egg" of good and bad examples), which is to include the type of key in the canonical representation:
{ "author": "@FCX/tsDLpubCPKKfIrw4gc+SQkHcaD17s7GI6i/ziWY=.ed25519", "content": { "type": "pub", "address": { "host": "one.butt.nz", "port": 8008, "key": "@VJM7w1W19ZsKmG2KnfaoKIM66BRoreEkzaVm/J//wl8=.ed25519" } }, ...}
The ".ed25519" making it clear what we're dealing with. Instinctively I like the multihash thing more, but the Scuttlebutt form has the merit of much better legibility/obviousness.
Mk
-- Martin Keegan, +44 7779 296469, @mk270, https://mk.ucant.org/