Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
updated Zcredits
Browse files Browse the repository at this point in the history
  • Loading branch information
jorian committed Feb 15, 2018
1 parent 7cbcfb8 commit 569ef3c
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 39 deletions.
Binary file modified docs/build/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/faq.doctree
Binary file not shown.
14 changes: 11 additions & 3 deletions docs/build/html/_sources/api.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The json code in all the methods below is the data that is needed for each metho
.. code-block:: json
{
"userpass":"$userpass",
"userpass":"<userpass>",
"method":"autoprice",
"base":"KMD",
"rel":"BTC",
Expand Down Expand Up @@ -60,15 +60,23 @@ A full relay node is started by running marketmaker with the following arguments
"coins":["<coins>"]
}
``gui`` is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.
- ``gui`` is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.
- ``profitmargin`` is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the ``autoprice`` method.
- ``userhome`` is the location of the userhome.
- ``passphrase`` is the passphrase that is needed by ``marketmaker`` to determine the userpass and all smartaddresses that BarterDEX is going to use.
- ``coins`` needs a JSON of all BarterDEX-enabled coins. Not all cryptocurrencies are able to do atomic swaps, because they lack CheckLockTimeVerify (BIP65) or one of the necessary Bitcoin API methods. (See :ref:`how-to-get-listed` for details)

``profitmargin`` is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the ``autoprice`` method.
.. _
New or private network
^^^^^^^^^^^^^^^^^^^^^^

In order to start a network other than the default network, you need to add 2 arguments to the marketmaker startup arguments. When initiating a new network, a full relay node must be used, and it has to define ``"netid":<int netid>`` and ``"seednode":"<ipaddress>"`` to the marketmaker startup arguments, where the netid is any integer higher than 0 but lower than 14420. The seednode is the ip address of the server being a full relay node.

Do not forget RPCport!

Non-relay nodes (``client``) need to use the same 2 arguments in its start up arguments, to be able to join that network.


Trade commands
--------------
Expand Down
37 changes: 30 additions & 7 deletions docs/build/html/_sources/faq.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@ Atomic means that a swap either totally succeeds or not at all.

Certain safeguards are needed to make sure the stealing of funds is not possible by either party.

.. _how-to-get-listed:

How to get listed on BarterDEX?
-------------------------------

The requirements for a coin to be able to do an atomic swap are:

- have `BIP65 (Check LockTime Verify)`_ implemented;
- support the following standard Bitcoin API methods: ``getinfo`` ``getrawmempool`` ``gettxout`` ``getrawtransaction`` ``getblock`` ``listunspent`` ``listtransactions`` ``validateaddress`` ``importprivkey`` ``importaddress`` ``estimatefee`` ``getblockhash`` ``sendrawtransaction`` ``signrawtransaction``.
- support the following standard Bitcoin API methods:

.. code-block:: bash
estimatefee importaddress
getblock importprivkey
getblockhash listunspent
getinfo listtransactions
getrawmempool validateaddress
getrawtransaction sendrawtransaction
gettxout signrawtransaction
.. _BIP65 (Check LockTime Verify): https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki

Expand All @@ -33,9 +46,9 @@ Native is when you download, install and sync the wallet of the coin you want to
What are Zcredits?
------------------

zcredits are credits for being able to do zero confirmation swaps
you get zcredits by depositing KMD and locking it for an x amount of weeks
so if you deposit 10 KMD you get 10 zcredits, if i'm not mistaken
Z-credits are credits for being able to do zero confirmation swaps. Zero confirmation swaps let you swap within 30 seconds, instead of waiting for the standard coin confirmation times.

You get Z-credits by depositing KMD and locking it for an X amount of weeks. So if you deposit 10 KMD you get 10 zcredits, and trades worth up to 10 KMD are now eligible for Zero Confirmation swaps. This is valid for all coins, even if KMD is not involved in a trade. BarterDEX will determine the value of the trade equivalent in KMD to check if a Zero Confirmation swap is possible. For BarterDEX to be able to determine this, a price must be set for the coin/KMD pair.

What are UTXOs?
---------------
Expand All @@ -54,12 +67,14 @@ Why can't I claim my expired 0-conf deposit?

This is due to avoid bad actors stealing the deposit, and depends on the time you made a deposit. Funds are available 3 - 10 days after the expiration of the number of weeks you defined when making the deposit.

The calculation in the code:

.. code-block:: c
timestamp = (uint32_t) time(NULL);
timestamp /= LP_WEEKMULT;
timestamp += weeks + 2;
timestamp *= LP_WEEKMULT;
timestamp /= LP_WEEKMULT;
timestamp += weeks + 2;
timestamp *= LP_WEEKMULT;
Expand Down Expand Up @@ -159,6 +174,14 @@ What are the differences between BarterDEX and Altcoin.io?
Can I privately swap coins with another person?
-----------------------------------------------

What is a Liquidity Provider (LP) node?
---------------------------------------

Do I need to leave BarterDEX running all the time?
--------------------------------------------------

Yes. Atomic swaps needs signed transactions with your private key, so you need to leave BarterDEX running to be able to execute orders.

Yes, that possibility exists, but for now it's only done using the Command Line. See the guide in our Guides section explaining what needs to be done.

.. _Komodo Platform assetchains: https://www.komodoplatform.com/en/blog/komodo-smart-contracts-assetchains-and-geckochains
Expand Down
13 changes: 10 additions & 3 deletions docs/build/html/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ <h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to t
<p><code class="docutils literal"><span class="pre">127.0.0.1:7783</span></code> is the ip address and port where BarterDEX is listening for commands.</p>
<p>The json code in all the methods below is the data that is needed for each method described (mind the escape characters when using shell). For example:</p>
<div class="highlight-json"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="nt">&quot;userpass&quot;</span><span class="p">:</span><span class="s2">&quot;$userpass&quot;</span><span class="p">,</span>
<span class="nt">&quot;userpass&quot;</span><span class="p">:</span><span class="s2">&quot;&lt;userpass&gt;&quot;</span><span class="p">,</span>
<span class="nt">&quot;method&quot;</span><span class="p">:</span><span class="s2">&quot;autoprice&quot;</span><span class="p">,</span>
<span class="nt">&quot;base&quot;</span><span class="p">:</span><span class="s2">&quot;KMD&quot;</span><span class="p">,</span>
<span class="nt">&quot;rel&quot;</span><span class="p">:</span><span class="s2">&quot;BTC&quot;</span><span class="p">,</span>
Expand All @@ -231,12 +231,19 @@ <h3>Startup arguments<a class="headerlink" href="#startup-arguments" title="Perm
<span class="p">}</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">gui</span></code> is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.</p>
<p><code class="docutils literal"><span class="pre">profitmargin</span></code> is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the <code class="docutils literal"><span class="pre">autoprice</span></code> method.</p>
<ul class="simple">
<li><code class="docutils literal"><span class="pre">gui</span></code> is the codename for the GUI used to start marketmaker with. If you are the developer of a GUI, you need to define a codename for your GUI. Share this in the Komodo Platform slack and you will get paid for every trade a user makes using your GUI.</li>
<li><code class="docutils literal"><span class="pre">profitmargin</span></code> is the default profitmargin that this full relay node (or Liquidity Provider node) will use when placing orders in orderbooks using the <code class="docutils literal"><span class="pre">autoprice</span></code> method.</li>
<li><code class="docutils literal"><span class="pre">userhome</span></code> is the location of the userhome.</li>
<li><code class="docutils literal"><span class="pre">passphrase</span></code> is the passphrase that is needed by <code class="docutils literal"><span class="pre">marketmaker</span></code> to determine the userpass and all smartaddresses that BarterDEX is going to use.</li>
<li><code class="docutils literal"><span class="pre">coins</span></code> needs a JSON of all BarterDEX-enabled coins. Not all cryptocurrencies are able to do atomic swaps, because they lack CheckLockTimeVerify (BIP65) or one of the necessary Bitcoin API methods. (See <a class="reference internal" href="faq.html#how-to-get-listed"><span class="std std-ref">How to get listed on BarterDEX?</span></a> for details)</li>
</ul>
</div>
<div class="section" id="new-or-private-network">
<h3>New or private network<a class="headerlink" href="#new-or-private-network" title="Permalink to this headline"></a></h3>
<p>In order to start a network other than the default network, you need to add 2 arguments to the marketmaker startup arguments. When initiating a new network, a full relay node must be used, and it has to define <code class="docutils literal"><span class="pre">&quot;netid&quot;:&lt;int</span> <span class="pre">netid&gt;</span></code> and <code class="docutils literal"><span class="pre">&quot;seednode&quot;:&quot;&lt;ipaddress&gt;&quot;</span></code> to the marketmaker startup arguments, where the netid is any integer higher than 0 but lower than 14420. The seednode is the ip address of the server being a full relay node.</p>
<p>Do not forget RPCport!</p>
<p>Non-relay nodes (<code class="docutils literal"><span class="pre">client</span></code>) need to use the same 2 arguments in its start up arguments, to be able to join that network.</p>
</div>
</div>
<div class="section" id="trade-commands">
Expand Down
34 changes: 26 additions & 8 deletions docs/build/html/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
<li class="toctree-l2"><a class="reference internal" href="#what-are-the-differences-between-barterdex-and-blocknet-dx">What are the differences between BarterDEX and BlockNET DX?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#what-are-the-differences-between-barterdex-and-altcoin-io">What are the differences between BarterDEX and Altcoin.io?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#can-i-privately-swap-coins-with-another-person">Can I privately swap coins with another person?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#what-is-a-liquidity-provider-lp-node">What is a Liquidity Provider (LP) node?</a></li>
<li class="toctree-l2"><a class="reference internal" href="#do-i-need-to-leave-barterdex-running-all-the-time">Do I need to leave BarterDEX running all the time?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started with BarterDEX</a></li>
Expand Down Expand Up @@ -192,12 +194,21 @@ <h2>What is an atomic swap?<a class="headerlink" href="#what-is-an-atomic-swap"
<p>Certain safeguards are needed to make sure the stealing of funds is not possible by either party.</p>
</div>
<div class="section" id="how-to-get-listed-on-barterdex">
<h2>How to get listed on BarterDEX?<a class="headerlink" href="#how-to-get-listed-on-barterdex" title="Permalink to this headline"></a></h2>
<span id="how-to-get-listed"></span><h2>How to get listed on BarterDEX?<a class="headerlink" href="#how-to-get-listed-on-barterdex" title="Permalink to this headline"></a></h2>
<p>The requirements for a coin to be able to do an atomic swap are:</p>
<ul class="simple">
<li>have <a class="reference external" href="https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki">BIP65 (Check LockTime Verify)</a> implemented;</li>
<li>support the following standard Bitcoin API methods: <code class="docutils literal"><span class="pre">getinfo</span></code> <code class="docutils literal"><span class="pre">getrawmempool</span></code> <code class="docutils literal"><span class="pre">gettxout</span></code> <code class="docutils literal"><span class="pre">getrawtransaction</span></code> <code class="docutils literal"><span class="pre">getblock</span></code> <code class="docutils literal"><span class="pre">listunspent</span></code> <code class="docutils literal"><span class="pre">listtransactions</span></code> <code class="docutils literal"><span class="pre">validateaddress</span></code> <code class="docutils literal"><span class="pre">importprivkey</span></code> <code class="docutils literal"><span class="pre">importaddress</span></code> <code class="docutils literal"><span class="pre">estimatefee</span></code> <code class="docutils literal"><span class="pre">getblockhash</span></code> <code class="docutils literal"><span class="pre">sendrawtransaction</span></code> <code class="docutils literal"><span class="pre">signrawtransaction</span></code>.</li>
<li>support the following standard Bitcoin API methods:</li>
</ul>
<div class="highlight-bash"><div class="highlight"><pre><span></span>estimatefee importaddress
getblock importprivkey
getblockhash listunspent
getinfo listtransactions
getrawmempool validateaddress
getrawtransaction sendrawtransaction
gettxout signrawtransaction
</pre></div>
</div>
</div>
<div class="section" id="electrum-or-native">
<h2>Electrum or Native?<a class="headerlink" href="#electrum-or-native" title="Permalink to this headline"></a></h2>
Expand All @@ -207,9 +218,8 @@ <h2>Electrum or Native?<a class="headerlink" href="#electrum-or-native" title="P
</div>
<div class="section" id="what-are-zcredits">
<h2>What are Zcredits?<a class="headerlink" href="#what-are-zcredits" title="Permalink to this headline"></a></h2>
<p>zcredits are credits for being able to do zero confirmation swaps
you get zcredits by depositing KMD and locking it for an x amount of weeks
so if you deposit 10 KMD you get 10 zcredits, if i’m not mistaken</p>
<p>Z-credits are credits for being able to do zero confirmation swaps. Zero confirmation swaps let you swap within 30 seconds, instead of waiting for the standard coin confirmation times.</p>
<p>You get Z-credits by depositing KMD and locking it for an X amount of weeks. So if you deposit 10 KMD you get 10 zcredits, and trades worth up to 10 KMD are now eligible for Zero Confirmation swaps. This is valid for all coins, even if KMD is not involved in a trade. BarterDEX will determine the value of the trade equivalent in KMD to check if a Zero Confirmation swap is possible. For BarterDEX to be able to determine this, a price must be set for the coin/KMD pair.</p>
</div>
<div class="section" id="what-are-utxos">
<h2>What are UTXOs?<a class="headerlink" href="#what-are-utxos" title="Permalink to this headline"></a></h2>
Expand All @@ -223,10 +233,11 @@ <h2>Why are multiple UTXOs needed?<a class="headerlink" href="#why-are-multiple-
<div class="section" id="why-can-t-i-claim-my-expired-0-conf-deposit">
<h2>Why can’t I claim my expired 0-conf deposit?<a class="headerlink" href="#why-can-t-i-claim-my-expired-0-conf-deposit" title="Permalink to this headline"></a></h2>
<p>This is due to avoid bad actors stealing the deposit, and depends on the time you made a deposit. Funds are available 3 - 10 days after the expiration of the number of weeks you defined when making the deposit.</p>
<p>The calculation in the code:</p>
<div class="highlight-c"><div class="highlight"><pre><span></span><span class="n">timestamp</span> <span class="o">=</span> <span class="p">(</span><span class="kt">uint32_t</span><span class="p">)</span> <span class="n">time</span><span class="p">(</span><span class="nb">NULL</span><span class="p">);</span>
<span class="n">timestamp</span> <span class="o">/=</span> <span class="n">LP_WEEKMULT</span><span class="p">;</span>
<span class="n">timestamp</span> <span class="o">+=</span> <span class="n">weeks</span> <span class="o">+</span> <span class="mi">2</span><span class="p">;</span>
<span class="n">timestamp</span> <span class="o">*=</span> <span class="n">LP_WEEKMULT</span><span class="p">;</span>
<span class="n">timestamp</span> <span class="o">/=</span> <span class="n">LP_WEEKMULT</span><span class="p">;</span>
<span class="n">timestamp</span> <span class="o">+=</span> <span class="n">weeks</span> <span class="o">+</span> <span class="mi">2</span><span class="p">;</span>
<span class="n">timestamp</span> <span class="o">*=</span> <span class="n">LP_WEEKMULT</span><span class="p">;</span>
</pre></div>
</div>
</div>
Expand Down Expand Up @@ -531,6 +542,13 @@ <h2>What are the differences between BarterDEX and Altcoin.io?<a class="headerli
</div>
<div class="section" id="can-i-privately-swap-coins-with-another-person">
<h2>Can I privately swap coins with another person?<a class="headerlink" href="#can-i-privately-swap-coins-with-another-person" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="what-is-a-liquidity-provider-lp-node">
<h2>What is a Liquidity Provider (LP) node?<a class="headerlink" href="#what-is-a-liquidity-provider-lp-node" title="Permalink to this headline"></a></h2>
</div>
<div class="section" id="do-i-need-to-leave-barterdex-running-all-the-time">
<h2>Do I need to leave BarterDEX running all the time?<a class="headerlink" href="#do-i-need-to-leave-barterdex-running-all-the-time" title="Permalink to this headline"></a></h2>
<p>Yes. Atomic swaps needs signed transactions with your private key, so you need to leave BarterDEX running to be able to execute orders.</p>
<p>Yes, that possibility exists, but for now it’s only done using the Command Line. See the guide in our Guides section explaining what needs to be done.</p>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions docs/build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ <h1>Welcome to BarterDEX’s documentation!<a class="headerlink" href="#welcome-
<li class="toctree-l2"><a class="reference internal" href="faq.html#what-are-the-differences-between-barterdex-and-blocknet-dx">What are the differences between BarterDEX and BlockNET DX?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#what-are-the-differences-between-barterdex-and-altcoin-io">What are the differences between BarterDEX and Altcoin.io?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#can-i-privately-swap-coins-with-another-person">Can I privately swap coins with another person?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#what-is-a-liquidity-provider-lp-node">What is a Liquidity Provider (LP) node?</a></li>
<li class="toctree-l2"><a class="reference internal" href="faq.html#do-i-need-to-leave-barterdex-running-all-the-time">Do I need to leave BarterDEX running all the time?</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started with BarterDEX</a><ul>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.

0 comments on commit 569ef3c

Please sign in to comment.