You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

839 satır
51KB

  1. <!DOCTYPE html>
  2. <html class="writer-html5" lang="en" >
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title>DERO-HE Quickstart &mdash; DERO Documentation documentation</title>
  7. <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  8. <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
  9. <link rel="stylesheet" href="../../_static/css/custom.css" type="text/css" />
  10. <!--[if lt IE 9]>
  11. <script src="../../_static/js/html5shiv.min.js"></script>
  12. <![endif]-->
  13. <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
  14. <script src="../../_static/jquery.js"></script>
  15. <script src="../../_static/underscore.js"></script>
  16. <script src="../../_static/doctools.js"></script>
  17. <script type="text/javascript" src="../../_static/js/theme.js"></script>
  18. <link rel="index" title="Index" href="../../genindex.html" />
  19. <link rel="search" title="Search" href="../../search.html" />
  20. </head>
  21. <body class="wy-body-for-nav">
  22. <div class="wy-grid-for-nav">
  23. <nav data-toggle="wy-nav-shift" class="wy-nav-side">
  24. <div class="wy-side-scroll">
  25. <div class="wy-side-nav-search" >
  26. <a href="../../index.html">
  27. <img src="../../_static/docs_logo.png" class="logo" alt="Logo"/>
  28. </a>
  29. <div role="search">
  30. <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
  31. <input type="text" name="q" placeholder="Search docs" />
  32. <input type="hidden" name="check_keywords" value="yes" />
  33. <input type="hidden" name="area" value="default" />
  34. </form>
  35. </div>
  36. </div>
  37. <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
  38. <p class="caption"><span class="caption-text">Basic's</span></p>
  39. <ul>
  40. <li class="toctree-l1"><a class="reference internal" href="../basic_desktopwallet.html">Desktop Wallet User Guide</a><ul>
  41. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#downloading-binaries">Downloading Binaries</a></li>
  42. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#installing-the-desktop-app">Installing the desktop app</a></li>
  43. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#windows-installation">Windows Installation</a></li>
  44. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#mac-installation">MAC Installation</a></li>
  45. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#linux-installation">Linux Installation</a></li>
  46. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#where-are-the-dero-wallet-files-located">Where are the DERO Wallet files located?</a></li>
  47. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#create-a-new-wallet">Create a new wallet</a></li>
  48. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#opening-a-dero-wallet">Opening a DERO wallet</a></li>
  49. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#synchronizing-the-dero-cmd-wallet">Synchronizing the DERO CMD Wallet</a></li>
  50. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#rescan-blockchain">Rescan Blockchain</a></li>
  51. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#upgrading-from-a-previous-version">Upgrading from a previous version</a></li>
  52. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#main-wallet-screen">Main wallet screen</a></li>
  53. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#wallet-status">Wallet status</a></li>
  54. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#offline-mode">Offline mode</a></li>
  55. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#sending-dero">Sending DERO</a></li>
  56. <li class="toctree-l2"><a class="reference internal" href="../basic_desktopwallet.html#restoring-dero-funds">Restoring DERO Funds</a></li>
  57. </ul>
  58. </li>
  59. <li class="toctree-l1"><a class="reference internal" href="../basic_webwallet.html">Browser Wallet User Guide</a><ul>
  60. <li class="toctree-l2"><a class="reference internal" href="../basic_webwallet.html#using-the-browser-wallet">Using the Browser Wallet</a></li>
  61. <li class="toctree-l2"><a class="reference internal" href="../basic_webwallet.html#create-a-wallet">Create a wallet</a></li>
  62. <li class="toctree-l2"><a class="reference internal" href="../basic_webwallet.html#restore-a-wallet">Restore a wallet</a></li>
  63. <li class="toctree-l2"><a class="reference internal" href="../basic_webwallet.html#rescan-blockchain">Rescan Blockchain</a></li>
  64. </ul>
  65. </li>
  66. <li class="toctree-l1"><a class="reference internal" href="../basic_cmd.html">Command Line Wallet User Guide</a><ul>
  67. <li class="toctree-l2"><a class="reference internal" href="../basic_cmd.html#rescan-blockchain">Rescan Blockchain</a></li>
  68. </ul>
  69. </li>
  70. <li class="toctree-l1"><a class="reference internal" href="../basic_coldwallet.html">Cold Wallet</a><ul>
  71. <li class="toctree-l2"><a class="reference internal" href="../basic_coldwallet.html#creating-a-cold-storage-dero-wallet">Creating a cold storage DERO wallet</a></li>
  72. <li class="toctree-l2"><a class="reference internal" href="../basic_coldwallet.html#creating-transactions-using-cold-wallet">Creating transactions using cold wallet</a></li>
  73. </ul>
  74. </li>
  75. <li class="toctree-l1"><a class="reference internal" href="../basic_downloads.html">Downloads</a></li>
  76. <li class="toctree-l1"><a class="reference internal" href="../basic_whitepaper.html">Whitepaper</a></li>
  77. <li class="toctree-l1"><a class="reference internal" href="../basic_quickstart.html">Quickstart</a></li>
  78. <li class="toctree-l1"><a class="reference internal" href="../basic_createrestorewallet.html">Create/Restore Wallet</a></li>
  79. <li class="toctree-l1"><a class="reference internal" href="../basic_mining.html">Mining DERO</a><ul>
  80. <li class="toctree-l2"><a class="reference internal" href="../basic_mining.html#mining-dero-with-windows">Mining DERO with Windows</a></li>
  81. <li class="toctree-l2"><a class="reference internal" href="../basic_mining.html#mining-dero-with-linux">Mining DERO with Linux</a></li>
  82. </ul>
  83. </li>
  84. <li class="toctree-l1"><a class="reference internal" href="../basic_runderofullnode.html">Run DERO Full Node</a></li>
  85. <li class="toctree-l1"><a class="reference internal" href="../basic_trading.html">Trading</a></li>
  86. </ul>
  87. <p class="caption"><span class="caption-text">DERO Stargate RC2 Testnet</span></p>
  88. <ul>
  89. <li class="toctree-l1"><a class="reference internal" href="../stargate_wallet.html">CLI Wallet User Guide (Stargate)</a><ul>
  90. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#downloading-wallet">Downloading Wallet</a></li>
  91. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#install-wallet">Install Wallet</a><ul>
  92. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#windows">Windows</a></li>
  93. </ul>
  94. </li>
  95. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#opening-wallet">Opening Wallet</a></li>
  96. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#create-new-wallet">Create New Wallet</a></li>
  97. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#recover-existing-wallet-from-seed">Recover existing wallet from seed</a></li>
  98. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#create-view-only-wallet">Create View only Wallet</a></li>
  99. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#cli-wallet-functions">CLI Wallet Functions</a><ul>
  100. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#display-account-address">Display Account Address</a></li>
  101. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#display-seed">Display Seed</a></li>
  102. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#display-keys-hex">Display Keys (Hex)</a></li>
  103. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#account-registration">Account Registration</a></li>
  104. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#display-wallet-pool">Display Wallet Pool</a></li>
  105. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#transfer-send-dero-to-another-wallet">Transfer (Send DERO) To Another Wallet</a></li>
  106. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#change-wallet-password">Change Wallet Password</a></li>
  107. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#transfer-all-balance-send-dero-to-another-wallet">Transfer all balance (send DERO) To Another Wallet</a></li>
  108. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#show-transaction-history">Show transaction history</a></li>
  109. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#rescan-transaction-history">Rescan transaction history</a></li>
  110. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#exit-menu-and-start-prompt">Exit menu and start prompt</a></li>
  111. <li class="toctree-l3"><a class="reference internal" href="../stargate_wallet.html#exit-wallet">Exit Wallet</a></li>
  112. </ul>
  113. </li>
  114. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#command-line-help-functions">Command Line Help Functions</a></li>
  115. </ul>
  116. </li>
  117. <li class="toctree-l1"><a class="reference internal" href="../stargate_wallet.html#gui-wallet-user-guide-stargate">GUI Wallet User Guide (Stargate)</a><ul>
  118. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id1">Downloading Wallet</a></li>
  119. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id2">Install Wallet</a></li>
  120. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id3">Create New Wallet</a></li>
  121. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id4">Recover existing wallet from seed</a></li>
  122. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id5">Create View only Wallet</a></li>
  123. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#gui-wallet-functions">GUI Wallet Functions</a></li>
  124. </ul>
  125. </li>
  126. <li class="toctree-l1"><a class="reference internal" href="../stargate_wallet.html#broswer-wallet-user-guide-stargate">Broswer Wallet User Guide (Stargate)</a><ul>
  127. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id6">Create New Wallet</a></li>
  128. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id7">Recover existing wallet from seed</a></li>
  129. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id8">Create View only Wallet</a></li>
  130. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#id9">GUI Wallet Functions</a></li>
  131. </ul>
  132. </li>
  133. <li class="toctree-l1"><a class="reference internal" href="../stargate_wallet.html#cold-wallet-stargate">Cold Wallet (Stargate)</a><ul>
  134. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#cli">CLI</a></li>
  135. <li class="toctree-l2"><a class="reference internal" href="../stargate_wallet.html#gui">GUI</a></li>
  136. </ul>
  137. </li>
  138. <li class="toctree-l1"><a class="reference internal" href="../stargate_dvm.html">DERO Virtual Machine</a><ul>
  139. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#dim-statement">DIM Statement</a></li>
  140. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#function-statement">Function statement</a></li>
  141. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#goto-statement">GOTO Statement</a></li>
  142. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#if">IF</a></li>
  143. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#let-statement">LET Statement</a></li>
  144. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#return-statement">Return Statement</a></li>
  145. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#support-functions">Support Functions</a></li>
  146. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#lotter-sc-guide">Lotter SC Guide</a></li>
  147. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#lottery-bas">Lottery.bas</a></li>
  148. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#token-sc-guide">Token SC Guide</a></li>
  149. <li class="toctree-l2"><a class="reference internal" href="../stargate_dvm.html#token-bas">Token.bas</a></li>
  150. </ul>
  151. </li>
  152. </ul>
  153. <p class="caption"><span class="caption-text">Developer's Guide</span></p>
  154. <ul>
  155. <li class="toctree-l1"><a class="reference internal" href="../dev_astrobwt.html">AstroBWT</a><ul>
  156. <li class="toctree-l2"><a class="reference internal" href="../dev_astrobwt.html#dero-astrobwt-cpu-mining-proof-of-work">DERO AstroBWT CPU Mining Proof-of-Work</a></li>
  157. <li class="toctree-l2"><a class="reference internal" href="../dev_astrobwt.html#astrobwt-building">AstroBWT Building</a></li>
  158. <li class="toctree-l2"><a class="reference internal" href="../dev_astrobwt.html#astrobwt-pseudo-code">AstroBWT Pseudo CODE</a></li>
  159. <li class="toctree-l2"><a class="reference internal" href="../dev_astrobwt.html#explaining-astrobwt">Explaining AstroBWT</a></li>
  160. <li class="toctree-l2"><a class="reference internal" href="../dev_astrobwt.html#astrobwt-hash-rates">AstroBWT Hash Rates</a></li>
  161. </ul>
  162. </li>
  163. <li class="toctree-l1"><a class="reference internal" href="../dev_DHEBP.html">DHEBP (DERO Homomorphic Encryption Blockchain Protocol)</a><ul>
  164. <li class="toctree-l2"><a class="reference internal" href="../dev_DHEBP.html#dhebp-alpha-code-to-demonstrate-fhe-blockchain-transactions">DHEBP alpha code to demonstrate FHE blockchain transactions.</a></li>
  165. <li class="toctree-l2"><a class="reference internal" href="../dev_DHEBP.html#transaction-details">Transaction Details</a></li>
  166. <li class="toctree-l2"><a class="reference internal" href="../dev_DHEBP.html#ring-size-tx-size-data">Ring Size, Tx Size data</a></li>
  167. <li class="toctree-l2"><a class="reference internal" href="../dev_DHEBP.html#build">Build</a></li>
  168. <li class="toctree-l2"><a class="reference internal" href="../dev_DHEBP.html#output-sample">Output Sample</a></li>
  169. </ul>
  170. </li>
  171. <li class="toctree-l1"><a class="reference internal" href="../dev_graviton.html">Graviton</a><ul>
  172. <li class="toctree-l2"><a class="reference internal" href="../dev_graviton.html#graviton-zfs-for-key-value-stores">Graviton: ZFS for Key-Value Stores</a></li>
  173. <li class="toctree-l2"><a class="reference internal" href="../dev_graviton.html#standalone-alpha-release">Standalone Alpha Release</a></li>
  174. <li class="toctree-l2"><a class="reference internal" href="../dev_graviton.html#features">Features</a></li>
  175. <li class="toctree-l2"><a class="reference internal" href="../dev_graviton.html#benefits">Benefits</a></li>
  176. </ul>
  177. </li>
  178. <li class="toctree-l1"><a class="reference internal" href="../dev_rpcapi.html">DERO Atlantis RPC API V2.0</a><ul>
  179. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#introduction">1. Introduction</a><ul>
  180. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#data-types">1.1 Data Types</a></li>
  181. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#code-examples">1.2 Code Examples</a></li>
  182. </ul>
  183. </li>
  184. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#quick-overview">2. Quick Overview</a></li>
  185. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#dero-daemon-rpc-interface">3. DERO Daemon RPC Interface</a></li>
  186. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#id1">3.1 Introduction</a></li>
  187. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#methods-via-post">3.2 Methods via POST</a><ul>
  188. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblockcount">3.2.1 getblockcount</a></li>
  189. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#get-info">3.2.2 get_info</a></li>
  190. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblocktemplate">3.2.3 getblocktemplate</a></li>
  191. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#submitblock">3.2.4 submitblock</a></li>
  192. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getlastblockheader">3.2.5 getlastblockheader</a></li>
  193. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblockheaderbyhash">3.2.6 getblockheaderbyhash</a></li>
  194. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblockheaderbytopoheight">3.2.7 getblockheaderbytopoheight</a></li>
  195. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblockheaderbyheight">3.2.8 getblockheaderbyheight</a></li>
  196. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getblock">3.2.9 getblock</a></li>
  197. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#gettxpool">3.2.10 gettxpool</a></li>
  198. </ul>
  199. </li>
  200. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#methods-via-get">3.3 Methods via GET</a><ul>
  201. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getheight">3.3.1 getheight</a></li>
  202. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#gettransactions">3.3.2 gettransactions</a></li>
  203. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#sendrawtransaction">3.3.3 sendrawtransaction</a></li>
  204. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#is-key-image-spent">3.3.4 is_key_image_spent</a></li>
  205. </ul>
  206. </li>
  207. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#dero-wallet-rpc-interface">4 DERO Wallet RPC Interface</a></li>
  208. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#id2">4.1 Introduction</a></li>
  209. <li class="toctree-l2"><a class="reference internal" href="../dev_rpcapi.html#id3">4.2 Methods via POST</a><ul>
  210. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getaddress">4.2.1 getaddress</a></li>
  211. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#getbalance">4.2.2 getbalance</a></li>
  212. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#id4">4.2.3 getheight</a></li>
  213. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#transfer">4.2.4 transfer</a></li>
  214. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#transfer-split">4.2.5 transfer_split</a></li>
  215. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#get-bulk-payments">4.2.6 get_bulk_payments</a></li>
  216. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#query-key">4.2.7 query_key</a></li>
  217. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#make-integrated-address">4.2.8 make_integrated_address</a></li>
  218. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#split-integrated-address">4.2.9 split_integrated_address</a></li>
  219. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#get-transfer-by-txid">4.2.10 get_transfer_by_txid</a></li>
  220. <li class="toctree-l3"><a class="reference internal" href="../dev_rpcapi.html#get-transfers">4.2.11 get_transfers</a></li>
  221. </ul>
  222. </li>
  223. </ul>
  224. </li>
  225. </ul>
  226. <p class="caption"><span class="caption-text">Useful Links</span></p>
  227. <ul>
  228. <li class="toctree-l1"><a class="reference internal" href="../usefull_importantlinks.html">Links</a><ul>
  229. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-explorer">DERO Explorer</a></li>
  230. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-webwallet">DERO Webwallet</a></li>
  231. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-wiki">DERO Wiki</a></li>
  232. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-forum">DERO Forum</a></li>
  233. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-social-media">DERO Social Media</a></li>
  234. <li class="toctree-l2"><a class="reference internal" href="../usefull_importantlinks.html#dero-community-channels">DERO Community Channels</a></li>
  235. </ul>
  236. </li>
  237. </ul>
  238. </div>
  239. </div>
  240. </nav>
  241. <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
  242. <nav class="wy-nav-top" aria-label="top navigation">
  243. <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
  244. <a href="../../index.html">DERO Documentation</a>
  245. </nav>
  246. <div class="wy-nav-content">
  247. <div class="rst-content">
  248. <div role="navigation" aria-label="breadcrumbs navigation">
  249. <ul class="wy-breadcrumbs">
  250. <li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
  251. <li>DERO-HE Quickstart</li>
  252. <li class="wy-breadcrumbs-aside">
  253. <a href="../../_sources/rtd_pages/Archive RST/he_quickstart.rst.txt" rel="nofollow"> View page source</a>
  254. </li>
  255. </ul>
  256. <hr/>
  257. </div>
  258. <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
  259. <div itemprop="articleBody">
  260. <div class="section" id="dero-he-quickstart">
  261. <span id="he-quickstart"></span><h1>DERO-HE Quickstart<a class="headerlink" href="#dero-he-quickstart" title="Permalink to this headline">¶</a></h1>
  262. <p>Homomorphic encryption is a form of encryption allowing one to perform calculations on encrypted data without decrypting it first. The result of the computation is in an encrypted form, when decrypted the output is the same as if the operations had been performed on the unencrypted data.</p>
  263. <p>Homomorphic encryption can be used for privacy-preserving outsourced storage and computation. This allows data to be encrypted and out-sourced to commercial cloud environments for processing, all while encrypted. In highly regulated industries, such as health care, homomorphic encryption can be used to enable new services by removing privacy barriers inhibiting data sharing. For example, predictive analytics in health care can be hard to apply via a third party service provider due to medical data privacy concerns, but if the predictive analytics service provider can operate on encrypted data instead, these privacy concerns are diminished.</p>
  264. <p>DERO is pleased to announce release of DERO Homomorphic Encryption Protocol testnet. DERO will migrate from exisiting CryptoNote Protocol to it’s own DERO Homomorphic Encryption Blockchain Protocol(DHEBP).</p>
  265. <p><strong>Documentation</strong></p>
  266. <p>DVM is a decentralized platform that runs both public and private smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third-party interference.Public Smart contracts are open versions. However, the DVM is being designed to support Private Smart Contracts where everything is hidden, eg parties, and information involved. Smart Contracts are nothing but rules which apply on transacting parties.</p>
  267. <p>Current version of DVM is an interpretor based system to avoid security vulneribilities, issues and compiler backdoors. This also allows easy audits of Smart Contracts for quality,bug-testing and security assurances. DVM supports a new language DVM-BASIC.</p>
  268. <p>DVM apps run on a from scratch custom built privacy supporting, encrypted blockchain, an enormously powerful shared global infrastructure that can move value around and represent the ownership of assets/property without leaking any information.No one knows who owns what and who transferred to whom.</p>
  269. <ul class="simple">
  270. <li><p>This enables developers to create puzzles, games, voting, markets, store registries of debts or promises, move funds in accordance with instructions given long in the past (like a will or a futures contract) and many other ideas/things that have not been invented yet, all without a middleman or counterparty risk.</p></li>
  271. <li><p>DVM-BASIC is a contract-oriented, high-level language for implementing smart contracts. It is influenced by GW-BASIC, Visual Basic and C and is designed to target the DERO Virtual Machine (DVM). It is very easy to program and very readable.</p></li>
  272. <li><p>DVM runs Smart Contracts which are a collection of functions written in DVM-BASIC. These functions can be invoked over the blockchain to do something. SCs can act as libraries for other SCs.</p></li>
  273. <li><p>DVM supports number of comments formats such as ‘, // , /* <a href="#id1"><span class="problematic" id="id2">*</span></a>/ as good documentation is necessary.</p></li>
  274. </ul>
  275. <p><strong>Example Factorial Program</strong></p>
  276. <div class="highlight-php notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
  277. <span class="normal"> 2</span>
  278. <span class="normal"> 3</span>
  279. <span class="normal"> 4</span>
  280. <span class="normal"> 5</span>
  281. <span class="normal"> 6</span>
  282. <span class="normal"> 7</span>
  283. <span class="normal"> 8</span>
  284. <span class="normal"> 9</span>
  285. <span class="normal">10</span>
  286. <span class="normal">11</span>
  287. <span class="normal">12</span>
  288. <span class="normal">13</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="x"> &#39; This is a comment</span>
  289. <span class="x"> // This comment is supported</span>
  290. <span class="x"> /* this is multi-line comment */</span>
  291. <span class="x"> Function Factorial(s Uint64) Uint64 // this is a commment</span>
  292. <span class="x"> 10 DIM result,scopy as Uint64 /* this is also comment */</span>
  293. <span class="x"> 15 LET scopy = s</span>
  294. <span class="x"> 20 LET result = 1</span>
  295. <span class="x"> 30 LET result = result * s</span>
  296. <span class="x"> 40 LET s = s - 1</span>
  297. <span class="x"> 50 IF s &gt;= 2 THEN GOTO 30</span>
  298. <span class="x"> 60 PRINTF &quot;FACTORIAL of %d = %d&quot; scopy result</span>
  299. <span class="x"> 70 RETURN result</span>
  300. <span class="x"> End Function</span>
  301. </pre></div>
  302. </td></tr></table></div>
  303. <p><strong>DVM are written in a DVM-BASIC custom BASIC style language with line numbers.</strong></p>
  304. <p><strong>DVM supports uint64 and string data-types.</strong></p>
  305. <p><strong>DVM interprets the smart-contract and processes the SC line-line</strong></p>
  306. <ul class="simple">
  307. <li><p>uint64 supports almost all operators namely +,-,*,/,%</p></li>
  308. <li><p>uint64 support following bitwise operators &amp; ,|, ^, ! , &gt;&gt; , &lt;&lt;</p></li>
  309. <li><p>uint64 supports following logical operators &gt;, &gt;= , &lt;, &lt;=, == , !=</p></li>
  310. <li><p>string supports only + operator. string support concatenation with a uint64.</p></li>
  311. <li><p>string supports ==, != logical operators.</p></li>
  312. <li><p>All DVM variables are mandatory to define and are initialized to default values namely 0 and “”.</p></li>
  313. </ul>
  314. <p>A SC execution must return 0 to persist any changes made during execution. During execution, no panics should occur.</p>
  315. <div class="section" id="dim-statement">
  316. <h2>DIM Statement<a class="headerlink" href="#dim-statement" title="Permalink to this headline">¶</a></h2>
  317. <p>DIM stands for data in memory and is used to define variable names within a function</p>
  318. <p>syntax</p>
  319. <p>10 DIM variable1 as type 20 DIM variable1,variable2 as type</p>
  320. <p>type can be any type supported by DVM</p>
  321. <p>Defining a varible initializes a variable to its ZERO value.</p>
  322. </div>
  323. <div class="section" id="function-statement">
  324. <h2>Function statement<a class="headerlink" href="#function-statement" title="Permalink to this headline">¶</a></h2>
  325. <p>Function statement is used to define a function. See eg, below for a function which adds 2 numbers</p>
  326. <div class="highlight-php notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
  327. <span class="normal">2</span>
  328. <span class="normal">3</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="x"> Function ADD(x uint64, y uint64) uint64</span>
  329. <span class="x"> 10 RETURN x + y</span>
  330. <span class="x"> End Function</span>
  331. </pre></div>
  332. </td></tr></table></div>
  333. <p>Function syntax is of 2 types</p>
  334. <ol class="arabic simple">
  335. <li><p>Function function_name( 0 or more arguments )</p></li>
  336. <li><p>Function function_name( 0 or more arguments ) return type</p></li>
  337. </ol>
  338. <p>The rules for functions are as follows</p>
  339. <ul class="simple">
  340. <li><p>All functions begin with Function keyword</p></li>
  341. <li><p>Function name should be alpha-numeric. If the first letter of the function is Upper case alphabet, it can be invoked by blockchain and other smart-contracts. Otherwise the function can only be called by other functions within the smart contract.</p></li>
  342. <li><p>Function may or may not have a return type</p></li>
  343. <li><p>All functions must use RETURN to return from function or to return a value. RETURN is mandatory.</p></li>
  344. <li><p>All functions must end with End Function. End Function is mandatory</p></li>
  345. <li><p>A function can have a implicit parameter value of type uint64, which contains amount of DERO value sent with the transaction.</p></li>
  346. </ul>
  347. <p>Any error caused during processing will immediately stop execution and discard all changes that occur during SC execution.</p>
  348. <p>Any Entrypoint which returns uint64 value 0 is termed as success and will make transaction to commit all state changes.</p>
  349. </div>
  350. <div class="section" id="goto-statement">
  351. <h2>GOTO Statement<a class="headerlink" href="#goto-statement" title="Permalink to this headline">¶</a></h2>
  352. <p>It is used to jump to any point within the function. It cannot cross function-boundary</p>
  353. <p>syntax GOTO line-number</p>
  354. </div>
  355. <div class="section" id="if">
  356. <h2>IF<a class="headerlink" href="#if" title="Permalink to this headline">¶</a></h2>
  357. <p>If statement is used to evaluate expression and make decisions.It has following forms</p>
  358. <ol class="arabic simple">
  359. <li><p>IF expr1 condition expr2 THEN GOTO line number</p></li>
  360. <li><p>IF expr1 condition expr2 THEN GOTO line number ELSE GOTO line number</p></li>
  361. </ol>
  362. <p>This is used to change execution flow based on conditions. Conditions can be as complex expressions</p>
  363. </div>
  364. <div class="section" id="let-statement">
  365. <h2>LET Statement<a class="headerlink" href="#let-statement" title="Permalink to this headline">¶</a></h2>
  366. <p>LET is used to assign a value to a variable. value can be as complex as possible and can contain complex expression</p>
  367. <p>syntax</p>
  368. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">line number LET variable_name = expression;</span>
  369. </pre></div>
  370. </div>
  371. <p>expression can invoke other functions,eg</p>
  372. <p>10 LET x = 2 + 3 + ADD(2,3)</p>
  373. <p>ANY assignments within DVM can only be done using LET</p>
  374. </div>
  375. <div class="section" id="lottery-bas">
  376. <h2>Lottery.bas<a class="headerlink" href="#lottery-bas" title="Permalink to this headline">¶</a></h2>
  377. <div class="highlight-php notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
  378. <span class="normal"> 2</span>
  379. <span class="normal"> 3</span>
  380. <span class="normal"> 4</span>
  381. <span class="normal"> 5</span>
  382. <span class="normal"> 6</span>
  383. <span class="normal"> 7</span>
  384. <span class="normal"> 8</span>
  385. <span class="normal"> 9</span>
  386. <span class="normal">10</span>
  387. <span class="normal">11</span>
  388. <span class="normal">12</span>
  389. <span class="normal">13</span>
  390. <span class="normal">14</span>
  391. <span class="normal">15</span>
  392. <span class="normal">16</span>
  393. <span class="normal">17</span>
  394. <span class="normal">18</span>
  395. <span class="normal">19</span>
  396. <span class="normal">20</span>
  397. <span class="normal">21</span>
  398. <span class="normal">22</span>
  399. <span class="normal">23</span>
  400. <span class="normal">24</span>
  401. <span class="normal">25</span>
  402. <span class="normal">26</span>
  403. <span class="normal">27</span>
  404. <span class="normal">28</span>
  405. <span class="normal">29</span>
  406. <span class="normal">30</span>
  407. <span class="normal">31</span>
  408. <span class="normal">32</span>
  409. <span class="normal">33</span>
  410. <span class="normal">34</span>
  411. <span class="normal">35</span>
  412. <span class="normal">36</span>
  413. <span class="normal">37</span>
  414. <span class="normal">38</span>
  415. <span class="normal">39</span>
  416. <span class="normal">40</span>
  417. <span class="normal">41</span>
  418. <span class="normal">42</span>
  419. <span class="normal">43</span>
  420. <span class="normal">44</span>
  421. <span class="normal">45</span>
  422. <span class="normal">46</span>
  423. <span class="normal">47</span>
  424. <span class="normal">48</span>
  425. <span class="normal">49</span>
  426. <span class="normal">50</span>
  427. <span class="normal">51</span>
  428. <span class="normal">52</span>
  429. <span class="normal">53</span>
  430. <span class="normal">54</span>
  431. <span class="normal">55</span>
  432. <span class="normal">56</span>
  433. <span class="normal">57</span>
  434. <span class="normal">58</span>
  435. <span class="normal">59</span>
  436. <span class="normal">60</span>
  437. <span class="normal">61</span>
  438. <span class="normal">62</span>
  439. <span class="normal">63</span>
  440. <span class="normal">64</span>
  441. <span class="normal">65</span>
  442. <span class="normal">66</span>
  443. <span class="normal">67</span>
  444. <span class="normal">68</span>
  445. <span class="normal">69</span>
  446. <span class="normal">70</span>
  447. <span class="normal">71</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="x"> /* Lotter Smart Contract in DVM-BASIC</span>
  448. <span class="x">This lottery smart contract will give lottery wins every xth try.</span>
  449. <span class="x"> */</span>
  450. <span class="x"> Function Lottery(value Uint64) Uint64</span>
  451. <span class="x"> 10 dim deposit_count,winner as Uint64</span>
  452. <span class="x"> 20 LET deposit_count = LOAD(&quot;deposit_count&quot;)+1</span>
  453. <span class="x"> 25 IF value == 0 THEN GOTO 110 // if deposit amount is 0, simply return</span>
  454. <span class="x"> 30 STORE(&quot;depositor_address&quot; + (deposit_count-1), SIGNER()) // store address for later on payment</span>
  455. <span class="x"> 40 STORE(&quot;deposit_total&quot;, LOAD(&quot;deposit_total&quot;) + value )</span>
  456. <span class="x"> 50 STORE(&quot;deposit_count&quot;,deposit_count)</span>
  457. <span class="x"> 60 IF LOAD(&quot;lotteryeveryXdeposit&quot;) &gt; deposit_count THEN GOTO 110 // we will wait till X players join in</span>
  458. <span class="x"> // we are here means all players have joined in, roll the DICE,</span>
  459. <span class="x"> 70 LET winner = RANDOM() % deposit_count // we have a winner</span>
  460. <span class="x"> 80 SEND_DERO_TO_ADDRESS(LOAD(&quot;depositor_address&quot; + winner) , LOAD(&quot;lotterygiveback&quot;)*LOAD(&quot;deposit_total&quot;)/10000)</span>
  461. <span class="x"> // re initialize for another round</span>
  462. <span class="x"> 90 STORE(&quot;deposit_count&quot;, 0) // initial players</span>
  463. <span class="x"> 100 STORE(&quot;deposit_total&quot;, 0) // total deposit of all players</span>
  464. <span class="x"> 110 RETURN 0</span>
  465. <span class="x"> End Function</span>
  466. <span class="x"> // this function is used to initialize parameters during install time</span>
  467. <span class="x"> Function Initialize() Uint64</span>
  468. <span class="x"> 10 STORE(&quot;owner&quot;, SIGNER()) // store in DB [&quot;owner&quot;] = address</span>
  469. <span class="x"> 20 STORE(&quot;lotteryeveryXdeposit&quot;, 2) // lottery will reward every X deposits</span>
  470. <span class="x"> // how much will lottery giveback in 1/10000 parts, granularity .01 %</span>
  471. <span class="x"> 30 STORE(&quot;lotterygiveback&quot;, 9900) // lottery will give reward 99% of deposits, 1 % is accumulated for owner to withdraw</span>
  472. <span class="x"> 33 STORE(&quot;deposit_count&quot;, 0) // initial players</span>
  473. <span class="x"> 34 STORE(&quot;deposit_total&quot;, 0) // total deposit of all players</span>
  474. <span class="x"> 35 printf &quot;Initialize executed&quot;</span>
  475. <span class="x"> 40 RETURN 0</span>
  476. <span class="x"> End Function</span>
  477. <span class="x"> // used to tune lottery parameters</span>
  478. <span class="x"> Function TuneLotteryParameters(input Uint64, lotteryeveryXdeposit Uint64, lotterygiveback Uint64) Uint64</span>
  479. <span class="x"> 10 dim key,stored_owner as String</span>
  480. <span class="x"> 20 dim value_uint64 as Uint64</span>
  481. <span class="x"> 30 IF ADDRESS_RAW(LOAD(&quot;owner&quot;)) == ADDRESS_RAW(SIGNER()) THEN GOTO 100 // check whether owner is real owner</span>
  482. <span class="x"> 40 RETURN 1</span>
  483. <span class="x"> 100 STORE(&quot;lotteryeveryXdeposit&quot;, lotteryeveryXdeposit) // lottery will reward every X deposits</span>
  484. <span class="x"> 130 STORE(&quot;lotterygiveback&quot;, value_uint64) // how much will lottery giveback in 1/10000 parts, granularity .01 %</span>
  485. <span class="x"> 140 RETURN 0 // return success</span>
  486. <span class="x"> End Function</span>
  487. <span class="x"> // this function is used to change owner</span>
  488. <span class="x"> // owner is an string form of address</span>
  489. <span class="x"> Function TransferOwnership(newowner String) Uint64</span>
  490. <span class="x"> 10 IF ADDRESS_RAW(LOAD(&quot;owner&quot;)) == ADDRESS_RAW(SIGNER()) THEN GOTO 30</span>
  491. <span class="x"> 20 RETURN 1</span>
  492. <span class="x"> 30 STORE(&quot;tmpowner&quot;,newowner)</span>
  493. <span class="x"> 40 RETURN 0</span>
  494. <span class="x"> End Function</span>
  495. <span class="x"> // until the new owner claims ownership, existing owner remains owner</span>
  496. <span class="x"> Function ClaimOwnership() Uint64</span>
  497. <span class="x"> 10 IF ADDRESS_RAW(LOAD(&quot;tmpowner&quot;)) == ADDRESS_RAW(SIGNER()) THEN GOTO 30</span>
  498. <span class="x"> 20 RETURN 1</span>
  499. <span class="x"> 30 STORE(&quot;owner&quot;,SIGNER()) // ownership claim successful</span>
  500. <span class="x"> 40 RETURN 0</span>
  501. <span class="x"> End Function</span>
  502. <span class="x"> // if signer is owner, withdraw any requested funds</span>
  503. <span class="x"> // if everthing is okay, thety will be showing in signers wallet</span>
  504. <span class="x"> Function Withdraw( amount Uint64) Uint64</span>
  505. <span class="x"> 10 IF ADDRESS_RAW(LOAD(&quot;owner&quot;)) == ADDRESS_RAW(SIGNER()) THEN GOTO 30</span>
  506. <span class="x"> 20 RETURN 1</span>
  507. <span class="x"> 30 SEND_DERO_TO_ADDRESS(SIGNER(),amount)</span>
  508. <span class="x"> 40 RETURN 0</span>
  509. <span class="x"> End Function</span>
  510. </pre></div>
  511. </td></tr></table></div>
  512. </div>
  513. <div class="section" id="lotter-sc-guide">
  514. <h2>Lotter SC Guide<a class="headerlink" href="#lotter-sc-guide" title="Permalink to this headline">¶</a></h2>
  515. <p><strong>Dero Stargate DVM Smart Contracts guide to install and test various function of lottery Smart Contract.</strong></p>
  516. <p><strong>Download</strong> Dero Stargate testnet <a class="reference external" href="https://git.dero.io/DeroProject/derosuite_stargate">source</a> and <a class="reference external" href="https://git.dero.io/DeroProject/Dero_Stargate_testnet_binaries">binaries.</a></p>
  517. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">./derod-linux-amd64 --testnet;</span>
  518. </pre></div>
  519. </div>
  520. <p><strong>Start DERO wallet in testnet.</strong></p>
  521. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">dero-wallet-cli-linux-amd64 --rpc-server --wallet-file testnet.wallet --testnet;</span>
  522. </pre></div>
  523. </div>
  524. <p><strong>Start Dero wallet second instance to test transfer/ownership functions etc.</strong></p>
  525. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">dero-wallet-cli-linux-amd64 --wallet-file testnet2.wallet --testnet --rpc-server --rpc-bind=127.0.0.1:30308;</span>
  526. </pre></div>
  527. </div>
  528. <p><strong>Dero testnet Explorer</strong></p>
  529. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">./explorer-linux-amd64 --rpc-server-address 127.0.0.1:30306 --http-address=0.0.0.0:8080;</span>
  530. </pre></div>
  531. </div>
  532. <p><strong>DERO Stargate Testnet Explorer</strong></p>
  533. <p><a class="reference external" href="https://testnetexplorer.dero.io/">https://testnetexplorer.dero.io/</a></p>
  534. <p><strong>Installing Smart Contract</strong></p>
  535. <p><a class="reference external" href="https://git.dero.io/DeroProject/derosuite_stargate/src/master/cmd/dvm/lottery.bas">Download Lottery.bas</a></p>
  536. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">curl --request POST --data-binary @lottery.bas http://127.0.0.1:30309/install_sc;</span>
  537. </pre></div>
  538. </div>
  539. <p><strong>Examples of various lottery Smart Contract functions Eg: To play lottery</strong></p>
  540. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">curl -X POST http://127.0.0.1:30309/json_rpc -H &#39;Content-Type: application/json&#39; -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;0&quot;,&quot;method&quot;:&quot;transfer_split&quot;,&quot;params&quot;:{&quot;mixin&quot;:5,&quot;get_tx_key&quot;: true , &quot;sc_tx&quot;:{&quot;entrypoint&quot;:&quot;Lottery&quot;,&quot;scid&quot;:&quot;ab82caa18753efa0f76e7266af7fdd7f11e0ada5e135bd63f1cd823f5e2c2fdc&quot; , &quot;value&quot;:4000000000000 } }}&#39;;</span>
  541. </pre></div>
  542. </div>
  543. <p><strong>Eg: Withdraw balance</strong></p>
  544. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">curl -X POST http://127.0.0.1:30309/json_rpc -H &#39;Content-Type: application/json&#39; -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;0&quot;,&quot;method&quot;:&quot;transfer_split&quot;,&quot;params&quot;:{&quot;mixin&quot;:5,&quot;get_tx_key&quot;: true , &quot;sc_tx&quot;:{&quot;entrypoint&quot;:&quot;Withdraw&quot;,&quot;scid&quot;:&quot;55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0&quot;, &quot;params&quot;:{ &quot;amount&quot;:&quot;1&quot; } } }}&#39;;</span>
  545. </pre></div>
  546. </div>
  547. <p><strong>Eg: To transfer ownership</strong></p>
  548. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">curl -X POST http://127.0.0.1:30309/json_rpc -H &#39;Content-Type: application/json&#39; -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;0&quot;,&quot;method&quot;:&quot;transfer_split&quot;,&quot;params&quot;:{&quot;mixin&quot;:5,&quot;get_tx_key&quot;: true , &quot;sc_tx&quot;:{&quot;entrypoint&quot;:&quot;TransferOwnership&quot;,&quot;scid&quot;:&quot;55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0&quot;, &quot;params&quot;:{ &quot;newowner&quot;:&quot;dETohFmTunwF58wAs5Jn3d1N1oaJqwRxvarNJudUh95nVbZyigTja1W8Ljzp3j8VhxbB9gv3TBs4W5gnFa24cehz2cM6nUg84s&quot; } } }}&#39;;</span>
  549. </pre></div>
  550. </div>
  551. <p><strong>Eg: To claim ownership</strong></p>
  552. <div class="highlight-php notranslate"><div class="highlight"><pre><span></span><span class="x">curl -X POST http://127.0.0.1:30308/json_rpc -H &#39;Content-Type: application/json&#39; -d &#39;{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;id&quot;:&quot;0&quot;,&quot;method&quot;:&quot;transfer_split&quot;,&quot;params&quot;:{&quot;mixin&quot;:;</span>
  553. </pre></div>
  554. </div>
  555. </div>
  556. <div class="section" id="return-statement">
  557. <h2>Return Statement<a class="headerlink" href="#return-statement" title="Permalink to this headline">¶</a></h2>
  558. <p>It is used to return from a function and can be used anywhere within a function</p>
  559. <p>syntax</p>
  560. <ol class="arabic simple">
  561. <li><p>RETURN ( return nil )</p></li>
  562. <li><p>RETURN expression ( evaluates expression and returns value )</p></li>
  563. </ol>
  564. <p>any return value must match with the type defined while declaring function</p>
  565. </div>
  566. <div class="section" id="support-functions">
  567. <h2>Support Functions<a class="headerlink" href="#support-functions" title="Permalink to this headline">¶</a></h2>
  568. <div class="highlight-php notranslate"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
  569. <span class="normal"> 2</span>
  570. <span class="normal"> 3</span>
  571. <span class="normal"> 4</span>
  572. <span class="normal"> 5</span>
  573. <span class="normal"> 6</span>
  574. <span class="normal"> 7</span>
  575. <span class="normal"> 8</span>
  576. <span class="normal"> 9</span>
  577. <span class="normal">10</span>
  578. <span class="normal">11</span>
  579. <span class="normal">12</span>
  580. <span class="normal">13</span>
  581. <span class="normal">14</span>
  582. <span class="normal">15</span>
  583. <span class="normal">16</span>
  584. <span class="normal">17</span>
  585. <span class="normal">18</span>
  586. <span class="normal">19</span>
  587. <span class="normal">20</span>
  588. <span class="normal">21</span>
  589. <span class="normal">22</span>
  590. <span class="normal">23</span>
  591. <span class="normal">24</span>
  592. <span class="normal">25</span>
  593. <span class="normal">26</span>
  594. <span class="normal">27</span>
  595. <span class="normal">28</span>
  596. <span class="normal">29</span>
  597. <span class="normal">30</span>
  598. <span class="normal">31</span>
  599. <span class="normal">32</span>
  600. <span class="normal">33</span>
  601. <span class="normal">34</span>
  602. <span class="normal">35</span>
  603. <span class="normal">36</span>
  604. <span class="normal">37</span>
  605. <span class="normal">38</span>
  606. <span class="normal">39</span>
  607. <span class="normal">40</span>
  608. <span class="normal">41</span>
  609. <span class="normal">42</span>
  610. <span class="normal">43</span>
  611. <span class="normal">44</span>
  612. <span class="normal">45</span>
  613. <span class="normal">46</span>
  614. <span class="normal">47</span>
  615. <span class="normal">48</span>
  616. <span class="normal">49</span>
  617. <span class="normal">50</span>
  618. <span class="normal">51</span>
  619. <span class="normal">52</span>
  620. <span class="normal">53</span>
  621. <span class="normal">54</span>
  622. <span class="normal">55</span>
  623. <span class="normal">56</span>
  624. <span class="normal">57</span>
  625. <span class="normal">58</span>
  626. <span class="normal">59</span>
  627. <span class="normal">60</span></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span class="x"> Support Functions are inbuilt functions which provide some functionality or expose internals for speed and technical reasons.</span>
  628. <span class="x"> LOAD(variable)</span>
  629. <span class="x"> ==============</span>
  630. <span class="x"> LOAD loads a variable which was previously stored in the blockchain using STORE function. Return type will be Uint64/String depending on what is stored.</span>
  631. <span class="x"> It will panic if the value does NOT exists</span>
  632. <span class="x"> Uint64 EXISTS(variable)</span>
  633. <span class="x"> =======================</span>
  634. <span class="x"> EXISTS return 1 if the variable is store in DB and 0 otherwise</span>
  635. <span class="x"> STORE(key variable, value variable)</span>
  636. <span class="x"> ===================================</span>
  637. <span class="x"> STORE stores key and value in the DB. All storage state of the SC is accessible only from the SC which created it.</span>
  638. <span class="x"> Uint64 RANDOM()</span>
  639. <span class="x"> Uint64 RANDOM(limit Uin64)</span>
  640. <span class="x"> ============================</span>
  641. <span class="x"> RANDOM returns a random using a PRNG seeded on BLID,SCID,TXID. First form gives a uint64, second form returns</span>
  642. <span class="x"> random number in the range 0 - (limit), 0 is inclusive, limit is exclusive</span>
  643. <span class="x"> String SCID()</span>
  644. <span class="x"> ==============</span>
  645. <span class="x"> Returns SMART CONTRACT ID which is currently running</span>
  646. <span class="x"> String BLID()</span>
  647. <span class="x"> ==============</span>
  648. <span class="x"> Returns current BLOCK ID which contains current execution-in-progress TXID</span>
  649. <span class="x"> String TXID()</span>
  650. <span class="x"> =============</span>
  651. <span class="x"> Returns current TXID which is execution-in-progress.</span>
  652. <span class="x"> Uint64 BLOCK_HEIGHT()</span>
  653. <span class="x"> =====================</span>
  654. <span class="x"> Returns current chain height of BLID()</span>
  655. <span class="x"> Uint64 BLOCK_TOPOHEIGHT()</span>
  656. <span class="x"> ===========================</span>
  657. <span class="x"> Returns current topoheight of BLID()</span>
  658. <span class="x"> String SIGNER()</span>
  659. <span class="x"> =================</span>
  660. <span class="x"> Returns address of who signed this transaction</span>
  661. <span class="x"> Uint64 IS_ADDRESS_VALID(p String)</span>
  662. <span class="x"> =================================</span>
  663. <span class="x"> Returns 1 is address is valid, 0 otherwise</span>
  664. <span class="x"> String ADDRESS_RAW(p String)</span>
  665. <span class="x"> ============================</span>
  666. <span class="x"> Returns address in RAW form as 64 byte keys, stripping away textual/presentation form. 2 address should always be compared in RAW form</span>
  667. <span class="x"> SEND_DERO_TO_ADDRESS(a String, amount Uint64)</span>
  668. <span class="x"> ==============================================</span>
  669. <span class="x"> Sends amount DERO from SC DERO balance to a address. address must in string form DERO/DETO form</span>
  670. <span class="x"> If the SC does not have enough balance, it will panic</span>
  671. </pre></div>
  672. </td></tr></table></div>
  673. </div>
  674. </div>
  675. </div>
  676. </div>
  677. <footer>
  678. <hr/>
  679. <div role="contentinfo">
  680. <p>
  681. &#169; Copyright 2020, DERO Foundation.
  682. </p>
  683. </div>
  684. Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
  685. <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
  686. provided by <a href="https://readthedocs.org">Read the Docs</a>.
  687. </footer>
  688. </div>
  689. </div>
  690. </section>
  691. </div>
  692. <script type="text/javascript">
  693. jQuery(function () {
  694. SphinxRtdTheme.Navigation.enable(true);
  695. });
  696. </script>
  697. </body>
  698. </html>