-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathdpns-contract-documents.json
133 lines (133 loc) · 4.47 KB
/
dpns-contract-documents.json
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
{
"domain": {
"indices": [
{
"properties": [
{
"normalizedParentDomainName": "asc"
},
{
"normalizedLabel": "asc"
}
],
"unique": true
},
{
"properties": [
{
"records.dashUniqueIdentityId": "asc"
}
],
"unique": true
}
],
"properties": {
"label": {
"type": "string",
"pattern": "^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9])$",
"minLength": 3,
"maxLength": 63,
"description": "Domain label. e.g. 'Bob'."
},
"normalizedLabel": {
"type": "string",
"pattern": "^((?!-)[a-z0-9-]{0,62}[a-z0-9])$",
"maxLength": 63,
"description": "Domain label in a lower case for case insensitive uniqueness validation. e.g. 'bob'",
"$comment": "This property will be deprecated due to case insensitive indices. Must be equal to label in lowercase"
},
"normalizedParentDomainName": {
"type": "string",
"pattern": "^$|^((?!-)[a-z0-9-\\.]{0,189}[a-z0-9])$",
"minLength": 0,
"maxLength": 190,
"description": "A full parent domain name in lower case for case insensitive uniqueness validation. e.g. 'dash'",
"$comment": "Must be equal to existing domain or can be empty if you want to create a top level domain. Only the contract owner can create top level domains"
},
"preorderSalt": {
"type": "string",
"contentEncoding": "base64",
"minLength": 43,
"maxLength": 43,
"pattern": "^([A-Za-z0-9+/])*$",
"description": "Domain pre-order salt. 32 random bytes"
},
"records": {
"type": "object",
"properties": {
"dashUniqueIdentityId": {
"type": "string",
"minLength": 42,
"maxLength": 44,
"pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$",
"description": "Identity ID string should be used to create a primary name for Identity. base58 string",
"$comment": "Should be equal to the document owner"
},
"dashAliasIdentityId": {
"type": "string",
"minLength": 42,
"maxLength": 44,
"pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$",
"description": "Identity ID string should be used to create multiple alias names for Identity. base58 string",
"$comment": "Should be equal to the document owner"
}
},
"$comment": "Constraint with max and min properties ensure that only one identity record is used either `dashUniqueIdentityId` or `dashAliasIdentityId`",
"minProperties": 1,
"maxProperties": 1,
"additionalProperties": false
},
"subdomainRules": {
"type": "object",
"properties": {
"allowSubdomains": {
"type": "boolean",
"description": "This option defines who can create subdomains"
}
},
"description": "Subdomain rules allows to define rules for subdomains",
"additionalProperties": false,
"required": [
"allowSubdomains"
]
}
},
"required": [
"label",
"normalizedLabel",
"normalizedParentDomainName",
"preorderSalt",
"records",
"subdomainRules"
],
"additionalProperties": false,
"$comment": "In order to register domain you need to create a preorder. The preorder step is needed to prevent man-in-the-middle attacks. normalizedLabel + '.' + normalizedParentDomain must not be longer than 253 chars length as defined by RFC 1035. Domain documents are immutable: modification and deletion are restricted"
},
"preorder": {
"indices": [
{
"properties": [
{
"saltedDomainHash": "asc"
}
],
"unique": true
}
],
"properties": {
"saltedDomainHash": {
"type": "string",
"contentEncoding": "base64",
"minLength": 43,
"maxLength": 43,
"pattern": "^([A-Za-z0-9+/])*$",
"description": "Double sha-256 of concatenated salt, `normalizedLabel` and `normalizedParentDomainName`. Salt should be 32 random bytes"
}
},
"required": [
"saltedDomainHash"
],
"additionalProperties": false,
"$comment": "Preorder documents are immutable: modification and deletion are restricted"
}
}