-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathni.identifier.txt
47 lines (41 loc) · 2.94 KB
/
ni.identifier.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
┏━━━━━━━━┓
┃ NI ┃
┗━━━━━━━━┛
GOAL ==> #"Named information" that describes a resource identity and content using a hash
#Can be:
# - ni: URI scheme: usual URI
# - nih: URI scheme: easy to spell out
# - binary format
NI URI SCHEME ==> #ni://[AUTHORITY]/ALGO;HASH[?VAR=VAL&...][#FRAGMENT]
# - AUTHORITY:
# - can be used for metadata/location purpose
# - but two resources with same HASH but different AUTHORITY must be considered the same resource
# - so cannot be used to decrease collision
# - ALGO:
# - sha-256[-32|64|96|120|128] (at least one mandatory)
# - any other optional, including truncated hashes
# - HASH:
# - of content, base64'd (base64url, without = padding)
# - for X.509 public keys, content should be SubjectPublicKeyInfo
# - checking integrity is optional
# - VAR=VAL:
# - ct=MIMETYPE (at least application/octet-stream must be supported)
# - anything else for location/metadata
# - FRAGMENT: like normal URI
RESOLUTION ==> #Can use:
# - http[s]://[AUTHORITY]/.well-known/ni/ALGO/HASH[?VAR=VAL&...]:
# - should redirect with 3xx
NIH URI SCHEME ==> #nih:ALGO[_ID];HASH[;CHECKSUM]
# - ALGO[_ID]
# - HASH:
# - use lowercase hex
# - can add non-significant dashes in-between groups of chars
# - CHECKSUM:
# - one hex character
# - checksum of HASH hex characters (without dashes)
# - use Luhn mod 16 algo (see doc)
# - no AUTHORITY, QUERY nor FRAGMENT
BINARY FORMAT ==> #Instead of URI, binary:
# - 0.0-1: reserved (set to 0)
# - 0.2-7: ALGO_ID: 1 for sha-256, 2-6 for sha-256-128|120|96|64|32
# - 1.*: HASH, e.g. -8 bits truncation of SHA