-
Notifications
You must be signed in to change notification settings - Fork 21
/
did.abnf
50 lines (41 loc) · 2.05 KB
/
did.abnf
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
48
49
50
; This document combines information from the DID, URI and ABNF specifications
; to describe a complete grammar for did and did-reference strings.
;
; DID Spec: https://w3c-ccg.github.io/did-spec/#the-generic-did-scheme
; URI Spec: https://tools.ietf.org/html/rfc3986
; ABNF Spec: https://tools.ietf.org/html/rfc5234
did = "did:" method-name ":" method-specific-id
method-name = 1*method-char
method-char = %x61-7A / DIGIT
method-specific-id = *idchar *( ":" *idchar )
idchar = ALPHA / DIGIT / "." / "-" / "_"
did-url = did *( ";" param ) path-abempty [ "?" query ]
[ "#" fragment ]
param = param-name [ "=" param-value ]
param-name = 1*param-char
param-value = *param-char
param-char = ALPHA / DIGIT / "." / "-" / "_" / ":" /
pct-encoded
; A generic DID path is identical to a URI path and MUST conform to the path-abempty ABNF rule in [RFC3986]
; https://tools.ietf.org/html/rfc3986#section-3.3
path-abempty = *( "/" segment )
; A generic DID fragment is identical to a URI fragment and MUST conform to the fragment ABNF rule in [RFC3986]
; https://tools.ietf.org/html/rfc3986#section-3.5
fragment = *( pchar / "/" / "?" )
; A generic DID query is identical to a URI query and MUST conform to the query ABNF rule in [RFC3986]
; https://tools.ietf.org/html/rfc3986#section-3.4
query = *( pchar / "/" / "?" )
segment = *pchar
segment-nz = 1*pchar
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
pct-encoded = "%" HEXDIG HEXDIG
sub-delims = "!" / "$" / "&" / "'" / "(" / ")" / "*" / "+" / "," / ";" / "="
; https://tools.ietf.org/html/rfc5234
; ALPHA = %x41-5A / %x61-7A
; HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
; DIGIT = %x30-39
; http://www.columbia.edu/kermit/ascii.html
; 41-5A is big letters A-Z in US-ASCII
; 61-7A is small letters a-z in US-ASCII
; 30-39 is digits 0-9 in US-ASCII