bitcoin-s/docs/next/oracle/oracle-server.html
Docusaurus bot daa26cbb3a Deploy website
Deploy website version based on 4a6c45f313
2021-01-21 18:36:52 +00:00

361 lines
No EOL
57 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Oracle Server · bitcoin-s</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="The Oracle Server is a DLC Oracle with functionality for creating events and attesting to them."/><meta name="docsearch:version" content="next"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Oracle Server · bitcoin-s"/><meta property="og:type" content="website"/><meta property="og:url" content="https://bitcoin-s.org/"/><meta property="og:description" content="The Oracle Server is a DLC Oracle with functionality for creating events and attesting to them."/><meta property="og:image" content="https://bitcoin-s.org/img/undraw_online.svg"/><meta name="twitter:card" content="summary"/><meta name="twitter:image" content="https://bitcoin-s.org/img/undraw_tweetstorm.svg"/><link rel="shortcut icon" href="/img/favicon.ico"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61958686-2', 'auto');
ga('send', 'pageview');
</script><link rel="stylesheet" href="/css/code-block-buttons.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.0/clipboard.min.js"></script><script type="text/javascript" src="https://fonts.googleapis.com/css?family=Montserrat:500"></script><script type="text/javascript" src="https://www.googletagmanager.com/gtag/js?id=UA-61958686-2"></script><script type="text/javascript" src="/js/code-block-buttons.js"></script><script src="/js/scrollSpy.js"></script><link rel="stylesheet" href="/css/main.css"/><script src="/js/codetabs.js"></script></head><body class="sideNavVisible separateOnPageNav"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><img class="logo" src="/img/favicon.ico" alt="bitcoin-s"/><h2 class="headerTitleWithLogo">bitcoin-s</h2></a><a href="/versions"><h3>next</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/next/core/core-intro" target="_self">Docs</a></li><li class=""><a href="download" target="_self">Download</a></li><li class=""><a href="/api/org/bitcoins" target="_self">API</a></li><li class=""><a href="/help" target="_self">Help</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i></i><span>DLC Oracle</span></h2><div class="tocToggler" id="tocToggler"><i class="icon-toc"></i></div></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">Getting Started</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/getting-started">Intro and Getting Started</a></li><li class="navListItem"><a class="navItem" href="/docs/next/bips">Supported BIPs</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Getting Setup</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/getting-setup">Getting Bitcoin-S installed on your machine</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Applications</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/applications/cli">CLI</a></li><li class="navListItem"><a class="navItem" href="/docs/next/applications/server">Application Server</a></li><li class="navListItem"><a class="navItem" href="/docs/next/applications/gui">GUI</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Chain</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/chain/chain">Blockchain Verification</a></li><li class="navListItem"><a class="navItem" href="/docs/next/chain/filter-sync">Syncing Blockfilters</a></li><li class="navListItem"><a class="navItem" href="/docs/next/chain/chain-query-api">Chain Query API</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Configuration</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/config/configuration">Application Configuration</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Core Module</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/core/core-intro">Core Module</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/addresses">Generating Addresses</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/hd-keys">HD Key Generation</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/adding-spks">Adding New Script Types</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/spending-info">Signing Transactions</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/psbts">Partially Signed Bitcoin Transactions</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/txbuilder">TxBuilder Example</a></li><li class="navListItem"><a class="navItem" href="/docs/next/core/lightning-network">Lightning Network Data Types</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Crypto Module</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/crypto/crypto-intro">Crypto Module</a></li><li class="navListItem"><a class="navItem" href="/docs/next/crypto/sign">Sign API</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Fee Provider</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/fee-provider/fee-provider">Fee Provider</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Key Manager</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/key-manager/server-key-manager">Server Key Manager</a></li><li class="navListItem"><a class="navItem" href="/docs/next/key-manager/key-manager">Key Manager</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Node</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/node/node">Light Client</a></li><li class="navListItem"><a class="navItem" href="/docs/next/node/node-api">Node API</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Wallet</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/wallet/wallet">Wallet</a></li><li class="navListItem"><a class="navItem" href="/docs/next/wallet/wallet-callbacks">Wallet Callbacks</a></li><li class="navListItem"><a class="navItem" href="/docs/next/wallet/wallet-get-address">Wallet Get Address APIs</a></li><li class="navListItem"><a class="navItem" href="/docs/next/wallet/address-tagging">Address and UTXO tagging</a></li><li class="navListItem"><a class="navItem" href="/docs/next/wallet/dlc">Executing A DLC with Bitcoin-S</a></li><li class="navListItem"><a class="navItem" href="/docs/next/wallet/wallet-rescan">Wallet Rescans</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">RPC Clients</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/rpc/rpc-clients-intro">Introduction</a></li><li class="navListItem"><a class="navItem" href="/docs/next/rpc/rpc-eclair">Eclair</a></li><li class="navListItem"><a class="navItem" href="/docs/next/rpc/rpc-bitcoind">bitcoind/Bitcoin Core</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Secp256k1</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/secp256k1/secp256k1">Secp256k1</a></li><li class="navListItem"><a class="navItem" href="/docs/next/secp256k1/jni-modify">Adding to Secp256k1 JNI</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Testkit</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/testkit/testkit">Testkit</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">DLC Oracle</h3><ul class=""><li class="navListItem navListItemActive"><a class="navItem" href="/docs/next/oracle/oracle-server">Oracle Server</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Contributing</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/contributing">Contributing</a></li><li class="navListItem"><a class="navItem" href="/docs/next/contributing-website">Contributing to the website</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Security</h3><ul class=""><li class="navListItem"><a class="navItem" href="/docs/next/security">Security</a></li></ul></div></div></section></div><script>
var coll = document.getElementsByClassName('collapsible');
var checkActiveCategory = true;
for (var i = 0; i < coll.length; i++) {
var links = coll[i].nextElementSibling.getElementsByTagName('*');
if (checkActiveCategory){
for (var j = 0; j < links.length; j++) {
if (links[j].classList.contains('navListItemActive')){
coll[i].nextElementSibling.classList.toggle('hide');
coll[i].childNodes[1].classList.toggle('rotate');
checkActiveCategory = false;
break;
}
}
}
coll[i].addEventListener('click', function() {
var arrow = this.childNodes[1];
arrow.classList.toggle('rotate');
var content = this.nextElementSibling;
content.classList.toggle('hide');
});
}
document.addEventListener('DOMContentLoaded', function() {
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
createToggler('#tocToggler', 'body', 'tocActive');
var headings = document.querySelector('.toc-headings');
headings && headings.addEventListener('click', function(event) {
var el = event.target;
while(el !== headings){
if (el.tagName === 'A') {
document.body.classList.remove('tocActive');
break;
} else{
el = el.parentNode;
}
}
}, false);
function createToggler(togglerSelector, targetSelector, className) {
var toggler = document.querySelector(togglerSelector);
var target = document.querySelector(targetSelector);
if (!toggler) {
return;
}
toggler.onclick = function(event) {
event.preventDefault();
target.classList.toggle(className);
};
}
});
</script></nav></div><div class="container mainContainer docsContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/bitcoin-s/bitcoin-s/blob/master/docs/oracle/oracle-server.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 id="__docusaurus" class="postHeaderTitle">Oracle Server</h1></header><article><div><span><p>The Oracle Server is a DLC Oracle with functionality for creating events and attesting to them.
It also provides data to be able to set up your staking address.</p>
<h2><a class="anchor" aria-hidden="true" id="step-1-java-and-scala"></a><a href="#step-1-java-and-scala" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 1: Java and Scala</h2>
<p>To get started you will need Java, Scala, and some other nice tools installed, luckily the Scala team has an easy setup process!</p>
<p>Simply follow the instructions in <a href="https://www.scala-lang.org/2020/06/29/one-click-install.html">this short blog</a> to get started.</p>
<h2><a class="anchor" aria-hidden="true" id="step-2-bitcoin-s-repository"></a><a href="#step-2-bitcoin-s-repository" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 2: Bitcoin-S Repository</h2>
<p>Now, it is time to clone the <a href="https://github.com/bitcoin-s/bitcoin-s/">Bitcoin-S repository</a> by running</p>
<pre><code class="hljs css language-bashrc">git <span class="hljs-keyword">clone</span> <span class="hljs-title">--recursive</span> git@github.com:bitcoin-s/bitcoin-s.git
</code></pre>
<p>or alternatively, if you do not have ssh setup with github, you can run</p>
<pre><code class="hljs css language-bashrc">git clone --recursive https:<span class="hljs-regexp">//gi</span>thub.com<span class="hljs-regexp">/bitcoin-s/</span>bitcoin-s.git
</code></pre>
<p>Next, you will want to execute the commands</p>
<pre><code class="hljs css language-bashrc">cd <span class="hljs-keyword">bitcoin-s
</span>git <span class="hljs-keyword">submodule </span>update
</code></pre>
<p>to download the secp256k1 submodule, this is so cryptographic functions like signing will be faster.</p>
<h2><a class="anchor" aria-hidden="true" id="step-3-building-the-oracle-server"></a><a href="#step-3-building-the-oracle-server" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 3: Building the Oracle Server</h2>
<p>You can build the oracle server with the <a href="https://github.com/sbt/sbt-native-packager">sbt native packager</a>.
The native packager offers <a href="https://github.com/sbt/sbt-native-packager#examples">numerous ways to package the project</a>.</p>
<p>In this example we are going to use <code>stage</code> which will produce bash scripts we can easily execute. You can stage the server with the following command.</p>
<pre><code class="hljs css language-bash">sbt oracleServer/universal:stage
</code></pre>
<p>This will produce a script to execute bitcoin-s which you can start with</p>
<pre><code class="hljs css language-bash">./app/oracle-server/target/universal/stage/bin/bitcoin-s-oracle-server
</code></pre>
<p>Alternatively you can run the server by just using:</p>
<pre><code class="hljs css language-bash">sbt oracleServer/run
</code></pre>
<h2><a class="anchor" aria-hidden="true" id="step-4-configuration"></a><a href="#step-4-configuration" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Step 4: Configuration</h2>
<p>If you would like to pass in a custom datadir for your server, you can do</p>
<pre><code class="hljs css language-bash">./app/oracle-server/target/universal/stage/bin/bitcoin-s-oracle-server --datadir /path/to/datadir/
</code></pre>
<p>To use a config file that is not the <code>bitcoin-s.conf</code> file in your datadir, you can do</p>
<pre><code class="hljs css language-bash">./app/oracle-server/target/universal/stage/bin/bitcoin-s-oracle-server --conf /path/to/file.conf
</code></pre>
<p>You can also pass in a custom <code>rpcport</code> to bind to</p>
<pre><code class="hljs css language-bash">./app/oracle-server/target/universal/stage/bin/bitcoin-s-oracle-server --rpcport 12345
</code></pre>
<p>For more information on configuring the server please see our <a href="/docs/next/config/configuration">configuration</a> document</p>
<p>For more information on how to use our built in <code>cli</code> to interact with the server please see <a href="/docs/next/applications/cli">cli.md</a></p>
<h2><a class="anchor" aria-hidden="true" id="server-endpoints"></a><a href="#server-endpoints" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Server Endpoints</h2>
<ul>
<li><code>getpublickey</code> - Get oracle's public key</li>
<li><code>getstakingaddress</code> - Get oracle's staking address</li>
<li><code>listevents</code> - Lists all oracle event TLVs</li>
<li><code>createevent</code> <code>label</code> <code>maturationtime</code> <code>outcomes</code> - Registers an oracle event
<ul>
<li><code>label</code> - Label for this event</li>
<li><code>maturationtime</code> - The earliest expected time an outcome will be signed, given in epoch second</li>
<li><code>outcomes</code> - Possible outcomes for this event</li>
</ul></li>
<li><code>createrangedevent</code> <code>name</code> <code>maturationtime</code> <code>start</code> <code>stop</code> <code>step</code> - Registers an oracle event with a range of outcomes
<ul>
<li><code>name</code> - Name for this event</li>
<li><code>maturationtime</code> - The earliest expected time an outcome will be signed, given in epoch second</li>
<li><code>start</code> - The first possible outcome number</li>
<li><code>stop</code> - The last possible outcome number</li>
<li><code>step</code> - The increment between each outcome</li>
<li><code>unit</code> - The unit denomination of the outcome value</li>
<li><code>precision</code> - The precision of the outcome representing the base exponent by which to multiply the number represented by the composition of the digits to obtain the actual outcome value.</li>
</ul></li>
<li><code>createdigitdecompevent</code> <code>name</code> <code>maturationtime</code> <code>base</code> <code>numdigits</code> <code>unit</code> <code>precision</code> <code>[signed]</code> - Registers an oracle event that uses digit decomposition when signing the number
<ul>
<li><code>name</code>- Name for this event</li>
<li><code>maturationtime</code> - The earliest expected time an outcome will be signed, given in epoch second</li>
<li><code>base</code> - The base in which the outcome value is decomposed</li>
<li><code>numdigits</code> - The max number of digits the outcome can have</li>
<li><code>unit</code> - The unit denomination of the outcome value</li>
<li><code>precision</code> - The precision of the outcome representing the base exponent by which to multiply the number represented by the composition of the digits to obtain the actual outcome value.</li>
<li><code>--signed</code>- Whether the outcomes can be negative</li>
</ul></li>
<li><code>getevent</code> <code>event</code> - Get an event's details
<ul>
<li><code>event</code> - The event's oracle event tlv</li>
</ul></li>
<li><code>signevent</code> <code>event</code> <code>outcome</code> - Signs an event
<ul>
<li><code>event</code> - The event's oracle event tlv</li>
<li><code>outcome</code>- Outcome to sign for this event</li>
</ul></li>
<li><code>signforrange</code> <code>event</code> <code>outcome</code> - Signs an event
<ul>
<li><code>event</code> - The event's oracle event tlv</li>
<li><code>outcome</code>- Outcome to sign for this event</li>
</ul></li>
<li><code>signdigits</code> <code>event</code> <code>outcome</code> - Signs an event
<ul>
<li><code>event</code> - The event's oracle event tlv</li>
<li><code>outcome</code> - Number to sign for this event</li>
</ul></li>
<li><code>getsignatures</code> <code>event</code> - Get the signatures from a signed event
<ul>
<li><code>event</code> - The event's oracle event tlv</li>
</ul></li>
</ul>
<h3><a class="anchor" aria-hidden="true" id="create-event-example"></a><a href="#create-event-example" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create Event Example</h3>
<p>Bitcoin-S CLI:</p>
<pre><code class="hljs css language-bash">$ bitcoin-s-cli createevent <span class="hljs-built_in">test</span> 1701917137 <span class="hljs-string">&quot;outcome1,outcome2,outcome3&quot;</span>
fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533
$ bitcoin-s-cli getevent fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533
{
<span class="hljs-string">&quot;nonces&quot;</span>: [
<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8&quot;</span>
],
<span class="hljs-string">&quot;eventName&quot;</span>: <span class="hljs-string">&quot;test&quot;</span>,
<span class="hljs-string">&quot;signingVersion&quot;</span>: <span class="hljs-string">&quot;Mock&quot;</span>,
<span class="hljs-string">&quot;maturationTime&quot;</span>: <span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,
<span class="hljs-string">&quot;announcementSignature&quot;</span>: <span class="hljs-string">&quot;e27ccd54ee0e2b94c4af6e7a4ee5a73026d244dec373d6ea5d9c671d2792108c1df0b64820a1d578165cd07d37dbb4c2e6d72fbdbead156b45d8838ca1d36691&quot;</span>,
<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>: <span class="hljs-string">&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;</span>,
<span class="hljs-string">&quot;eventTLV&quot;</span>: <span class="hljs-string">&quot;fdd8226cf8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d653374657374&quot;</span>,
<span class="hljs-string">&quot;announcementTLV&quot;</span>: <span class="hljs-string">&quot;fdd824b0e27ccd54ee0e2b94c4af6e7a4ee5a73026d244dec373d6ea5d9c671d2792108c1df0b64820a1d578165cd07d37dbb4c2e6d72fbdbead156b45d8838ca1d36691fdd8226cf8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d653374657374&quot;</span>,
<span class="hljs-string">&quot;attestations&quot;</span>: null,
<span class="hljs-string">&quot;signatures&quot;</span>: null,
<span class="hljs-string">&quot;outcomes&quot;</span>: [
<span class="hljs-string">&quot;outcome1&quot;</span>,
<span class="hljs-string">&quot;outcome2&quot;</span>,
<span class="hljs-string">&quot;outcome3&quot;</span>
]
}
$ bitcoin-s-cli signevent fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533 <span class="hljs-string">&quot;outcome1&quot;</span>
0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd
$ bitcoin-s-cli getsignatures fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533
[
<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd&quot;</span>
]
</code></pre>
<p>CURL:</p>
<pre><code class="hljs css language-bash">$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;createevent&quot;, &quot;params&quot;: [&quot;testEvent&quot;, 1701917137, [&quot;outcome1&quot;, &quot;outcome2&quot;, &quot;outcome3&quot;]]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:<span class="hljs-string">&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;</span>,<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getevent&quot;, &quot;params&quot;: [&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:{<span class="hljs-string">&quot;nonces&quot;</span>:[<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8&quot;</span>],<span class="hljs-string">&quot;eventName&quot;</span>:<span class="hljs-string">&quot;test&quot;</span>,<span class="hljs-string">&quot;signingVersion&quot;</span>:<span class="hljs-string">&quot;Mock&quot;</span>,<span class="hljs-string">&quot;maturationTime&quot;</span>:<span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,<span class="hljs-string">&quot;announcementSignature&quot;</span>:<span class="hljs-string">&quot;e27ccd54ee0e2b94c4af6e7a4ee5a73026d244dec373d6ea5d9c671d2792108c1df0b64820a1d578165cd07d37dbb4c2e6d72fbdbead156b45d8838ca1d36691&quot;</span>,<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>:<span class="hljs-string">&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;</span>,<span class="hljs-string">&quot;eventTLV&quot;</span>:<span class="hljs-string">&quot;fdd8226cf8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d653374657374&quot;</span>,<span class="hljs-string">&quot;announcementTLV&quot;</span>:<span class="hljs-string">&quot;fdd824b0e27ccd54ee0e2b94c4af6e7a4ee5a73026d244dec373d6ea5d9c671d2792108c1df0b64820a1d578165cd07d37dbb4c2e6d72fbdbead156b45d8838ca1d36691fdd8226cf8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d653374657374&quot;</span>,<span class="hljs-string">&quot;attestations&quot;</span>:[<span class="hljs-string">&quot;a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd&quot;</span>],<span class="hljs-string">&quot;signatures&quot;</span>:[<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd&quot;</span>],<span class="hljs-string">&quot;outcomes&quot;</span>:[<span class="hljs-string">&quot;outcome1&quot;</span>,<span class="hljs-string">&quot;outcome2&quot;</span>,<span class="hljs-string">&quot;outcome3&quot;</span>]},<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;signevent&quot;, &quot;params&quot;: [&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;, &quot;outcome 1&quot;]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd&quot;</span>,<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getsignatures&quot;, &quot;params&quot;: [&quot;fdd806400374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8000300086f7574636f6d653100086f7574636f6d653200086f7574636f6d6533&quot;]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:[<span class="hljs-string">&quot;0374d9df0a4591e7a9ab16b091df6709220594771b7c0d5c2be6a11c4c452ef8a65977263a6b6071c29232a516adb0e69e8e049772275dc9fa8d9cfa620960dd&quot;</span>],<span class="hljs-string">&quot;error&quot;</span>:null}
</code></pre>
<h4><a class="anchor" aria-hidden="true" id="create-ranged-event-example"></a><a href="#create-ranged-event-example" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Create Ranged Event Example</h4>
<p>Bitcoin-S CLI:</p>
<pre><code class="hljs css language-bash">$ bitcoin-s-cli createrangedevent tomorrowTemperature 1701917137 0 100 1 <span class="hljs-string">&quot;degrees F&quot;</span> 0
fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001
$ bitcoin-s-cli getevent fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001
{
<span class="hljs-string">&quot;nonces&quot;</span>: [
<span class="hljs-string">&quot;5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d0&quot;</span>
],
<span class="hljs-string">&quot;eventName&quot;</span>: <span class="hljs-string">&quot;tomorrowTemperature&quot;</span>,
<span class="hljs-string">&quot;signingVersion&quot;</span>: <span class="hljs-string">&quot;Mock&quot;</span>,
<span class="hljs-string">&quot;maturationTime&quot;</span>: <span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,
<span class="hljs-string">&quot;announcementSignature&quot;</span>: <span class="hljs-string">&quot;33861a85d7ac7fc3f7b0dcaa891f9deebd2758f72d734a63dcab14f2a9d7f30d6099805367ac05bc747c1232b7211f8bd025478ef2b03418603cf5f52e2466c7&quot;</span>,
<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>: <span class="hljs-string">&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;</span>,
<span class="hljs-string">&quot;eventTLV&quot;</span>: <span class="hljs-string">&quot;fdd82265f8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001746f6d6f72726f7754656d7065726174757265&quot;</span>,
<span class="hljs-string">&quot;announcementTLV&quot;</span>: <span class="hljs-string">&quot;fdd824a933861a85d7ac7fc3f7b0dcaa891f9deebd2758f72d734a63dcab14f2a9d7f30d6099805367ac05bc747c1232b7211f8bd025478ef2b03418603cf5f52e2466c7fdd82265f8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001746f6d6f72726f7754656d7065726174757265&quot;</span>,
<span class="hljs-string">&quot;attestations&quot;</span>: null,
<span class="hljs-string">&quot;signatures&quot;</span>: null,
<span class="hljs-string">&quot;outcomes&quot;</span>: [
0,
1,
2,
...
98,
99,
100
]
}
$ bitcoin-s-cli signforrange fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001 50
abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057da391ea18b22f695bf8a34caa5a12acbdc917aea95990dbbf9568ca65676e6b7b
$ bitcoin-s-cli getsignatures fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001
[
<span class="hljs-string">&quot;abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057da391ea18b22f695bf8a34caa5a12acbdc917aea95990dbbf9568ca65676e6b7b&quot;</span>
]
</code></pre>
<p>CURL:</p>
<pre><code class="hljs css language-bash">$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;createrangedevent&quot;, &quot;params&quot;: [&quot;tomorrowsTemperature&quot;, 1701917137, 0, 100, 1, &quot;degrees C&quot;, 0]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:<span class="hljs-string">&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;</span>,<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getevent&quot;, &quot;params&quot;: [&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:{<span class="hljs-string">&quot;nonces&quot;</span>:[<span class="hljs-string">&quot;5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d0&quot;</span>],<span class="hljs-string">&quot;eventName&quot;</span>:<span class="hljs-string">&quot;tomorrowTemperature&quot;</span>,<span class="hljs-string">&quot;signingVersion&quot;</span>:<span class="hljs-string">&quot;Mock&quot;</span>,<span class="hljs-string">&quot;maturationTime&quot;</span>:<span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,<span class="hljs-string">&quot;announcementSignature&quot;</span>:<span class="hljs-string">&quot;33861a85d7ac7fc3f7b0dcaa891f9deebd2758f72d734a63dcab14f2a9d7f30d6099805367ac05bc747c1232b7211f8bd025478ef2b03418603cf5f52e2466c7&quot;</span>,<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>:<span class="hljs-string">&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;</span>,<span class="hljs-string">&quot;eventTLV&quot;</span>:<span class="hljs-string">&quot;fdd82265f8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001746f6d6f72726f7754656d7065726174757265&quot;</span>,<span class="hljs-string">&quot;announcementTLV&quot;</span>:<span class="hljs-string">&quot;fdd824a933861a85d7ac7fc3f7b0dcaa891f9deebd2758f72d734a63dcab14f2a9d7f30d6099805367ac05bc747c1232b7211f8bd025478ef2b03418603cf5f52e2466c7fdd82265f8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001746f6d6f72726f7754656d7065726174757265&quot;</span>,<span class="hljs-string">&quot;attestations&quot;</span>:null,<span class="hljs-string">&quot;signatures&quot;</span>:null,<span class="hljs-string">&quot;outcomes&quot;</span>:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99]},<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;signforrange&quot;, &quot;params&quot;: [&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;, 50]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:<span class="hljs-string">&quot;abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057da391ea18b22f695bf8a34caa5a12acbdc917aea95990dbbf9568ca65676e6b7b&quot;</span>,<span class="hljs-string">&quot;error&quot;</span>:null}
$ curl --data-binary <span class="hljs-string">&#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getsignatures&quot;, &quot;params&quot;: [&quot;fdd8082a5858702d9395c60739e16c29e20ada0a49e4baa499f69fbc6b65a88fa9f3a7d000000000000000640001&quot;]}&#x27;</span> -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http://127.0.0.1:9999/
{<span class="hljs-string">&quot;result&quot;</span>:[<span class="hljs-string">&quot;abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057da391ea18b22f695bf8a34caa5a12acbdc917aea95990dbbf9568ca65676e6b7b&quot;</span>],<span class="hljs-string">&quot;error&quot;</span>:null}
</code></pre>
<h3><a class="anchor" aria-hidden="true" id="digit-decomposition-example"></a><a href="#digit-decomposition-example" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Digit Decomposition Example</h3>
<p>Bitcoin-S CLI:</p>
<pre><code class="hljs css language-bash">$ bitcoin-s-cli createdigitdecompevent exampleDecomp 1701917137 10 3 <span class="hljs-string">&quot;units&quot;</span> 0 --signed
fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458
$ bs-cli getevent fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458
{
<span class="hljs-string">&quot;nonces&quot;</span>: [
<span class="hljs-string">&quot;abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d&quot;</span>,
<span class="hljs-string">&quot;14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851&quot;</span>,
<span class="hljs-string">&quot;408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a0255&quot;</span>,
<span class="hljs-string">&quot;7e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458&quot;</span>
],
<span class="hljs-string">&quot;eventName&quot;</span>: <span class="hljs-string">&quot;exampleDecomp&quot;</span>,
<span class="hljs-string">&quot;signingVersion&quot;</span>: <span class="hljs-string">&quot;Mock&quot;</span>,
<span class="hljs-string">&quot;maturationTime&quot;</span>: <span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,
<span class="hljs-string">&quot;announcementSignature&quot;</span>: <span class="hljs-string">&quot;7b149e6001496f34588ce3089df91d0f1dfbaaae988ed993c1eacf759519c358ad1fd1d98747412bf25e257c9e4cb18ece3f132fc3ef2f400258d9cf5eb9fae0&quot;</span>,
<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>: <span class="hljs-string">&quot;fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458&quot;</span>,
<span class="hljs-string">&quot;eventTLV&quot;</span>: <span class="hljs-string">&quot;fdd822bef8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef44586578616d706c654c6172676552616e6765&quot;</span>,
<span class="hljs-string">&quot;announcementTLV&quot;</span>: <span class="hljs-string">&quot;fdd824fd01027b149e6001496f34588ce3089df91d0f1dfbaaae988ed993c1eacf759519c358ad1fd1d98747412bf25e257c9e4cb18ece3f132fc3ef2f400258d9cf5eb9fae0fdd822bef8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef44586578616d706c654c6172676552616e6765&quot;</span>,
<span class="hljs-string">&quot;attestations&quot;</span>: null,
<span class="hljs-string">&quot;signatures&quot;</span>: null,
<span class="hljs-string">&quot;outcomes&quot;</span>: [
[
<span class="hljs-string">&quot;0&quot;</span>,
<span class="hljs-string">&quot;1&quot;</span>,
<span class="hljs-string">&quot;2&quot;</span>,
<span class="hljs-string">&quot;3&quot;</span>,
<span class="hljs-string">&quot;4&quot;</span>,
<span class="hljs-string">&quot;5&quot;</span>,
<span class="hljs-string">&quot;6&quot;</span>,
<span class="hljs-string">&quot;7&quot;</span>,
<span class="hljs-string">&quot;8&quot;</span>,
<span class="hljs-string">&quot;9&quot;</span>
],
[
<span class="hljs-string">&quot;0&quot;</span>,
<span class="hljs-string">&quot;1&quot;</span>,
<span class="hljs-string">&quot;2&quot;</span>,
<span class="hljs-string">&quot;3&quot;</span>,
<span class="hljs-string">&quot;4&quot;</span>,
<span class="hljs-string">&quot;5&quot;</span>,
<span class="hljs-string">&quot;6&quot;</span>,
<span class="hljs-string">&quot;7&quot;</span>,
<span class="hljs-string">&quot;8&quot;</span>,
<span class="hljs-string">&quot;9&quot;</span>
],
[
<span class="hljs-string">&quot;0&quot;</span>,
<span class="hljs-string">&quot;1&quot;</span>,
<span class="hljs-string">&quot;2&quot;</span>,
<span class="hljs-string">&quot;3&quot;</span>,
<span class="hljs-string">&quot;4&quot;</span>,
<span class="hljs-string">&quot;5&quot;</span>,
<span class="hljs-string">&quot;6&quot;</span>,
<span class="hljs-string">&quot;7&quot;</span>,
<span class="hljs-string">&quot;8&quot;</span>,
<span class="hljs-string">&quot;9&quot;</span>
],
[
<span class="hljs-string">&quot;+&quot;</span>,
<span class="hljs-string">&quot;-&quot;</span>
]
]
}
bitcoin-s-cli signdigits fdd80a85000a010004abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057d14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a02557e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458 123
[
<span class="hljs-string">&quot;abb84920cb647b1dc2bbbc6b1584af8d0a1a737fe0765d7414ebffcfd9c7057da391ea18b22f695bf8a34caa5a12acbdc917aea95990dbbf9568ca65676e6b7b&quot;</span>,
<span class="hljs-string">&quot;14c56615db0684b6dff24683fa25905c84a87ac9f42f75a097ceeb444ba7f851edbab17bb86ee92834624bb7c59f490b3d03db4a4e2732eb56dde75740d5b674&quot;</span>,
<span class="hljs-string">&quot;408c23c383d1b897638a8310dfd1979f3dc78c75180a5e25510cfbc2563a0255e4f528c5cc1a80f6aaabf2b672cea43488d277d90bfe37c9ac6f2a3cb1e7705a&quot;</span>,
<span class="hljs-string">&quot;7e6a8d9803662a1576e95d6165e9aa1751a909124aee60736efdde78ccef4458bd578082b9e47be7d628f9c1ef43958d33f6b8b4fcae07c250f53111edc50ced&quot;</span>
]
</code></pre>
<p>CURL:</p>
<pre><code class="hljs">$ curl --data-binary &#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;createdigitdecompevent&quot;, &quot;params&quot;: [&quot;exampleDigitDecomp&quot;, <span class="hljs-number">1701917137</span>, 10, true, 3, &quot;units&quot;, 0]}&#x27; -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http:<span class="hljs-comment">//127.0.0.1:9999/</span>
{<span class="hljs-string">&quot;result&quot;</span>:<span class="hljs-string">&quot;fdd80a85000a010004a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcd6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce160739bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e&quot;</span>,<span class="hljs-string">&quot;error&quot;</span>:<span class="hljs-literal">null</span>}
$ curl --data-binary &#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;getevent&quot;, &quot;params&quot;: [&quot;fdd80a<span class="hljs-number">8500</span>0a<span class="hljs-number">010004</span>a<span class="hljs-number">9670</span>e21aeb8f<span class="hljs-number">0281980657</span>c6c6cc9e<span class="hljs-number">9480</span>4b9cbff650cb5a9a1b20b<span class="hljs-number">8556</span>cbcd6de7afbb816d2ff9be8ff250d<span class="hljs-number">8075</span>a<span class="hljs-number">6830</span>0e<span class="hljs-number">5156</span>9c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c<span class="hljs-number">4428</span>1eb<span class="hljs-number">905791</span>0d6a40cf<span class="hljs-number">7698</span>7e721d622dae13e79ce<span class="hljs-number">160739</span>bf4ff7c0ce<span class="hljs-number">8408</span>aa23dd619c5aa5e25d078d64cd<span class="hljs-number">198830</span>e8e<span class="hljs-number">7043</span>6f<span class="hljs-number">5611</span>b1e&quot;]}&#x27; -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http:<span class="hljs-comment">//127.0.0.1:9999/</span>
{<span class="hljs-string">&quot;result&quot;</span>:{<span class="hljs-string">&quot;nonces&quot;</span>:[<span class="hljs-string">&quot;a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcd&quot;</span>,<span class="hljs-string">&quot;6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6c&quot;</span>,<span class="hljs-string">&quot;f0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce1607&quot;</span>,<span class="hljs-string">&quot;39bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e&quot;</span>],<span class="hljs-string">&quot;eventName&quot;</span>:<span class="hljs-string">&quot;exampleDigitDecomp&quot;</span>,<span class="hljs-string">&quot;signingVersion&quot;</span>:<span class="hljs-string">&quot;Mock&quot;</span>,<span class="hljs-string">&quot;maturationTime&quot;</span>:<span class="hljs-string">&quot;2023-12-07T02:45:37Z&quot;</span>,<span class="hljs-string">&quot;announcementSignature&quot;</span>:<span class="hljs-string">&quot;c85357ebc6b2d3f68bc71bd0d9a3daf97b13f3911c6dc5b15141a8ca94ad610d4166c1f4f307f2ceffe33b1b081551ad5caa527d59285400b0da4b41a0ea0786&quot;</span>,<span class="hljs-string">&quot;eventDescriptorTLV&quot;</span>:<span class="hljs-string">&quot;fdd80a85000a010004a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcd6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce160739bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e&quot;</span>,<span class="hljs-string">&quot;eventTLV&quot;</span>:<span class="hljs-string">&quot;fdd822bff8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd80a85000a010004a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcd6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce160739bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e6578616d706c654c6172676552616e676531&quot;</span>,<span class="hljs-string">&quot;announcementTLV&quot;</span>:<span class="hljs-string">&quot;fdd824fd0103c85357ebc6b2d3f68bc71bd0d9a3daf97b13f3911c6dc5b15141a8ca94ad610d4166c1f4f307f2ceffe33b1b081551ad5caa527d59285400b0da4b41a0ea0786fdd822bff8d695520151bc9fbd129be6231f46b0e137b26d8ff91910c0cb6d07f6924968657131d1fdd80a85000a010004a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcd6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce160739bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e6578616d706c654c6172676552616e676531&quot;</span>,<span class="hljs-string">&quot;attestations&quot;</span>:<span class="hljs-literal">null</span>,<span class="hljs-string">&quot;signatures&quot;</span>:<span class="hljs-literal">null</span>,<span class="hljs-string">&quot;outcomes&quot;</span>:[[<span class="hljs-string">&quot;0&quot;</span>,<span class="hljs-string">&quot;1&quot;</span>,<span class="hljs-string">&quot;2&quot;</span>,<span class="hljs-string">&quot;3&quot;</span>,<span class="hljs-string">&quot;4&quot;</span>,<span class="hljs-string">&quot;5&quot;</span>,<span class="hljs-string">&quot;6&quot;</span>,<span class="hljs-string">&quot;7&quot;</span>,<span class="hljs-string">&quot;8&quot;</span>,<span class="hljs-string">&quot;9&quot;</span>],[<span class="hljs-string">&quot;0&quot;</span>,<span class="hljs-string">&quot;1&quot;</span>,<span class="hljs-string">&quot;2&quot;</span>,<span class="hljs-string">&quot;3&quot;</span>,<span class="hljs-string">&quot;4&quot;</span>,<span class="hljs-string">&quot;5&quot;</span>,<span class="hljs-string">&quot;6&quot;</span>,<span class="hljs-string">&quot;7&quot;</span>,<span class="hljs-string">&quot;8&quot;</span>,<span class="hljs-string">&quot;9&quot;</span>],[<span class="hljs-string">&quot;0&quot;</span>,<span class="hljs-string">&quot;1&quot;</span>,<span class="hljs-string">&quot;2&quot;</span>,<span class="hljs-string">&quot;3&quot;</span>,<span class="hljs-string">&quot;4&quot;</span>,<span class="hljs-string">&quot;5&quot;</span>,<span class="hljs-string">&quot;6&quot;</span>,<span class="hljs-string">&quot;7&quot;</span>,<span class="hljs-string">&quot;8&quot;</span>,<span class="hljs-string">&quot;9&quot;</span>],[<span class="hljs-string">&quot;+&quot;</span>,<span class="hljs-string">&quot;-&quot;</span>]]},<span class="hljs-string">&quot;error&quot;</span>:<span class="hljs-literal">null</span>}
$ curl --data-binary &#x27;{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;: &quot;curltest&quot;, &quot;method&quot;: &quot;signdigits&quot;, &quot;params&quot;: [&quot;fdd80a<span class="hljs-number">8500</span>0a<span class="hljs-number">010004</span>a<span class="hljs-number">9670</span>e21aeb8f<span class="hljs-number">0281980657</span>c6c6cc9e<span class="hljs-number">9480</span>4b9cbff650cb5a9a1b20b<span class="hljs-number">8556</span>cbcd6de7afbb816d2ff9be8ff250d<span class="hljs-number">8075</span>a<span class="hljs-number">6830</span>0e<span class="hljs-number">5156</span>9c96ab998fec90a6e0bd1a6cf0eb12e0c33dae1c<span class="hljs-number">4428</span>1eb<span class="hljs-number">905791</span>0d6a40cf<span class="hljs-number">7698</span>7e721d622dae13e79ce<span class="hljs-number">160739</span>bf4ff7c0ce<span class="hljs-number">8408</span>aa23dd619c5aa5e25d078d64cd<span class="hljs-number">198830</span>e8e<span class="hljs-number">7043</span>6f<span class="hljs-number">5611</span>b1e&quot;, 123]}&#x27; -H <span class="hljs-string">&quot;Content-Type: application/json&quot;</span> http:<span class="hljs-comment">//127.0.0.1:9999/</span>
{<span class="hljs-string">&quot;result&quot;</span>:[<span class="hljs-string">&quot;a9670e21aeb8f0281980657c6c6cc9e94804b9cbff650cb5a9a1b20b8556cbcde5d22ede02c2e6e5df6a12367082a5cba26d37d22369dd8659388738b8ed7109&quot;</span>,<span class="hljs-string">&quot;6de7afbb816d2ff9be8ff250d8075a68300e51569c96ab998fec90a6e0bd1a6c43224409c57c70319b8167db086e923344f867033551a3055d7e65563db295f2&quot;</span>,<span class="hljs-string">&quot;f0eb12e0c33dae1c44281eb9057910d6a40cf76987e721d622dae13e79ce160796046de397a4d2f17c01c42815005f67d801b2c0e01d1923d4bbb13559cccf4a&quot;</span>,<span class="hljs-string">&quot;39bf4ff7c0ce8408aa23dd619c5aa5e25d078d64cd198830e8e70436f5611b1e0346f7853fd0d4ab792896f46714b8964875ddf0db22c2b30f4cf4ad5b0052c9&quot;</span>],<span class="hljs-string">&quot;error&quot;</span>:<span class="hljs-literal">null</span>}
</code></pre>
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/docs/next/testkit/testkit"><span class="arrow-prev"></span><span>Testkit</span></a><a class="docs-next button" href="/docs/next/contributing"><span>Contributing</span><span class="arrow-next"></span></a></div></div></div><nav class="onPageNav"><ul class="toc-headings"><li><a href="#step-1-java-and-scala">Step 1: Java and Scala</a></li><li><a href="#step-2-bitcoin-s-repository">Step 2: Bitcoin-S Repository</a></li><li><a href="#step-3-building-the-oracle-server">Step 3: Building the Oracle Server</a></li><li><a href="#step-4-configuration">Step 4: Configuration</a></li><li><a href="#server-endpoints">Server Endpoints</a><ul class="toc-headings"><li><a href="#create-event-example">Create Event Example</a></li><li><a href="#digit-decomposition-example">Digit Decomposition Example</a></li></ul></li></ul></nav></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"><img src="/img/favicon.ico" alt="bitcoin-s" width="66" height="58"/></a><div><h5>Docs</h5><a href="/docs/en/getting-started">Getting Started</a><a href="/docs/en/core/core-intro">Guides</a><a href="/api/org/bitcoins">API Reference</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a><a href="https://join.slack.com/t/suredbits/shared_invite/zt-eavycu0x-WQL7XOakzQo8tAy7jHHZUw" target="_blank" rel="noreferrer noopener">Slack</a><a href="https://gitter.im/bitcoin-s-core/">Gitter chat</a></div><div><h5>More</h5><a href="https://github.com/bitcoin-s/bitcoin-s">GitHub</a><a class="github-button" href="https://github.com/bitcoin-s/bitcoin-s" data-icon="octicon-star" data-count-href="/bitcoin-s/bitcoin-s-core/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><section class="copyright">Copyright © 2021 Suredbits &amp; the bitcoin-s developers</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>
document.addEventListener('keyup', function(e) {
if (e.target !== document.body) {
return;
}
// keyCode for '/' (slash)
if (e.keyCode === 191) {
const search = document.getElementById('search_input_react');
search && search.focus();
}
});
</script><script>
var search = docsearch({
apiKey: '0a510688bf8448e19aeb380377d328d3',
indexName: 'bitcoin-s',
inputSelector: '#search_input_react'
});
</script></body></html>