Verify query commitment
A query proof can be stored long-term and then disputed at a later point using this endpoint.
Example request:
{
"input": {
"query": "select event_time, from, to, close from \"kamu/eth-to-usd\"",
"queryDialect": "SqlDataFusion",
"dataFormat": "JsonAoA",
"include": ["Input", "Proof", "Schema"],
"schemaFormat": "ArrowJson",
"datasets": [{
"id": "did:odf:fed0..26c4",
"alias": "kamu/eth-to-usd",
"blockHash": "f162..9a1a"
}],
"skip": 0,
"limit": 3
},
"subQueries": [],
"commitment": {
"inputHash": "f162..2efc",
"outputHash": "f162..b088",
"subQueriesHash": "f162..d210"
},
"proof": {
"type": "Ed25519Signature2020",
"verificationMethod": "did:key:z6Mk..fwZp",
"proofValue": "uJfY..seCg"
}
}
Example response:
{
"ok": false,
"error": {
"kind": "VerificationFailed::OutputMismatch",
"actual_hash": "f162..c12a",
"expected_hash": "f162..2a2d",
"message": "Query was reproduced but resulted in output hash different from expected.
This means that the output was either falsified, or the query
reproducibility was not guaranteed by the system.",
}
}
See commitments documentation for details.
Request body
Example request
{
"commitment": {
"inputHash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb",
"outputHash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb",
"subQueriesHash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb"
},
"input": {
"datasets": [
{
"alias": "kamu/eth-to-usd",
"blockHash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb",
"id": "did:odf:fed01969b7413a41f25ba969b7413a41f25ba4016461736574607650ec170632ade10"
}
],
"query": "select event_time, from, to, close from \"kamu/eth-to-usd\""
},
"proof": {
"proofValue": "uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"verificationMethod": "did:key:z6MkmgVreHBu2ABaD59Jq1J2JneXwzpsUWwEWXS4kLhjb4V4"
},
"subQueries": []
}Response
Example response
{
"error": {
"actual_hash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb",
"expected_hash": "f162070983d692f648185febe6d6fa607630ae68649f7e6fc45b94680096c06e4fadb"
}
}Changes
Changed in 3 of the 53 revisions of this API.66
- ○
added the new
EcdsaSecp256k1Signature2019enum value to the request propertyproof/typerequest-property-enum-value-added
- ○
added the new
EcdsaSecp256k1Signature2019enum value to the request propertysubQueries/items/proof/typerequest-property-enum-value-added
- ○
- ○
added the new
OdfJsonenum value to the request propertyinput/schemaFormatrequest-property-enum-value-added
- ○
added the new
OdfJsonenum value to the request propertysubQueries/items/input/schemaFormatrequest-property-enum-value-added
- ○
added the new
OdfYamlenum value to the request propertyinput/schemaFormatrequest-property-enum-value-added
- ○
added the new
OdfYamlenum value to the request propertysubQueries/items/input/schemaFormatrequest-property-enum-value-added
- ○
- ▲
removed the enum value
EcdsaSecp256k1Signature2019of the request propertyproof/typerequest-property-enum-value-removed
- ▲
removed the enum value
EcdsaSecp256k1Signature2019of the request propertysubQueries/items/proof/typerequest-property-enum-value-removed
- ▲
removed the enum value
OdfJsonof the request propertyinput/schemaFormatrequest-property-enum-value-removed
- ▲
removed the enum value
OdfJsonof the request propertysubQueries/items/input/schemaFormatrequest-property-enum-value-removed
- ▲
removed the enum value
OdfYamlof the request propertyinput/schemaFormatrequest-property-enum-value-removed
- ▲
removed the enum value
OdfYamlof the request propertysubQueries/items/input/schemaFormatrequest-property-enum-value-removed
This revision also has 7 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ▲