LTO Network
  • Getting started
  • What is LTO Network?
  • Tutorials
    • Buying and staking LTO
      • Exchanges
        • Binance
        • AscendEX (Bitmax)
        • Uniswap
        • PancakeSwap
        • Other exchanges
      • Creating your LTO web wallet
      • Using the LTO token bridge
      • Staking LTO tokens
    • Mining
      • Setup your node wallets
      • Node management
      • Public community nodes
    • Anchoring
      • Hashing
    • LetsFlow
  • Wallets
    • LTO Web Wallet
      • Using Ledger
    • Universal Wallet
    • LTO CLI
    • Third-Party Wallets
      • Stakely.io wallet
        • Web wallet
        • Commandline
    • ERC20 Token Swap
  • Running a node
    • Public node
      • Installation Guide
        • Mainnet & Testnet
        • Requirements
        • Configuration
        • (Virtual) Machine
        • Nginx reverse proxy (optional)
        • Troubleshooting FAQ
      • Cloud installation
        • Alibaba Cloud
        • AWS Elastic Beanstalk
        • Google Cloud
        • IBM Cloud
        • Microsoft Azure
        • OKD (OpenShift)
        • Raspberry Pi (Expert)
        • Ubuntu Linux with Container
        • Windows with Container
      • REST API
        • Address
        • Wallet
        • Lease Transactions
        • Peers
        • Blocks
        • Utils
        • FAQ
      • Security Notes
      • FAQ
      • Exchange integration guide
    • Anchor node
      • Installation Guide
        • Linux
        • MacOS
        • Windows
      • REST API
    • Identity node
      • Installation guide
        • Linux
        • MacOs
        • Windows
      • Configuration
        • Trust network
      • REST API
    • Workflow node
      • Installation Guide
        • MacOS
        • Windows
        • Ubuntu Linux
      • REST API
  • Ownables
    • What are Ownables?
    • Making your first ownable
    • Ownables SDK
      • Prerequisites
      • Setup
    • Ownables Architecture
      • Smart Contract
      • Widget
    • Ownables Bridge
  • Templates Overview
  • Libraries
    • JavaScript
      • Accounts
      • Transactions
      • Event chain
      • Messages
      • Identities
      • HTTP Authentication
    • Python
      • Accounts
      • Public layer
    • PHP
      • Accounts
      • Identities
      • Public layer
      • Private layer
      • HTTP Authentication
      • Commandline scripts
    • Java
  • Protocol
    • Cryptography
    • Accounts
      • ED25519
      • secp256k1
      • secp256r1
    • Identities
      • Decentralized identifiers (DID)
      • Trust network
      • Verifiable credentials
    • Public layer
      • Transactions
        • Transfer
        • Lease
        • Cancel Lease
        • Mass Transfer
        • Set Script
        • Data
        • Anchor
        • Association
        • Revoke Association
        • Sponsorship
        • Cancel Sponsorship
        • Register
        • Burn
        • Mapped Anchor
        • Statement
      • Transaction fees
      • Consensus protocol
      • Activation Protocol
      • Data Structures
    • Private layer
      • Event chain
        • Event
      • Messaging
        • Sending messages
Powered by GitBook
On this page
  • Authorization
  • Anchor a hash on the blockchain
  • Verify if a hash was anchored
  • Verify if a hash was anchored
  1. Running a node
  2. Anchor node

REST API

In the following examples, replacehttps://lto.example.com with the domain or IP address of your node.

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

Authorization: bearer <token>

Anchor a hash on the blockchain

POST https://lto.example.com/hash

Request Body

Name
Type
Description

hash

string

encoding

string

{
  "chainpoint": {
    "@context": "https://w3id.org/chainpoint/v2",
    "type": "ChainpointSHA256v2",
    "targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
    "anchors": [
      {
        "type": "LTODataTransaction",
        "sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
      }
    ],
    "block": {
      "height": "483025"
    },
    "transaction": {
      "position": "0"
    }
  }
}
invalid body given
no hash given
invalid hash given
invalid encoding given
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

Name
Type
Description

hash

string

anchor hash in hexadecimal format

{
  "chainpoint": {
    "@context": "https://w3id.org/chainpoint/v2",
    "type": "ChainpointSHA256v2",
    "targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
    "anchors": [
      {
        "type": "LTODataTransaction",
        "sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
      }
    ],
    "block": {
      "height": "483025"
    },
    "transaction": {
      "position": "0"
    }
  }
}
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

Name
Type
Description

hash

string

anchored hash

encoding

string

The encoding in which the hash is given. Options are (hex, base58, base64)

{
  "chainpoint": {
    "@context": "https://w3id.org/chainpoint/v2",
    "type": "ChainpointSHA256v2",
    "targetHash": "8c4b53f85243892edcbb3ccec947269f95ba3da2e84fee84fcc277b19fb68044",
    "anchors": [
      {
        "type": "LTODataTransaction",
        "sourceId": "6KVLV6zRSVR8tqCZZ9cqsbUJkP8fNDiY12CmXrGnrwTd"
      }
    ],
    "block": {
      "height": "483025"
    },
    "transaction": {
      "position": "0"
    }
  }
}
invalid encoding given
Failed to get transaction by hash and encoding '[reason]'
PreviousWindowsNextIdentity node

Last updated 4 years ago