Zen Protocol Documentation
WebsiteTelegramBlogForum
  • Zen Protocol Docs
  • Apps
    • Headless Full Node
      • Full Node NPM Package
      • Build from Source
      • CLI
      • API
        • Wallet
        • Contracts
        • General
        • Blockchain
        • AddressDB
      • Deploy
        • Systemd
        • Shell script
        • Docker
      • Technical Model
      • AddressDB
    • Wallet
      • Desktop Wallet
        • Installers
      • Web Wallet
        • Run Locally
      • Wallet User Guide
        • Connect a Wallet
          • Create a Wallet
          • Import a Wallet
          • Watch Mode
        • My Wallet
          • Navigation Bar
          • Portfolio
          • Receive
          • Send / Execute
          • Transaction History
        • Contracts
          • Active Contracts
          • Execute a Contract
            • Message Body Field
          • Extend a Contract
          • Activate a Contract
        • Voting
          • Common Goods Pool
            • Generating a Ballot ID
          • Governance
        • Signer
        • Settings
          • Account Settings
          • Node Connectivity
      • Deprecated Desktop Wallet
        • Executable Installers
        • Wallet Structure
          • Video Tutorials
    • Explorer
    • Zen.js
      • Payment Processing
    • Oracle
      • Oracle GUI
      • Oracle Service
      • Oracle's API
      • Deploy
        • Systemd
        • Docker
      • How the Oracle contract works
      • How to create an Attestation token
    • Dex
      • Dex User Guide
        • Traded Pairs
        • Search Pairs
        • Order Book
        • Operations
        • My Wallet
        • Settings
      • How DEX contract works
    • Fixed Payout
      • Fixed Payout Generator User Guide
        • Issue
        • Redeem
        • Cancel
        • Verify
        • Settings
      • How the FP Contract works
      • How are the asset named?
  • Smart Contracts
  • Contract Structure
  • Contract Cost
  • Contract Activation
  • Contract Examples
  • Smart Contracts SDK
  • Contracts Language ZF*
  • Named Token Tutorial
  • Consensus
  • Common Goods Pool
  • Block Validation
  • Transaction Validation
  • Serialization
  • Use Cases
    • Create Unsigned Transaction
    • Secure Sign Transaction
    • Cold Storage using Full Node
  • Troubleshooting
    • Responsible Disclosure
    • Bug Bounty
    • Known Bugs
  • For Miners
    • Pools
    • GPU Mining
    • GPU Bounties
  • Check Crowdsale Contribution
  • Alpha call option
Powered by GitBook
On this page
  • Attest with Commit
  • Attest with Root and Timestamp
  • Query the Oracle
  • Count commits
  • Get the values
  1. Apps
  2. Oracle

Oracle's API

Attest with Commit

GET http://127.0.0.1:8585/attest

Request an attestation message body

Query Parameters

Name
Type
Description

commit

string

Commit ID of the committed data

cid

string

ContractId of the recipient address

pk

string

Public key of the recipient address

address

String

Address of the recipient (either a contract address or a public key hash address).

{
    "root": "3e47241505bca37f3356fd8dda544c2a3c9c043601f147ea0c6da1362c85a472",
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "tx": "No TX",
    "messageBody": "{\n  \"dict\": [\n    [\n      \"Commit\",\n      {\n        \"hash\": \"2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3\"\n      }\n    ],\n    [\n      \"OraclePubKey\",\n      {\n        \"pk\": \"02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c\"\n      }\n    ]\n  ]\n}",
    "messageBodyEncoded": "0c0206436f6d6d6974072d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d30c4f7261636c655075624b65790a02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c"
}
`

Attest with Root and Timestamp

GET http://127.0.0.1:8585/attest

Request an attestation message body

Query Parameters

Name
Type
Description

root

string

Root of the Merkle Tree

timestamp

string

Time of the committed data (in millisecond in epoch format)

cid

string

Contract ID of the recipient address

pk

string

ContractId of the Recipient address

address

String

Address of the recipient (either a contract address or a public key hash address).

{
    "root": "3e47241505bca37f3356fd8dda544c2a3c9c043601f147ea0c6da1362c85a472",
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "tx": "No TX",
    "messageBody": "{\n  \"dict\": [\n    [\n      \"Commit\",\n      {\n        \"hash\": \"2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3\"\n      }\n    ],\n    [\n      \"OraclePubKey\",\n      {\n        \"pk\": \"02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c\"\n      }\n    ]\n  ]\n}",
    "messageBodyEncoded": "0c0206436f6d6d6974072d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d30c4f7261636c655075624b65790a02ad784974b3f86ad97e008e20d2c107429041ed2d991ada2a1461b5077c11944c"
}
`

Query the Oracle

GET http://127.0.0.1:8585/query

Filter the commited data to find the commitment.

Query Parameters

Name
Type
Description

high

string

filter the data with the higher timestamp bond

low

string

Filter the data with the lower timestamp bond

key

string

Filter by this ticker

take*

String

Take only the first <n> items (after the skip if there is one).

skip

String

Skip the first <n> items.

[{
    "item": {
        "APPL": "10"
    },
    "timestamp": "1600785099516",
    "commit": "2d1719fa333e615636dc074cb6ad03813a57c56cd91b73bffd7c12dd62fdb0d3",
    "hash": "0ecb254e1ff36f9b6a09f35926041a01a955171a29d8500775fb58a0acbff54c"
}]

Count commits

GET http://127.0.0.1:8585/count/

Count the number of items committed by the service.

Query Parameters

Name
Type
Description

high

String

filter the data with the higher timestamp bond

low

String

Filter the data with the lower timestamp bond

key

String

Filter by this ticker

{
    // Response
}

Get the values

POST http://127.0.0.1:8585/getValues

Query Parameters

Name
Type
Description

key

String

Filter by this ticker

high

String

filter the data with the higher timestamp bond

low

String

Filter the data with the lower timestamp bond

{
    // Response
}
PreviousOracle ServiceNextDeploy

Last updated 3 years ago