Authorization
A node can be configured with an authorization token. This can be done in case the api of the node is exposed publicly. Once the token is configured the anchoring of hash on the chain requires an authorization header
Copy Authorization: bearer <token>
Anchor a hash on the blockchain
POST
https://lto.example.com/hash
Request Body
200 400 500
Copy {
"chainpoint": {
"@context": "https://w3id.org/chainpoint/v2",
"type": "ChainpointSHA256v2",
"targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
"anchors": [
{
"type": "LTODataTransaction",
"sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
}
],
"block": {
"height": "483025"
},
"transaction": {
"position": "0"
}
}
}
Copy invalid body given
no hash given
invalid hash given
invalid encoding given
Copy failed to anchor '[reason]'
Verify if a hash was anchored
GET
https://lto.example.com/hash/:hash
Get chainpoint info of an anchored hash.
Path Parameters
anchor hash in hexadecimal format
200 404 500
Copy {
"chainpoint": {
"@context": "https://w3id.org/chainpoint/v2",
"type": "ChainpointSHA256v2",
"targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
"anchors": [
{
"type": "LTODataTransaction",
"sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
}
],
"block": {
"height": "483025"
},
"transaction": {
"position": "0"
}
}
}
Copy Failed to get transaction by hash and encoding '[reason]'
Verify if a hash was anchored
GET
https://lto.example.com/hash/:hash/encoding/:encoding
Get chainpoint info of an anchored hash in given encoding.
Path Parameters
The encoding in which the hash is given. Options are
(hex, base58, base64)
200 400 404 500
Copy {
"chainpoint": {
"@context": "https://w3id.org/chainpoint/v2",
"type": "ChainpointSHA256v2",
"targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
"anchors": [
{
"type": "LTODataTransaction",
"sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
}
],
"block": {
"height": "483025"
},
"transaction": {
"position": "0"
}
}
}
Copy invalid encoding given
Copy Failed to get transaction by hash and encoding '[reason]'