| 1 | [ |
| 2 | { |
| 3 | "description": "complex schema from jsck benchmark (https://github.com/pandastrike/jsck)", |
| 4 | "schema": { |
| 5 | "$id": "http://example.com/complex3.json", |
| 6 | "type": "array", |
| 7 | "items": {"$ref": "#transaction"}, |
| 8 | "minItems": 1, |
| 9 | "definitions": { |
| 10 | "base58": { |
| 11 | "$id": "#base58", |
| 12 | "type": "string", |
| 13 | "pattern": "^[123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]+$" |
| 14 | }, |
| 15 | "hex": { |
| 16 | "$id": "#hex", |
| 17 | "type": "string", |
| 18 | "pattern": "^[0123456789A-Fa-f]+$" |
| 19 | }, |
| 20 | "tx_id": { |
| 21 | "$id": "#tx_id", |
| 22 | "allOf": [ |
| 23 | {"$ref": "#hex"}, |
| 24 | { |
| 25 | "minLength": 64, |
| 26 | "maxLength": 64 |
| 27 | } |
| 28 | ] |
| 29 | }, |
| 30 | "address": { |
| 31 | "$id": "#address", |
| 32 | "allOf": [ |
| 33 | {"$ref": "#base58"}, |
| 34 | { |
| 35 | "minLength": 34, |
| 36 | "maxLength": 34 |
| 37 | } |
| 38 | ] |
| 39 | }, |
| 40 | "signature": { |
| 41 | "$id": "#signature", |
| 42 | "allOf": [ |
| 43 | {"$ref": "#hex"}, |
| 44 | { |
| 45 | "minLength": 128, |
| 46 | "maxLength": 128 |
| 47 | } |
| 48 | ] |
| 49 | }, |
| 50 | "transaction": { |
| 51 | "$id": "#transaction", |
| 52 | "additionalProperties": false, |
| 53 | "required": ["metadata", "hash", "inputs", "outputs"], |
| 54 | "properties": { |
| 55 | "metadata": { |
| 56 | "type": "object", |
| 57 | "required": ["amount", "fee"], |
| 58 | "properties": { |
| 59 | "amount": { |
| 60 | "type": "integer" |
| 61 | }, |
| 62 | "fee": { |
| 63 | "type": "integer", |
| 64 | "multipleOf": 10000 |
| 65 | }, |
| 66 | "status": { |
| 67 | "type": "string", |
| 68 | "enum": ["unsigned", "unconfirmed", "confirmed", "invalid"] |
| 69 | }, |
| 70 | "confirmations": { |
| 71 | "type": "integer", |
| 72 | "minimum": 0 |
| 73 | }, |
| 74 | "block_time": { |
| 75 | "type": "integer" |
| 76 | } |
| 77 | } |
| 78 | }, |
| 79 | "version": { |
| 80 | "type": "integer" |
| 81 | }, |
| 82 | "lock_time": { |
| 83 | "type": "integer" |
| 84 | }, |
| 85 | "hash": {"$ref": "#tx_id"}, |
| 86 | "inputs": { |
| 87 | "type": "array", |
| 88 | "items": {"$ref": "#input"}, |
| 89 | "minItems": 1 |
| 90 | }, |
| 91 | "outputs": { |
| 92 | "type": "array", |
| 93 | "items": {"$ref": "#output"}, |
| 94 | "minItems": 1 |
| 95 | } |
| 96 | } |
| 97 | }, |
| 98 | "input": { |
| 99 | "$id": "#input", |
| 100 | "type": "object", |
| 101 | "additionalProperties": false, |
| 102 | "required": ["index", "output", "script_sig"], |
| 103 | "properties": { |
| 104 | "index": { |
| 105 | "type": "integer", |
| 106 | "minimum": 0 |
| 107 | }, |
| 108 | "output": {"$ref": "#output"}, |
| 109 | "sig_hash": {"$ref": "#hex"}, |
| 110 | "script_sig": {"$ref": "#hex"}, |
| 111 | "signatures": { |
| 112 | "type": "object", |
| 113 | "description": "A dictionary of signatures. Keys represent keypair names", |
| 114 | "minProperties": 1, |
| 115 | "maxProperties": 3, |
| 116 | "additionalProperties": {"$ref": "#signature"} |
| 117 | } |
| 118 | } |
| 119 | }, |
| 120 | "output": { |
| 121 | "$id": "#output", |
| 122 | "type": "object", |
| 123 | "additionalProperties": false, |
| 124 | "required": ["hash", "index", "value", "script"], |
| 125 | "properties": { |
| 126 | "hash": {"$ref": "#tx_id"}, |
| 127 | "index": { |
| 128 | "type": "integer", |
| 129 | "minimum": 0 |
| 130 | }, |
| 131 | "value": { |
| 132 | "type": "integer" |
| 133 | }, |
| 134 | "script": { |
| 135 | "type": "object", |
| 136 | "properties": { |
| 137 | "type": { |
| 138 | "type": "string", |
| 139 | "enum": ["standard", "p2sh"] |
| 140 | }, |
| 141 | "asm": { |
| 142 | "type": "string" |
| 143 | } |
| 144 | } |
| 145 | }, |
| 146 | "address": {"$ref": "#address"}, |
| 147 | "metadata": { |
| 148 | "type": "object", |
| 149 | "dependencies": { |
| 150 | "wallet_path": ["public_seeds"] |
| 151 | }, |
| 152 | "properties": { |
| 153 | "wallet_path": { |
| 154 | "type": "string" |
| 155 | }, |
| 156 | "public_seeds": { |
| 157 | "type": "object", |
| 158 | "minProperties": 1, |
| 159 | "maxProperties": 3, |
| 160 | "additionalProperties": { |
| 161 | "anyOf": [{"$ref": "#base58"}, {"$ref": "#hex"}] |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | } |
| 169 | }, |
| 170 | "tests": [ |
| 171 | { |
| 172 | "description": "valid array from jsck benchmark", |
| 173 | "data": [ |
| 174 | { |
| 175 | "metadata": { |
| 176 | "amount": 38043749285, |
| 177 | "fee": 20000, |
| 178 | "status": "confirmed", |
| 179 | "confirmations": 73, |
| 180 | "block_time": 1415993584376 |
| 181 | }, |
| 182 | "version": 1, |
| 183 | "lock_time": 0, |
| 184 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 185 | "inputs": [ |
| 186 | { |
| 187 | "index": 0, |
| 188 | "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01", |
| 189 | "signatures": { |
| 190 | "primary": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a7", |
| 191 | "cosigner": "a2ad5ebf16dadf9d357ef2867cb9b1de682b336db000b6e0012200ebda7c8802f7c5ea2afd97439840a191c756be6528521b214487d5fc79796eb00122064037" |
| 192 | }, |
| 193 | "output": { |
| 194 | "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d", |
| 195 | "index": 1, |
| 196 | "value": 38043749285, |
| 197 | "script": { |
| 198 | "type": "standard", |
| 199 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | ], |
| 204 | "outputs": [ |
| 205 | { |
| 206 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 207 | "index": 0, |
| 208 | "value": 38042249285, |
| 209 | "script": { |
| 210 | "type": "standard", |
| 211 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 212 | }, |
| 213 | "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1", |
| 214 | "metadata": { |
| 215 | "type": "change", |
| 216 | "wallet_path": "m/44/0/1/356", |
| 217 | "public_seeds": { |
| 218 | "primary": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8", |
| 219 | "cosigner": "xpub661MyMwAqRbcFtXgS5sYJABqqG9YLmC4Q1Rdap9gSE8NqtwybGhePY2gZ29ESFjqJoCu1Rupje8YtGqsefD265TMg7usUDFdp6W1EGMcet8" |
| 220 | } |
| 221 | } |
| 222 | }, |
| 223 | { |
| 224 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 225 | "index": 1, |
| 226 | "value": 1500000, |
| 227 | "script": { |
| 228 | "type": "standard", |
| 229 | "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG" |
| 230 | }, |
| 231 | "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT" |
| 232 | } |
| 233 | ] |
| 234 | }, |
| 235 | { |
| 236 | "metadata": { |
| 237 | "amount": 38043749285, |
| 238 | "fee": 20000, |
| 239 | "status": "unconfirmed", |
| 240 | "confirmations": 73, |
| 241 | "block_time": 1415993584376 |
| 242 | }, |
| 243 | "version": 1, |
| 244 | "lock_time": 0, |
| 245 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 246 | "inputs": [ |
| 247 | { |
| 248 | "index": 0, |
| 249 | "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01", |
| 250 | "output": { |
| 251 | "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d", |
| 252 | "index": 1, |
| 253 | "value": 38043749285, |
| 254 | "script": { |
| 255 | "type": "standard", |
| 256 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 257 | } |
| 258 | } |
| 259 | } |
| 260 | ], |
| 261 | "outputs": [ |
| 262 | { |
| 263 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 264 | "index": 0, |
| 265 | "value": 38042249285, |
| 266 | "script": { |
| 267 | "type": "standard", |
| 268 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 269 | }, |
| 270 | "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1", |
| 271 | "metadata": { |
| 272 | "type": "change" |
| 273 | } |
| 274 | }, |
| 275 | { |
| 276 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 277 | "index": 1, |
| 278 | "value": 1500000, |
| 279 | "script": { |
| 280 | "type": "standard", |
| 281 | "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG" |
| 282 | }, |
| 283 | "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT" |
| 284 | } |
| 285 | ] |
| 286 | }, |
| 287 | { |
| 288 | "metadata": { |
| 289 | "amount": 38043749285, |
| 290 | "fee": 20000, |
| 291 | "status": "unconfirmed", |
| 292 | "confirmations": 73, |
| 293 | "block_time": 1415993584376 |
| 294 | }, |
| 295 | "version": 1, |
| 296 | "lock_time": 0, |
| 297 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 298 | "inputs": [ |
| 299 | { |
| 300 | "index": 0, |
| 301 | "script_sig": "3046022100be69797cf5d784412b1258256eb657c191a04893479dfa2ae5c7f2088c7adbe0022100e6b000bd633b286ed1b9bc7682fe753d9fdad61fbe5da2a6e9444198e33a670f01", |
| 302 | "output": { |
| 303 | "hash": "6b040cd7a4676b5c7b11f144e73c1958c177fcd79e934f6be8ce02c8cd12546d", |
| 304 | "index": 1, |
| 305 | "value": 38043749285, |
| 306 | "script": { |
| 307 | "type": "standard", |
| 308 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | ], |
| 313 | "outputs": [ |
| 314 | { |
| 315 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 316 | "index": 0, |
| 317 | "value": 38042249285, |
| 318 | "script": { |
| 319 | "type": "standard", |
| 320 | "asm": "OP_DUP OP_HASH160 7d4e6d55e1dffb0df85f509343451d170d147551 OP_EQUALVERIFY OP_CHECKSIG" |
| 321 | }, |
| 322 | "address": "1CRZRBwfuwUaVSPJtd6DBuezbm7XPBHLa1", |
| 323 | "metadata": { |
| 324 | "type": "change" |
| 325 | } |
| 326 | }, |
| 327 | { |
| 328 | "hash": "60c1f1a3160042152114e2bba45600a5045711c3a8a458016248acec59653471", |
| 329 | "index": 1, |
| 330 | "value": 1500000, |
| 331 | "script": { |
| 332 | "type": "standard", |
| 333 | "asm": "OP_DUP OP_HASH160 3bc576e6960a9d45201ba5087e39224d0a05a079 OP_EQUALVERIFY OP_CHECKSIG" |
| 334 | }, |
| 335 | "address": "16T3RPZLmxtXQCgWi1S8kef5Ca6jqXhoeT" |
| 336 | } |
| 337 | ] |
| 338 | } |
| 339 | ], |
| 340 | "valid": true |
| 341 | }, |
| 342 | { |
| 343 | "description": "not array", |
| 344 | "data": 1, |
| 345 | "valid": false |
| 346 | } |
| 347 | ] |
| 348 | } |
| 349 | ] |