{
"id": "games.atplay.calculation.randomNumber",
"defs": {
"main": {
"type": "object",
"required": [
"id",
"under",
"inputs"
],
"properties": {
"id": {
"type": "string",
"maxLength": 32,
"description": "An ID used by the game logic to find transient data when needed"
},
"under": {
"type": "integer",
"description": "The number which this random number will be under (eg. coin toss = 2, dice roll = 6)"
},
"inputs": {
"type": "array",
"items": {
"type": "object",
"required": [
"player"
],
"properties": {
"hash": {
"type": "string",
"maxLength": 64,
"description": "A multibase, multihash that will be used in the calculation"
},
"value": {
"type": "string",
"maxLength": 64,
"description": "A multibase, multiformat encoded value that will be used in the calculation"
},
"player": {
"type": "string",
"format": "did",
"description": "The player who contributed this input"
}
},
"description": "A hashed or cleartext value used in a calculation. A hash, value, or both must be present, and all hashes must be revealed by a value (for verification) at some point during the game"
},
"description": "The inputs needed to complete the calculation at its various stages, one per player"
},
"result": {
"type": "integer",
"description": "Holds the result of the calculation, so that it can be validated easily. Should always be present once the calculation is completable"
}
},
"description": "Data needed for the players to coordinate generating a trusted random number together, eg. dice rolls, who plays first, shuffling cards"
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}