Skip to content

Instantly share code, notes, and snippets.

@jcramer
Last active November 7, 2018 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcramer/33fc22b73cc234215c4ceac3e787305d to your computer and use it in GitHub Desktop.
Save jcramer/33fc22b73cc234215c4ceac3e787305d to your computer and use it in GitHub Desktop.
P2SH.cash SLP Token Document Schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://p2sh.cash/p2sh.token.schema.json",
"title": "P2SH.cash Token Document JSON Schema",
"description": "Definition file for P2SH.cash SLP token documents that is used to store P2SH variables.",
"type": "object",
"properties": {
"v": {
"type": "integer",
"description": "Version of P2SH.cash Token Document"
},
"o": {
"type": "array",
"description": "The P2SH addresses being specified",
"items": {
"type":"object",
"properties": {
"addr": {
"type": "string",
"description": "If the P2SH outputs are not included with the token Genesis then the txid containing the P2SH outputs may be defined.",
"pattern": "^(bitcoincash:)|^(bchtest:)|^(simpleledger:)|^(slptest:)"
},
"bst" : {
"type" : "object",
"description" : "Properties for the BST template defining the P2SH output",
"properties" : {
"uri" : {
"type" : "string",
"description" : "Storage location of the BST document.",
"pattern" : "^(bitcoinfile:)|^(http:)|^(https:)"
},
"req" : {
"type" : "array",
"description" : "Sequential input requirements for the BST to reconstructing the P2SH pre-image",
"items": [
{
"type" : "object",
"description" : "A user defined opcode setting (as integer)",
"properties" : {
"t": {
"type" : "string",
"pattern" : "opcode-integer"
},
"n": {
"type" : "string",
"description": "Name of the user defined opcode matching the BST template"
},
"v": {
"type" : "integer",
"description": "Value of the user defined opcode applied to the BST template",
"pattern": "[0-9]+"
}
},
"required": [ "t", "n", "v" ]
},
{
"type" : "object",
"description" : "A user defined opcode setting (as string)",
"properties" : {
"t": {
"type" : "string",
"pattern" : "opcode-string"
},
"n": {
"type" : "string",
"description": "Name of the user defined opcode matching the BST template"
},
"v": {
"type" : "string",
"description": "Value of the user defined opcode applied to the BST template",
"pattern": "^(OP_){1}"
}
},
"required": [ "t", "n", "v" ]
},
{
"type" : "object",
"description": "A user defined data push",
"properties": {
"t": {
"type":"string",
"pattern": "pushdata"
},
"v": {
"type":"string",
"description": "Hexidecimal data to be pushed onto the stack",
"pattern": "[a-f]|[A-F]|[0-9]{2}+"
}
},
"required": [ "t", "v" ]
}
]
}
},
"required": [
"uri", "req"
]
}
},
"required": [
"vout", "bst"
]
}
}
},
"required": [
"o"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment