├── C16-FCCM2019-BWT.pdf ├── CryptoNote-WP.pdf ├── DEROSWAP.txt ├── DHEBP.md ├── DVMDOCS ├── README.md ├── examples │ ├── assetexchange │ │ ├── Readme.md │ │ ├── asset.bas │ │ ├── asset_exchange.bas │ │ └── example.sh │ ├── lottery │ │ ├── example.sh │ │ ├── lottery.bas │ │ └── lottery_sc_guide.md │ ├── nameservice │ │ ├── Readme.md │ │ ├── example.sh │ │ └── nameservice.bas │ └── token │ │ ├── example.sh │ │ ├── token.bas │ │ └── token_sc_guide.md ├── statementsDVM.md └── support_functions.md ├── Dero Security Audit Report-May2019.pdf ├── Dero_RPC_API.pdf ├── Dero_Whitepaper.pdf ├── LICENSE ├── README.md ├── SecondGPGkeyMsg.asc ├── WhitePaper.md ├── captainKEY2.asc ├── images ├── Dag1.jpeg ├── Readme.md ├── dagx1.png ├── dagx2.png ├── dagx3.png ├── dagx4.png ├── dagx5.png ├── dero_explorer.png ├── dero_wallet_offline.png ├── derod-linux.png ├── derod.png ├── derod1.png ├── explorer-prove-tx.png ├── remote-node2.png ├── status-release-1.png ├── wallet-recover2.png └── wallet1.jpeg ├── premine.md ├── premine_DEC-2019.png ├── proposals ├── RFP-2.md └── Readme.md └── testnet ├── AstroBWT.md ├── CNminers_hashes.md ├── DeroKnight.md ├── Readme.md └── stargate.md /C16-FCCM2019-BWT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/C16-FCCM2019-BWT.pdf -------------------------------------------------------------------------------- /CryptoNote-WP.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/CryptoNote-WP.pdf -------------------------------------------------------------------------------- /DEROSWAP.txt: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA512 3 | 4 | 5 | 6 | DERO Stargate launch date: 26 FEB 2022. 7 | https://github.com/deroproject/derohe 8 | 9 | Please use following addresses only for DERO SWAP from DERO-ATLANTIS(CryptoNote) to new DERO-STARGATE(Homomorphic Encryption): 10 | 11 | Exchanges have one month period to swap from day of announcement and rest all other users can swap for next few months. 12 | 13 | Step 1] Please use any one of the following addresses only to deposit your existing DERO(Atalntis): 14 | 15 | Deposit Address1 for normal users swaps: 16 | dERoVUQjwDdEsFGwF4YdYAhmgv1nNXRkgZkbtTeitsgxNrKw6tbUF3pAPRuNw4AMCcTKXow2HmAfM4Km3Qo7R9jJ7SA3W7eDK3 17 | 18 | 19 | Deposit Address2 for normal users swaps: 20 | dERogEEMBgsS5Yp5M6TUT52SKbY7wQHyVQKXbjjsDAh9e8Bw5NRP52sYzzoCS4ULepFUixddZMVau7ZMoSMWByy53byFMFzTeG 21 | 22 | 23 | Deposit Address for Kucoin Exchange swaps: 24 | dERoTkCdC3y5eXvHuiu9HYetJBm7gvPyebU4AnWGcGmsKNxK7YuPuish61e6XKWWQmc2Tgx6cv4FbTgmo5nPNXLg9giKB39Lyu 25 | 26 | 27 | Deposit Address for Tradeogre Exchange swaps: 28 | dERoqz3Tu64AWVx7ianrZz59bcvabYK9XgyG4YvDJdjWNQ9ur9wt6LAYKv71PxEGHA8JCX8xdaQd3MyrKZtgFUseAAZ4xafZhW 29 | 30 | 31 | Deposit Address for any other exchanges: 32 | dERoX6JxfD2Y42sd3b6C93BFwBLNrXh5663dZsRCvTjK72VGUNUwPRZXbtqYCYQiqFGyGpW1fmEJGEsA7d6ApG5v24G5z5EXVJ 33 | 34 | 35 | 36 | Step 2] 37 | After deposit send transactionID obtained above in format "TXID:amountSent" to following DERO stargate address, 38 | dero1qy867gnj0snrcrtwxgqchmn84t8d4cnzcnhdd4xh6qnhx70j4uhf5qgrmcvgg 39 | 40 | Use comment section of Stargate wallet in option 5 to enter "TXID:amountSent". 41 | set ringsize 2 in wallet before sending TX. 42 | Choose transfer amount to be 0.00001. All Stargate wallets will have 0.00200 DERO to cover transaction fees for swap for one month. 43 | 44 | 45 | Step 3] 46 | Keep your above deposit transaction-ID,seeds etc. safe and secure till you receive your Stargate DEROs. 47 | Swap will began after 1 week of Stargate launch. 48 | 49 | 50 | For detailed guide with images of above swap process please visit: https://docs.dero.io/rtd_pages/basic_cntohe.html 51 | 52 | 53 | No rush or panic. Swap will last for several months. Keep you TXID,amount details and seeds of both Atlantis & Stargate safe. 54 | 55 | https://dero.io 56 | 57 | 58 | -----BEGIN PGP SIGNATURE----- 59 | 60 | iQIzBAEBCgAdFiEE3tH+9EKXoVytmuKDGM2z7V6F0tQFAmIcqwMACgkQGM2z7V6F 61 | 0tR7+A//alfsnIxb9Mm8B1lxCjFJbDrShHOXH0LLnqd2cfGF6YgTED0dlFYRaaDw 62 | Lcgo1FoP8awLfrphavlrEFC2NnbfswlcD+b4NrZ9byPb3oeLUcl9W4KAsgs23m31 63 | jayDwTBBncKbfx0R6aAgfSKuOBsh43QOTY3WgUW889HTTlAXLefgvt35goZ7I8qh 64 | CmHe8ubUuo37fcEdun6vRZnS1NwnP+EgaKeweP3oP9hJNI5B5QziAJnLliYDFzB0 65 | n8HAfP3Y0vyYYaOAGTJJ8hxdjiALFh/KGCNsPuro/aRzMeHv8y32aia8ZZGv5Evu 66 | tC6cSaSSJKWAt/4N6V2DfhD4pe0D8CPqJS5/jl7hNN8ybj2irQsUXRb+/XMz1i2R 67 | LlvMMyAiZXnWkZ/M+xFyKJ8PMDGVxs051qIs2gQ8Ccw3mcI7FwGyiEEpefy6SnWT 68 | E6wl2pIFkVRM5M4k4VEOL9Joph89pmxerpcLLR1bbzXINJyrdANBxpiDvfqZ+9er 69 | fLq9hA4rbsx0bgsBVRUokKasUqaaGvPiNZ0S0EwxQucTHTjWxuqhW0iMatKGTg0z 70 | 6v3bkdEiXy3CwZP0pX/zNQl/wA+KIeUkXdOMY+ta2CkqsIkvZDWgFYxvwvVl3lCL 71 | L1n3Ddf9+Qu7wELMH0LYU1wAuBLP9eFTZ7NOCuUHWOiiUTHK1cY= 72 | =PuGp 73 | -----END PGP SIGNATURE----- 74 | -------------------------------------------------------------------------------- /DHEBP.md: -------------------------------------------------------------------------------- 1 | ### DERO Homomorphic Encryption Blockchain Protocol(DHEBP). 2 | 3 | **DHEBP Features List:** 4 | * Only one block is required for final confirmation of balance. Can spend balance immediately in next block. 5 | 6 | 7 | **Note:** May change in future. 8 | -------------------------------------------------------------------------------- /DVMDOCS/README.md: -------------------------------------------------------------------------------- 1 | ### DERO Virtual Machine (DVM) 2 | 3 | DERO Virtual Machine represents entire DERO Smart Contracts eco-system which runs on the DERO block chain. 4 | 5 | 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. 6 | 7 | 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. 8 | 9 | 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. 10 | 11 | * 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. 12 | 13 | 14 | * 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. 15 | 16 | * DVM runs Smart Contracts which are a collection of functions written in DVM-BASIC. 17 | These functions can be invoked over the blockchain to do something. SCs can act as libraries for other SCs. 18 | 19 | 20 | * DVM supports number of comments formats such as ', // , /* */ as good documentation is necessary. 21 | 22 | #### DVM Example Factorial program 23 | 24 | ``` 25 | ' This is a comment 26 | // This comment is supported 27 | /* this is multi-line comment */ 28 | Function Factorial(s Uint64) Uint64 // this is a commment 29 | 10 DIM result,scopy as Uint64 /* this is also comment */ 30 | 15 LET scopy = s 31 | 20 LET result = 1 32 | 30 LET result = result * s 33 | 40 LET s = s - 1 34 | 50 IF s >= 2 THEN GOTO 30 35 | 70 RETURN result 36 | End Function 37 | ``` 38 | 39 | * DVM smart contracts are written in a DVM-BASIC custom BASIC style language with line numbers. 40 | * DVM supports uint64 and string data-types. 41 | * DVM interprets the smart-contract and processes the SC line-line 42 | 43 | * uint64 supports almost all operators namely +,-,*,/,% 44 | * uint64 support following bitwise operators & ,|, ^, ! , >> , << 45 | * uint64 supports following logical operators >, >= , <, <=, == , != 46 | * string supports only + operator. string support concatenation with a uint64. 47 | * string supports ==, != logical operators. 48 | * All DVM variables are mandatory to define and are initialized to default values namely 0 and "". 49 | 50 | #### Smart Contract execution must return 0 to persist any changes made during execution. During execution, no panics should occur. 51 | 52 | ### DERO Smart Contract Examples 53 | First Smart Contract: [Launching your token/asset on DERO blockchain.](https://github.com/deroproject/documentation/blob/master/DVMDOCS/examples/token/token_sc_guide.md) 54 | Second Smart Contract: [Launching your exchange for interchanging tokens/assets.](https://github.com/deroproject/documentation/tree/master/DVMDOCS/examples/assetexchange) 55 | [DERO Smart Contract Examples](https://github.com/deroproject/documentation/tree/master/DVMDOCS/examples) 56 | [More Examples](https://forum.dero.io/t/darch-decentralized-architecture-competition-series/1318) 57 | 58 | ### DERO Default Ports: 59 | ``` 60 | Mainnet: 61 | Mining Getwork Port: 10100 TCP 62 | P2P Default Port: 10101 UDP 63 | RPC Default Port: 10102 TCP 64 | Wallet RPC Default Port: 10103 TCP 65 | 66 | Testnet: 67 | P2P Default Port: 40401 68 | RPC Default Port: 40402 69 | Wallet RPC Default Port: 40403 70 | ``` 71 | **NB:**: Change ports to mainnet or testnet based on your requirements. 72 | -------------------------------------------------------------------------------- /DVMDOCS/examples/assetexchange/Readme.md: -------------------------------------------------------------------------------- 1 | ### ASSETS Interchange Smart Contract 2 | 3 | This Smart Contract converts assetOne to assetTwo as per defined ratio in contract. Provided exchange has sufficient assets balances. 4 | 5 | #### Steps to create an exchange contract. 6 | First create two tokens and deposit it to exchange. Then anyone can use exchange smart contract for conversion of assets. 7 | 8 | 9 | Step 1] [Create & install an asset/token](https://github.com/deroproject/documentation/tree/master/DVMDOCS/examples/token). 10 | ``` curl --request POST --data-binary @token.bas http://127.0.0.1:40403/install_sc ``` 11 | 12 | Step 2] [Create & install second asset/token](https://github.com/deroproject/documentation/tree/master/DVMDOCS/examples/token). 13 | ``` curl --request POST --data-binary @token2.bas http://127.0.0.1:40403/install_sc ``` 14 | 15 | STEP 3] Create and install [example asset_exchange contract](./asset_exchange.bas). 16 | ``` curl --request POST --data-binary @asset_exchange.bas http://127.0.0.1:40403/install_sc ``` 17 | 18 | Step 4] Deposit assetOne/token1 to exchange contract. 19 | ``` curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"scid":"'"Interchange-SCID"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Deposit"}], "transfers": [ {"scid":"'"ASSET_ONE_SCID"'", "burn":AssetOneCount_DEPOSITED_TO_EXCHANGE}] }}' -H 'Content-Type: application/json' ``` 20 | 21 | Step 5] Deposit assetTwo/token2 to exchange contract. 22 | ``` curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"scid":"'"Interchange-SCID"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Deposit"}], "transfers": [ {"scid":"'"ASSET_TWO_SCID"'", "burn":AssetTwoCount_DEPOSITED_TO_EXCHANGE}] }}' -H 'Content-Type: application/json' ``` 23 | 24 | Step 6] From any wallet send assetOne to exchange SCID. 25 | ``` curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"scid":"'"Interchange-SCID"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Interchange"},{"name":"incoming","datatype":"H","value":"'"ASSET_ONE_SCID"'"},{"name":"outgoing","datatype":"H","value":"'"ASSET_TWO_SCID"'"}], "transfers": [{"scid":"'"ASSET_ONE_SCID"'", "burn":AssetOneCount_TO_BE__Converted}] }}' -H 'Content-Type: application/json' ``` 26 | 27 | step 7] In wallet check balance of assetTwo. 28 | ``` balance ASSET_TWO_SCID ``` 29 | 30 | #### NB: Following used above are variables, please change them. SCIDs are transaction-IDs returned by respective commands. 31 | Interchange-SCID 32 | ASSET_ONE_SCID 33 | ASSET_TWO_SCID 34 | AssetOneCount_DEPOSITED_TO_EXCHANGE 35 | AssetTwoCount_DEPOSITED_TO_EXCHANGE 36 | AssetOneCount_TO_BE__Converted 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /DVMDOCS/examples/assetexchange/asset.bas: -------------------------------------------------------------------------------- 1 | /* Private Token Smart Contract Example in DVM-BASIC. 2 | DERO Smart Contracts Tokens privacy can be understood just like banks handle cash. Once cash is out from the bank, bank is not aware about it (who owns what value), until it is deposited back. 3 | Smart contract only maintains supply and other necessary items to keep it working. 4 | DERO Tokens can be tranfered to other wallets just like native DERO with Homomorphic Encryption and without involvement of issuing Smart Contracts. 5 | Token issuing Smart Contract cannot hold/freeze/control their tokens once they are issued and sent to any wallet. 6 | This token is Private. Use Function InitializePrivate() Uint64 to make any Smart Contract private. 7 | 8 | */ 9 | 10 | 11 | // Issue Asset after depositing DERO (Convert DERO to TOKENX) 12 | Function IssueAsset() Uint64 13 | 10 SEND_ASSET_TO_ADDRESS(SIGNER(), DEROVALUE(),SCID()) // send asset without knowing original balance, this is done homomorphically 14 | 20 RETURN 0 15 | End Function 16 | 17 | 18 | // This function is used to initialize parameters during install time 19 | // InitializePrivate initializes a private SC 20 | // Smart contract authors should hardcode their intended address for contract ownership, then add a check within the Initialize() or InitializePrivate() functions to ensure that the caller is the true owner. 21 | Function InitializePrivate() Uint64 22 | 10 IF SIGNER() == address_raw("dero1qywqad0njut7h4h0h0933dfspsdeyfphzzcs5ujw03ghqzhhw8c9zqqevltfj") THEN GOTO 40 //Exit unless smart contract owner. 23 | 20 RETURN 0 // exit 24 | 40 RETURN 0 25 | End Function 26 | 27 | 28 | -------------------------------------------------------------------------------- /DVMDOCS/examples/assetexchange/asset_exchange.bas: -------------------------------------------------------------------------------- 1 | // Asset Interchange/Exchnage Smart Contract Example in DVM-BASIC. 2 | // This SC allows you to deposit an arbitrary token, into it 3 | // and later allows you to swap one token with another 4 | // if the SC has enough balance to cover outgoing transfer it will be done 5 | 6 | 7 | // deposits an arbitrary token 8 | // owner should deposits all arbitrary types 9 | 10 | Function Deposit() Uint64 11 | 20 RETURN 0 12 | End Function 13 | 14 | // incoming represents incoming asset type basicallly an SCID 15 | // outgoing represents outgoing asset type basicallly an SCID 16 | Function Interchange(incoming String, outgoing String) Uint64 17 | 10 SEND_ASSET_TO_ADDRESS(SIGNER(),ASSETVALUE(incoming)/2, outgoing) // 1:1/2 interchange of assets 18 | 20 RETURN 0 19 | End Function 20 | 21 | 22 | Function Initialize() Uint64 23 | 10 STORE("owner", SIGNER()) // store in DB ["owner"] = address 24 | 40 RETURN 0 25 | End Function 26 | 27 | 28 | // everything below this is supplementary and not required 29 | 30 | // This function is used to change owner 31 | // owner is an string form of address 32 | Function TransferOwnership(newowner String) Uint64 33 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 34 | 20 RETURN 1 35 | 30 STORE("tmpowner",ADDRESS_RAW(newowner)) 36 | 40 RETURN 0 37 | End Function 38 | 39 | // Until the new owner claims ownership, existing owner remains owner 40 | Function ClaimOwnership() Uint64 41 | 10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30 42 | 20 RETURN 1 43 | 30 STORE("owner",SIGNER()) // ownership claim successful 44 | 40 RETURN 0 45 | End Function 46 | 47 | // if signer is owner, withdraw any requested funds 48 | // if everthing is okay, they will be showing in signers wallet 49 | Function Withdraw(amount Uint64, asset String) Uint64 50 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 51 | 20 RETURN 1 52 | 30 SEND_ASSET_TO_ADDRESS(SIGNER(),amount,asset) 53 | 40 RETURN 0 54 | End Function 55 | 56 | // if signer is owner, provide him rights to update code anytime 57 | // make sure update is always available to SC 58 | Function UpdateCode( code String) Uint64 59 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 60 | 20 RETURN 1 61 | 30 UPDATE_SC_CODE(code) 62 | 40 RETURN 0 63 | End Function 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /DVMDOCS/examples/assetexchange/example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # set -x # to enable debug and verbose printing of each and every command 4 | 5 | CURDIR=`/bin/pwd` 6 | BASEDIR=$(dirname $0) 7 | ABSPATH=$(readlink -f $0) 8 | ABSDIR=$(dirname $ABSPATH) 9 | 10 | 11 | command -v curl >/dev/null 2>&1 || { echo "I require curl but it's not installed. Aborting." >&2; exit 1; } 12 | command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } 13 | 14 | 15 | daemon_rpc_port="20000" # daemon rpc is listening on this port 16 | 17 | # we have number of wallets listening at ports from 30000 18 | # we will be using 3 wallets, named owner, user1,user2 19 | owner_rpc_port="30000" 20 | user1_rpc_port="30001" 21 | user2_rpc_port="30002" 22 | 23 | owner_address=$(curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 24 | user1_address=$(curl --silent http://127.0.0.1:$user1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 25 | user2_address=$(curl --silent http://127.0.0.1:$user2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 26 | 27 | 28 | function balance(){ 29 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'| jq -r ".result.balance" 30 | } 31 | 32 | function tokenbalance(){ 33 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance" , "params":{ "scid":"'"$2"'" }}' -H 'Content-Type: application/json'| jq -r ".result.balance" 34 | } 35 | 36 | function scbalance(){ 37 | curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$1"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' | jq -r ".result.balance" 38 | } 39 | 40 | echo "SC owner address" $owner_address 41 | echo "user1 address" $user1_address 42 | echo "user2 address" $user2_address 43 | 44 | 45 | # echo -n "wallet1 sending dero to 2 wallets txid " 46 | # curl --silent http://127.0.0.1:$user1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{ "transfers":[{"amount":10000,"destination":"'"$user2_address"'"},{"amount":10000,"destination":"'"$owner_address"'"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 47 | # exit 0 48 | 49 | # use owner wallet to load/install an exchange sc to chain 50 | exchangescid=$(curl --silent --request POST --data-binary @asset_exchange.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 51 | echo "exchange SCID" $exchangescid 52 | sleep 1 53 | 54 | asset1scid=$(curl --silent --request POST --data-binary @asset.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 55 | echo "asset1 SCID" $asset1scid 56 | sleep 1 57 | 58 | 59 | asset2scid=$(curl --silent --request POST --data-binary @asset.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 60 | echo "asset2 SCID" $asset2scid 61 | sleep 1 62 | 63 | 64 | #curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$scid"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' 65 | 66 | echo -n "owner exchanging dero 10000 for asset1 " 67 | curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":10000,"scid":"'"$asset1scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"IssueAsset"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 68 | sleep 2 69 | echo -n "owner exchanging dero 10000 for asset2 " 70 | curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":10000,"scid":"'"$asset2scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"IssueAsset"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 71 | sleep 2 72 | 73 | 74 | echo -n "owner depositing triple assets ( dero, asset1, asset2 ) to exchangescid " 75 | curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"scid":"'"$exchangescid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Deposit"}], "transfers": [{"burn":10000,"destination":"'"$user2_address"'"}, {"scid":"'"$asset1scid"'", "burn":10000}, {"scid":"'"$asset2scid"'", "burn":10000}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 76 | sleep 2 77 | 78 | 79 | 80 | echo -n "user1 exchanging dero 2000 for asset1 " 81 | curl --silent http://127.0.0.1:$user1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":10000,"scid":"'"$asset1scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"IssueAsset"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 82 | sleep 2 83 | echo "wallet1 received asset1 tokens in return" $(tokenbalance $user1_rpc_port $asset1scid) 84 | 85 | 86 | echo -n "user1 depositing 122 asset1 to obtain 61 asset2" 87 | curl --silent http://127.0.0.1:$user1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"scid":"'"$exchangescid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Interchange"},{"name":"incoming","datatype":"H","value":"'"$asset1scid"'"},{"name":"outgoing","datatype":"H","value":"'"$asset2scid"'"}], "transfers": [{"burn":1,"destination":"'"$user2_address"'"}, {"scid":"'"$asset1scid"'", "burn":122}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 88 | #curl --silent http://127.0.0.1:$user1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":10000,"scid":"'"$exchangescid"'","ringsize":2, "sc_rpc":[] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 89 | 90 | 91 | sleep 2 92 | echo "wallet1 asset1 tokens " $(tokenbalance $user1_rpc_port $asset1scid) 93 | echo "wallet1 asset2 tokens after exchange " $(tokenbalance $user1_rpc_port $asset2scid) 94 | 95 | 96 | 97 | exit 0 98 | -------------------------------------------------------------------------------- /DVMDOCS/examples/lottery/example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | #set -x # to enable debug and verbose printing of each and every command 4 | 5 | CURDIR=`/bin/pwd` 6 | BASEDIR=$(dirname $0) 7 | ABSPATH=$(readlink -f $0) 8 | ABSDIR=$(dirname $ABSPATH) 9 | 10 | 11 | command -v curl >/dev/null 2>&1 || { echo "I require curl but it's not installed. Aborting." >&2; exit 1; } 12 | command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } 13 | 14 | 15 | daemon_rpc_port="20000" # daemon rpc is listening on this port 16 | 17 | # we have number of wallets listening at ports from 30000 18 | # we will be using 3 wallets, named owner, player1,player2 19 | owner_rpc_port="30000" 20 | player1_rpc_port="30001" 21 | player2_rpc_port="30002" 22 | 23 | owner_address=$(curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 24 | player1_address=$(curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 25 | player2_address=$(curl --silent http://127.0.0.1:$player2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 26 | 27 | 28 | function balance(){ 29 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'| jq -r ".result.balance" 30 | } 31 | 32 | function scbalance(){ 33 | curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$1"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' | jq -r ".result.balance" 34 | } 35 | 36 | echo "SC owner address" $owner_address 37 | echo "player1 address" $player1_address 38 | echo "player2 address" $player2_address 39 | 40 | 41 | # use owner wallet to load/install an lotter sc to chain 42 | scid=$(curl --silent --request POST --data-binary @lottery.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 43 | 44 | echo "SCID" $scid 45 | 46 | 47 | sleep 1 48 | 49 | 50 | #curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$scid"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' 51 | 52 | echo -n "Player 1 play txid " 53 | curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":3,"scid":"'"$scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Lottery"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 54 | echo -n "Player 2 play txid " 55 | curl --silent http://127.0.0.1:$player2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":300,"scid":"'"$scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Lottery"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 56 | sleep 2 57 | 58 | curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$scid"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' | jq -r ".result.balance" 59 | 60 | 61 | echo "SC balance" $(scbalance $scid) 62 | echo "SC owner balance" $(balance $owner_rpc_port) 63 | echo "SC player1 balance" $(balance $player1_rpc_port) 64 | echo "SC player2 balance" $(balance $player2_rpc_port) -------------------------------------------------------------------------------- /DVMDOCS/examples/lottery/lottery.bas: -------------------------------------------------------------------------------- 1 | /* Lottery Smart Contract Example in DVM-BASIC. 2 | This lottery smart contract will give lottery wins on every second try in following default contract. 3 | Make depost transaction to this SCID to play lottery. 4 | Check https://github.com/deroproject/derohe/blob/main/guide/examples/lottery_sc_guide.md 5 | */ 6 | 7 | 8 | 9 | Function Lottery() Uint64 10 | 10 dim deposit_count,winner as Uint64 11 | 20 LET deposit_count = LOAD("deposit_count")+1 12 | 25 IF DEROVALUE() == 0 THEN GOTO 110 // if deposit amount is 0, simply return 13 | 30 STORE("depositor_address" + (deposit_count-1), SIGNER()) // store address for later on payment 14 | 40 STORE("deposit_total", LOAD("deposit_total") + DEROVALUE() ) 15 | 50 STORE("deposit_count",deposit_count) 16 | 60 IF LOAD("lotteryeveryXdeposit") > deposit_count THEN GOTO 110 // we will wait till X players join in 17 | // we are here means all players have joined in, roll the DICE, 18 | 70 LET winner = RANDOM() % deposit_count // we have a winner 19 | 80 SEND_DERO_TO_ADDRESS(LOAD("depositor_address" + winner) , LOAD("lotterygiveback")*LOAD("deposit_total")/10000) 20 | // Re-Initialize for another round 21 | 90 STORE("deposit_count", 0) // initial players 22 | 100 STORE("deposit_total", 0) // total deposit of all players 23 | 110 RETURN 0 24 | End Function 25 | 26 | 27 | // This function is used to initialize parameters during install time 28 | // Smart contract authors should hardcode their intended address for contract ownership, then add a check within the Initialize() or InitializePrivate() functions to ensure that the caller is the true owner. 29 | Function Initialize() Uint64 30 | 10 IF SIGNER() == address_raw("dero1qywqad0njut7h4h0h0933dfspsdeyfphzzcs5ujw03ghqzhhw8c9zqqevltfj") THEN GOTO 30 //Exit unless smart contract owner. 31 | 20 RETURN 0 // exit 32 | 30 version("1.2.3") 33 | 40 STORE("owner", SIGNER()) // store in DB ["owner"] = address 34 | 50 STORE("lotteryeveryXdeposit", 2) // lottery will reward every X deposits 35 | // How much will lottery giveback in 1/10000 parts, granularity .01 % 36 | 60 STORE("lotterygiveback", 9900) // lottery will give reward 99% of deposits, 1 % is accumulated for owner to withdraw 37 | 70 STORE("deposit_count", 0) // initial players 38 | 80 STORE("deposit_total", 0) // total deposit of all players 39 | 90 RETURN 0 40 | End Function 41 | 42 | 43 | // Function to tune lottery parameters 44 | Function TuneLotteryParameters(input Uint64, lotteryeveryXdeposit Uint64, lotterygiveback Uint64) Uint64 45 | 10 dim key,stored_owner as String 46 | 20 dim value_uint64 as Uint64 47 | 30 IF LOAD("owner") == SIGNER() THEN GOTO 100 // check whether owner is real owner 48 | 40 RETURN 1 49 | 50 | 100 STORE("lotteryeveryXdeposit", lotteryeveryXdeposit) // lottery will reward every X deposits 51 | 130 STORE("lotterygiveback", value_uint64) // how much will lottery giveback in 1/10000 parts, granularity .01 % 52 | 140 RETURN 0 // return success 53 | End Function 54 | 55 | 56 | 57 | // This function is used to change owner 58 | // owner is an string form of address 59 | Function TransferOwnership(newowner String) Uint64 60 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 61 | 20 RETURN 1 62 | 30 STORE("tmpowner",ADDRESS_RAW(newowner)) 63 | 40 RETURN 0 64 | End Function 65 | 66 | // Until the new owner claims ownership, existing owner remains owner 67 | Function ClaimOwnership() Uint64 68 | 10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30 69 | 20 RETURN 1 70 | 30 STORE("owner",SIGNER()) // ownership claim successful 71 | 40 RETURN 0 72 | End Function 73 | 74 | // If signer is owner, withdraw any requested funds 75 | // If everthing is okay, they will be showing in signers wallet 76 | Function Withdraw( amount Uint64) Uint64 77 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 78 | 20 RETURN 1 79 | 30 SEND_DERO_TO_ADDRESS(SIGNER(),amount) 80 | 40 RETURN 0 81 | End Function 82 | 83 | // If signer is owner, provide him rights to update code anytime 84 | // make sure update is always available to SC 85 | Function UpdateCode( code String) Uint64 86 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 87 | 20 RETURN 1 88 | 30 UPDATE_SC_CODE(code) 89 | 40 RETURN 0 90 | End Function 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /DVMDOCS/examples/lottery/lottery_sc_guide.md: -------------------------------------------------------------------------------- 1 | ## Dero Stargate DVM Smart Contracts guide to install and test various function of lottery Smart Contract. 2 | 3 | **Download** Dero Stargate testnet [source](https://github.com/deroproject/derohe) and [binaries](https://github.com/deroproject/derohe/releases). 4 | 5 | **Start Dero daemon in testnet mode.** 6 | ``` 7 | ./derod-linux-amd64 --testnet 8 | ``` 9 | 10 | **Start Dero wallet in testnet.** 11 | ``` 12 | dero-wallet-cli-linux-amd64 --rpc-server --wallet-file testnet.wallet --testnet 13 | ``` 14 | 15 | **Start Dero wallet second instance to test transfer/ownership functions etc.** 16 | ``` 17 | dero-wallet-cli-linux-amd64 --wallet-file testnet2.wallet --testnet --rpc-server --rpc-bind=127.0.0.1:40403 18 | ``` 19 | 20 | **Dero testnet Explorer** 21 | ``` 22 | ./explorer-linux-amd64 --rpc-server-address 127.0.0.1:30306 --http-address=0.0.0.0:8080 23 | ``` 24 | 25 | **Dero Stargate Testnet Explorer** 26 | [https://testnetexplorer.dero.io/ ](https://testnetexplorer.dero.io/) 27 | 28 | 29 | **Installing Smart Contract.** 30 | [Download lottery.bas](https://git.dero.io/DeroProject/derosuite_stargate/src/master/cmd/dvm/lottery.bas) 31 | ``` 32 | curl --request POST --data-binary @lottery.bas http://127.0.0.1:40403/install_sc 33 | ``` 34 | 35 | 36 | **Download SC Code,check balance and variables from SC** 37 | ```curl http://127.0.0.1:40402/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"30b84e9ab5baeee7195e7e1ccb1f533b7402beb2d3cfa97216a6d80c01056f66" , "code":true}}' -H 'Content-Type: application/json' 38 | ``` 39 | ``` 40 | curl http://127.0.0.1:40402/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"30b84e9ab5baeee7195e7e1ccb1f533b7402beb2d3cfa97216a6d80c01056f66" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' 41 | ``` 42 | 43 | 44 | **Examples of various lottery Smart Contract functions** 45 | **Eg: To play lottery** 46 | ``` 47 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":200000,"scid":"30b84e9ab5baeee7195e7e1ccb1f533b7402beb2d3cfa97216a6d80c01056f66","sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Lottery"}] }}' -H 'Content-Type: application/json' 48 | ``` 49 | **Note:** Every second deposit/play will trigger the lottery and one wallet will win the lottery. 50 | 51 | 52 | **Eg: Withdraw balance only for smart contract owner** 53 | ``` 54 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"30b84e9ab5baeee7195e7e1ccb1f533b7402beb2d3cfa97216a6d80c01056f66", "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Withdraw"}, {"name":"amount","datatype":"U","value":100000 }] }}' -H 'Content-Type: application/json' 55 | ``` 56 | 57 | **Eg: To transfer ownership** 58 | ``` 59 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"30b84e9ab5baeee7195e7e1ccb1f533b7402beb2d3cfa97216a6d80c01056f66", "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"TransferOwnership"}, {"name":"newowner","datatype":"S","value":"detoAddressForOwnershipReceiver" }] }}' -H 'Content-Type: application/json' 60 | 61 | ``` 62 | 63 | **Eg: To claim ownership** 64 | ``` 65 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"YourSCID", "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"ClaimOwnership"}] }}' -H 'Content-Type: application/json' 66 | ``` 67 | 68 | 69 | **Eg: To update code** 70 | ``` 71 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"YourSCID", "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"UpdateCode"}, {"name":"code","datatype":"S","value":"new code should be placed here" }] }}' -H 'Content-Type: application/json' 72 | ``` 73 | **NOTE:** Please use this update code command carefully. Try this command several times on testnet before issuing on maiinet to update SC code. 74 | 75 | -------------------------------------------------------------------------------- /DVMDOCS/examples/nameservice/Readme.md: -------------------------------------------------------------------------------- 1 | #### Register and associate DERO wallet to username. 2 | 3 | Make sure wallet is running with ```--rpc-server``` option. 4 | 5 | 6 | ##### Step 1] 7 | Check whether username is already registered. You cannot register username if already registered. 8 | ``` curl http://127.0.0.1:10102/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"nametoaddress","params":{"name":"TESTUSERNAME" }}' -H 'Content-Type: application/json' ``` 9 | 10 | ##### Step 2] 11 | Register and associate DERO wallet to username. 12 | ``` curl http://127.0.0.1:10103/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"scid":"0000000000000000000000000000000000000000000000000000000000000001","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Register"}, {"name":"name","datatype":"S","value":"TESTUSERNAME" }] }}' -H 'Content-Type: application/json' ``` 13 | 14 | #### NB: Can register username of minimum 6 bytes(size) only. 15 | #### NB: Replace TESTUSERNAME with your desired available username in abvove steps. 16 | #### NB: "scid":"0000000000000000000000000000000000000000000000000000000000000001" is reserved for nameservice registration. 17 | 18 | 19 | -------------------------------------------------------------------------------- /DVMDOCS/examples/nameservice/example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # set -x # to enable debug and verbose printing of each and every command 4 | 5 | CURDIR=`/bin/pwd` 6 | BASEDIR=$(dirname $0) 7 | ABSPATH=$(readlink -f $0) 8 | ABSDIR=$(dirname $ABSPATH) 9 | 10 | 11 | command -v curl >/dev/null 2>&1 || { echo "I require curl but it's not installed. Aborting." >&2; exit 1; } 12 | command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } 13 | 14 | 15 | daemon_rpc_port="20000" # daemon rpc is listening on this port 16 | 17 | # we have number of wallets listening at ports from 30000 18 | # we will be using 3 wallets, named owner, player1,player2 19 | owner_rpc_port="30000" 20 | player1_rpc_port="30001" 21 | player2_rpc_port="30002" 22 | 23 | owner_address=$(curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 24 | player1_address=$(curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 25 | player2_address=$(curl --silent http://127.0.0.1:$player2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 26 | 27 | 28 | function balance(){ 29 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'| jq -r ".result.balance" 30 | } 31 | 32 | 33 | 34 | echo "SC owner address" $owner_address 35 | echo "player1 address" $player1_address 36 | echo "player2 address" $player2_address 37 | 38 | 39 | # echo -n "wallet1 sending dero to 2 wallets txid " 40 | # curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{ "transfers":[{"amount":10000,"destination":"'"$player2_address"'"},{"amount":10000,"destination":"'"$owner_address"'"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 41 | # exit 0 42 | 43 | # use owner wallet to load/install an lotter sc to chain 44 | #scid=$(curl --silent --request POST --data-binary @nameservice.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 45 | scid="0000000000000000000000000000000000000000000000000000000000000001" 46 | echo "Name Service SCID" $scid 47 | 48 | sleep 1 49 | 50 | 51 | #curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$scid"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' 52 | 53 | username="user11" 54 | echo -n "wallet1 Registering '$username' txid " 55 | curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"scid":"'"$scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Register"}, {"name":"name","datatype":"S","value":"'"$username"'" }] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 56 | sleep 2 57 | 58 | echo -n $username "registeration result" 59 | curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"DERO.NameToAddress","params":{"name":"'"$username"'" }}' -H 'Content-Type: application/json' 60 | #| jq -r ".result.address" 61 | 62 | exit 0 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /DVMDOCS/examples/nameservice/nameservice.bas: -------------------------------------------------------------------------------- 1 | /* Name Service SMART CONTRACT in DVM-BASIC. 2 | Allows a user to register names which could be looked by wallets for easy to use name while transfer 3 | */ 4 | 5 | 6 | // This function is used to initialize parameters during install time 7 | Function Initialize() Uint64 8 | 10 RETURN 0 9 | End Function 10 | 11 | // Register a name, limit names of 5 or less length 12 | Function Register(name String) Uint64 13 | 10 IF EXISTS(name) THEN GOTO 50 // if name is already used, it cannot reregistered 14 | 20 IF STRLEN(name) >= 6 THEN GOTO 40 15 | 30 IF SIGNER() != address_raw("deto1qyvyeyzrcm2fzf6kyq7egkes2ufgny5xn77y6typhfx9s7w3mvyd5qqynr5hx") THEN GOTO 50 16 | 40 STORE(name,SIGNER()) 17 | 50 RETURN 0 18 | End Function 19 | 20 | 21 | // This function is used to change owner 22 | // owner is an string form of address 23 | Function TransferOwnership(name String,newowner String) Uint64 24 | 10 IF LOAD(name) != SIGNER() THEN GOTO 30 25 | 20 STORE(name,ADDRESS_RAW(newowner)) 26 | 30 RETURN 0 27 | End Function 28 | 29 | -------------------------------------------------------------------------------- /DVMDOCS/examples/token/example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # set -x # to enable debug and verbose printing of each and every command 4 | 5 | CURDIR=`/bin/pwd` 6 | BASEDIR=$(dirname $0) 7 | ABSPATH=$(readlink -f $0) 8 | ABSDIR=$(dirname $ABSPATH) 9 | 10 | 11 | command -v curl >/dev/null 2>&1 || { echo "I require curl but it's not installed. Aborting." >&2; exit 1; } 12 | command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed. Aborting." >&2; exit 1; } 13 | 14 | 15 | daemon_rpc_port="20000" # daemon rpc is listening on this port 16 | 17 | # we have number of wallets listening at ports from 30000 18 | # we will be using 3 wallets, named owner, player1,player2 19 | owner_rpc_port="30000" 20 | player1_rpc_port="30001" 21 | player2_rpc_port="30002" 22 | 23 | owner_address=$(curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 24 | player1_address=$(curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 25 | player2_address=$(curl --silent http://127.0.0.1:$player2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getaddress"}' -H 'Content-Type: application/json'| jq -r ".result.address") 26 | 27 | 28 | function balance(){ 29 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance"}' -H 'Content-Type: application/json'| jq -r ".result.balance" 30 | } 31 | 32 | function tokenbalance(){ 33 | curl --silent http://127.0.0.1:$1/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getbalance" , "params":{ "scid":"'"$2"'" }}' -H 'Content-Type: application/json'| jq -r ".result.balance" 34 | } 35 | 36 | function scbalance(){ 37 | curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$1"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' | jq -r ".result.balance" 38 | } 39 | 40 | echo "SC owner address" $owner_address 41 | echo "player1 address" $player1_address 42 | echo "player2 address" $player2_address 43 | 44 | 45 | # echo -n "wallet1 sending dero to 2 wallets txid " 46 | # curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{ "transfers":[{"amount":10000,"destination":"'"$player2_address"'"},{"amount":10000,"destination":"'"$owner_address"'"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 47 | # exit 0 48 | 49 | # use owner wallet to load/install an lotter sc to chain 50 | scid=$(curl --silent --request POST --data-binary @token.bas http://127.0.0.1:$owner_rpc_port/install_sc| jq -r ".txid") 51 | 52 | echo "SCID" $scid 53 | 54 | 55 | sleep 1 56 | 57 | 58 | #curl --silent http://127.0.0.1:$daemon_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"'"$scid"'" , "code":false, "keysstring":["deposit_count"]}}' -H 'Content-Type: application/json' 59 | 60 | echo -n "wallet1 swapping dero to tokens txid " 61 | curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":10000,"scid":"'"$scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"IssueTOKENX"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 62 | sleep 2 63 | echo "wallet1 received tokens in return" $(tokenbalance $player1_rpc_port $scid) 64 | sleep 2 65 | echo "wallet1 received tokens in return" $(tokenbalance $player1_rpc_port $scid) 66 | 67 | 68 | 69 | 70 | echo -n "wallet1 sending tokens to wallet2 txid " 71 | curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{ "transfers":[{"amount":10000,"destination":"'"$player2_address"'","scid":"'"$scid"'","ringsize":2}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 72 | 73 | 74 | sleep 4 75 | 76 | #echo "token SC balance (total deposited)" $(scbalance $scid) 77 | echo "wallet1 token balance" $(tokenbalance $player1_rpc_port $scid) 78 | echo "wallet2 token balance" $(tokenbalance $player2_rpc_port $scid) 79 | #echo "wallet1 token balance" $(tokenbalance $player1_rpc_port $scid) 80 | 81 | 82 | echo "wallet2 DERO balance before redeeming tokens" $(balance $player2_rpc_port) 83 | 84 | echo -n "wallet2 reconverting tokens to dero txid " 85 | curl --silent http://127.0.0.1:$player2_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_token_deposit":10000,"scid":"'"$scid"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"ConvertTOKENX"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 86 | sleep 2 87 | 88 | echo "wallet2 DERO balance after redeeming tokens" $(balance $player2_rpc_port) -------------------------------------------------------------------------------- /DVMDOCS/examples/token/token.bas: -------------------------------------------------------------------------------- 1 | /* Private Token Smart Contract Example in DVM-BASIC. 2 | DERO Smart Contracts Tokens privacy can be understood just like banks handle cash. Once cash is out from the bank, bank is not aware about it (who owns what value), until it is deposited back. 3 | Smart contract only maintains supply and other necessary items to keep it working. 4 | DERO Tokens can be tranfered to other wallets just like native DERO with Homomorphic Encryption and without involvement of issuing Smart Contracts. 5 | Token issuing Smart Contract cannot hold/freeze/control their tokens once they are issued and sent to any wallet. 6 | This token is Private. Use Function InitializePrivate() Uint64 to make any Smart Contract private. 7 | 8 | */ 9 | 10 | 11 | // Issue tokens after depositing DERO (Convert DERO to TOKENX) 12 | Function IssueTOKENX() Uint64 13 | 10 SEND_ASSET_TO_ADDRESS(SIGNER(), DEROVALUE(),SCID()) // Increment balance of user, without knowing original balance, this is done homomorphically 14 | 20 RETURN 0 15 | End Function 16 | 17 | // Convert TOKENX to DERO after depositing TOKENX. Smart Contract can give DERO, Only if DERO balance exists. 18 | Function ConvertTOKENX() Uint64 19 | 10 SEND_DERO_TO_ADDRESS(SIGNER(),ASSETVALUE(SCID())) // Increment balance of user, without knowing original balance, this is done using Homomorphic Encryption. 20 | 20 RETURN 0 21 | End Function 22 | 23 | // This function is used to initialize parameters during install time 24 | // InitializePrivate initializes a private SC 25 | // Smart contract authors should hardcode their intended address for contract ownership, then add a check within the Initialize() or InitializePrivate() functions to ensure that the caller is the true owner. 26 | Function InitializePrivate() Uint64 27 | 10 IF SIGNER() == address_raw("dero1qywqad0njut7h4h0h0933dfspsdeyfphzzcs5ujw03ghqzhhw8c9zqqevltfj") THEN GOTO 30 //Exit unless smart contract owner. 28 | 20 RETURN 0 // exit 29 | 30 STORE("owner", SIGNER()) // Store in DB ["owner"] = address 30 | 40 SEND_ASSET_TO_ADDRESS(SIGNER(), 1600000, SCID()) // Gives initial encrypted balance of 1600000. 31 | 50 RETURN 0 32 | End Function 33 | 34 | // This function is used to change owner 35 | // owner is an string form of address 36 | Function TransferOwnership(newowner String) Uint64 37 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 38 | 20 RETURN 1 39 | 30 STORE("tmpowner",ADDRESS_RAW(newowner)) 40 | 40 RETURN 0 41 | End Function 42 | 43 | // Until the new owner claims ownership, existing owner remains owner 44 | Function ClaimOwnership() Uint64 45 | 10 IF LOAD("tmpowner") == SIGNER() THEN GOTO 30 46 | 20 RETURN 1 47 | 30 STORE("owner",SIGNER()) // ownership claim successful 48 | 40 RETURN 0 49 | End Function 50 | 51 | // if signer is owner, withdraw any requested funds 52 | // if everthing is okay, they will be showing in signers wallet 53 | Function Withdraw( amount Uint64) Uint64 54 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 55 | 20 RETURN 1 56 | 30 SEND_DERO_TO_ADDRESS(SIGNER(),amount) 57 | 40 RETURN 0 58 | End Function 59 | 60 | // if signer is owner, provide him rights to update code anytime 61 | // make sure update is always available to SC 62 | Function UpdateCode( code String) Uint64 63 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 64 | 20 RETURN 1 65 | 30 UPDATE_SC_CODE(code) 66 | 40 RETURN 0 67 | End Function 68 | 69 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /DVMDOCS/examples/token/token_sc_guide.md: -------------------------------------------------------------------------------- 1 | #### Dero Stargate DVM Smart Contracts guide to install and test various function of private token Smart Contract. 2 | 3 | 4 | 5 | **Download** Dero Stargate testnet [source](https://github.com/deroproject/derohe) and [binaries](https://github.com/deroproject/derohe/releases). 6 | 7 | **DERO default ports:** 8 | ``` 9 | Mainnet: 10 | P2P Default Port: 10101 11 | RPC Default Port: 10102 12 | Wallet RPC Default Port: 10103 13 | 14 | Testnet: 15 | P2P Default Port: 40401 16 | RPC Default Port: 40402 17 | Wallet RPC Default Port: 40403 18 | ``` 19 | **NB:**: Change ports to mainnet or testnet based on your requirements. 20 | 21 | **Start Dero daemon in testnet mode.** 22 | ``` 23 | ./derod-linux-amd64 --testnet 24 | ``` 25 | 26 | **Start Dero wallet in testnet.** 27 | ``` 28 | dero-wallet-cli-linux-amd64 --rpc-server --wallet-file testnet.wallet --testnet 29 | ``` 30 | 31 | **Start Dero wallet second instance to test transfer/ownership functions etc.** 32 | ``` 33 | dero-wallet-cli-linux-amd64 --wallet-file testnet2.wallet --testnet --rpc-server --rpc-bind=127.0.0.1:40403 34 | ``` 35 | 36 | **Dero testnet Explorer, Not required but if you want to host your own explorer for privacy reasons.** 37 | ``` 38 | ./explorer-linux-amd64 --http-address=0.0.0.0:8080 39 | ``` 40 | Connect to explorer using browser on localhost:8080 41 | 42 | 43 | **Dero Stargate Mainnet Explorer** 44 | [https://explorer.dero.io/ ](https://explorer.dero.io/) 45 | 46 | 47 | 48 | **DERO has 2 types of SCs, public and private.** 49 | 1. Public SCs are public with all data/code/exchanges are public. 50 | 1. Private SCs have their smart contract data public. But no one knows how many tokens a particular user own or how much is he sending or how much is he receiving. Best example is to understand private SCs as banks and private tokens as cash. Once cash is out from the bank, Bank doesn't know "who has what amount or how is it being used/sent/received etc.". This makes all private tokens completely private. 51 | 52 | **Installing Private Smart Contract.** 53 | [Download token.bas](https://github.com/deroproject/documentation/blob/master/DVMDOCS/examples/lottery/lottery.bas) 54 | ``` 55 | curl --request POST --data-binary @token.bas http://127.0.0.1:40403/install_sc 56 | ``` 57 | 58 | **To check private token balance in wallet, type this command in wallet.** 59 | ``` 60 | balance SCID 61 | ``` 62 | 63 | **Download SC Code,check SC balance and variables from chain** 64 | ``` 65 | curl http://127.0.0.1:40402/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"getsc","params":{ "scid":"6c7f9f802a36a90346cb04a9ac1783766c798cdeecd89be7a1f5bf92efdfdef7" , "code":true}}' -H 'Content-Type: application/json' 66 | ``` 67 | 68 | 69 | 70 | **Examples of various private Smart Contract Token functions** 71 | 72 | 73 | **To send private tokens from one wallet to another wallet, this does not involve SC** 74 | ``` 75 | curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{ "transfers":[{"amount":10000,"destination":"'"deto1qyg4xr4t536vyan6eyv5vj406xcfwg8zx4c65ez3ut4s9uuv0dsgzqq276gck"'","scid":"'"fb349eed965fecb28318d9bbe44379cbbe6bb1321818d66707a1924e73d59d9e"'","ringsize":2}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 76 | ``` 77 | 78 | 79 | 80 | **Convert DERO to Tokens** 81 | ``` 82 | curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_dero_deposit":220000,"scid":"'"fb349eed965fecb28318d9bbe44379cbbe6bb1321818d66707a1924e73d59d9e"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"IssueTOKENX"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 83 | ``` 84 | **NOTE:** In [above SC](https://testnetexplorer.dero.io/tx/6c7f9f802a36a90346cb04a9ac1783766c798cdeecd89be7a1f5bf92efdfdef7) 2 DERO is swapped to 2 TOKENX. For swap ratio look into Smart Contract code. 85 | 86 | 87 | 88 | 89 | **Convert Tokens to DERO** 90 | ``` 91 | curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{"sc_token_deposit":200000,"scid":"'"fb349eed965fecb28318d9bbe44379cbbe6bb1321818d66707a1924e73d59d9e"'","ringsize":2, "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"ConvertTOKENX"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 92 | ``` 93 | **NOTE:** In [above SC](https://testnetexplorer.dero.io/tx/6c7f9f802a36a90346cb04a9ac1783766c798cdeecd89be7a1f5bf92efdfdef7) 2 TOKENX is swapped to 2 DERO. For swap ratio look into Smart Contract code. 94 | Currently these show as coinbase rewards. 95 | 96 | 97 | 98 | 99 | **Eg: To withdraw DERO balance from Smart Contract** 100 | ``` 101 | curl --silent http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"'"fb349eed965fecb28318d9bbe44379cbbe6bb1321818d66707a1924e73d59d9e"'", "ringsize":2,"sc_rpc":[{"name":"entrypoint","datatype":"S","value":"Withdraw"}, {"name":"amount","datatype":"U","value":2 }] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 102 | ``` 103 | **NOTE:** From [above SC](https://testnetexplorer.dero.io/tx/6c7f9f802a36a90346cb04a9ac1783766c798cdeecd89be7a1f5bf92efdfdef7) 1 DERO will be transferred from SC to wallet. Only owner of Smart Contract can initate the above command. SC must have that balance. 104 | 105 | 106 | 107 | 108 | 109 | **Eg: To transfer ownership of smart contract to new address/owner** 110 | ``` 111 | curl --silent http://127.0.0.1:$owner_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"'"$scid"'", "ringsize":2,"sc_rpc":[{"name":"entrypoint","datatype":"S","value":"TransferOwnership"}, {"name":"newowner","datatype":"S","value":"'"$user1_address"'" }] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 112 | ``` 113 | 114 | 115 | 116 | 117 | **Eg: To claim ownership of smart contract** 118 | ``` 119 | curl --silent http://127.0.0.1:$player1_rpc_port/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"'"$scid"'", "ringsize":2,"sc_rpc":[{"name":"entrypoint","datatype":"S","value":"ClaimOwnership"}] }}' -H 'Content-Type: application/json' | jq -r ".result.txid" 120 | ``` 121 | 122 | 123 | 124 | 125 | 126 | **Eg: To update smart contract code** 127 | ``` 128 | curl http://127.0.0.1:40403/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"scinvoke","params":{ "scid":"YourSCID", "sc_rpc":[{"name":"entrypoint","datatype":"S","value":"UpdateCode"}, {"name":"code","datatype":"S","value":"new code should be placed here" }] }}' -H 'Content-Type: application/json' 129 | ``` 130 | **NOTE:** Please use this command carefully. Try this command several times on testnet before issuing on mainnet to update SC code. 131 | 132 | -------------------------------------------------------------------------------- /DVMDOCS/statementsDVM.md: -------------------------------------------------------------------------------- 1 | ### Statements supported by DERO Virtual Machine. 2 | 3 | ### List of DVM statements 4 | 1. [DIM](#dim) 5 | 1. [FUNCTION](#function) 6 | 1. [GOTO](#goto) 7 | 1. [IF](#if) 8 | 1. [LET](#let) 9 | 1. [RETURN](#return) 10 | 11 | #### DIM 12 | DIM stands for data in memory and is used to define variable names within a function. 13 | 14 | Syntax: 15 | ``` 16 | 10 DIM variable1 as type 17 | 20 DIM variable1,variable2 as type 18 | 30 DIM key,owner as String 19 | 40 DIM count as Uint64 20 | ``` 21 | Supported type in DVM are Uint64, String. 22 | All DVM variables are mandatory to be defined and are initialized to default values: 0 for Uint64 and "" for String. 23 | 24 | #### FUNCTION 25 | Function statement is used to define a function. 26 | Syntax: 27 | ``` 28 | Function ADD(x uint64, y uint64) uint64 29 | 10 RETURN x + y 30 | End Function 31 | ``` 32 | Function syntax is of two types. 33 | ``` 34 | Function function_name( 0 or more arguments ) 35 | Function function_name( 0 or more arguments ) return type 36 | ``` 37 | DVM functions follow some following rules: 38 | * All functions begin with Function keyword. 39 | * Function name should be alpha-numeric. 40 | * If the first letter of the function is upper case alphabet then function can be invoked by blockchain and other smart-contracts. 41 | * If the first letter of the function is lower case alphabet then function can only be invoked by other functions within the smart contract. 42 | * Function may or may not have a return type. 43 | * All functions must use RETURN to return from function or to return a value. RETURN is mandatory. 44 | * All functions must end with End Function. End Function is mandatory 45 | * A function can have a implicit parameter value of type uint64, which contains amount of DERO value sent with the transaction. 46 | 47 | Any error caused during processing will immediately stop execution and discard all changes that occur during SC execution. 48 | Any entrypoint which returns uint64 value 0 is termed as success and will make transaction to commit all state changes. 49 | 50 | #### GOTO 51 | GOTO is used to jump to any line number within the function. 52 | GOTO cannot cross function boundary. 53 | Syntax: 54 | ``` 55 | // If signer is owner then withdraw. 56 | Function Withdraw( amount Uint64) Uint64 57 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 58 | 20 RETURN 1 59 | 30 SEND_DERO_TO_ADDRESS(SIGNER(),amount) 60 | 40 RETURN 0 61 | End Function`` 62 | ``` 63 | 64 | #### IF 65 | IF statement executes a statement if a specified condition is true. 66 | IF has following forms: 67 | 1. IF condition THEN GOTO lineNumber 68 | 2. IF condition THEN GOTO lineNumber ELSE GOTO lineNumber 69 | 70 | Syntax: 71 | ``` 72 | 10 IF COUNT == 0 THEN GOTO 110 73 | 20 IF COUNT == 0 THEN GOTO 110 ELSE GOTO 200 74 | ``` 75 | 76 | #### LET 77 | LET is used to assign a value to a variable. 78 | Value can be as complex as possible and can contain complex expression. 79 | Syntax: 80 | ``` 81 | 10 LET COUNT = 10 82 | 10 LET x = 2 + 3 + ADD(2,3) 83 | ``` 84 | Any assignments within DVM can only be done using LET. 85 | 86 | 87 | #### RETURN 88 | RETURN is used to return from a function. 89 | RETURN has following forms: 90 | 1. RETURN (return nil) 91 | 2. RETURN expression 92 | 93 | Syntax: 94 | ``` 95 | 10 RETURN 0 96 | 20 RETURN X + Y 97 | ``` 98 | Return value must match with the type defined while declaring function. 99 | RETURN can be used anywhere within a function. 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /DVMDOCS/support_functions.md: -------------------------------------------------------------------------------- 1 | #### DVM inbuilt support functions which provide some functionality or expose DVM internals. 2 | 3 | #### List of DVM support functions. 4 | 1. [LOAD](#load) 5 | 1. [EXISTS](#exists) 6 | 1. [STORE](#store) 7 | 1. [RANDOM](#random) 8 | 1. [SCID](#scid) 9 | 1. [BLID](#blid) 10 | 1. [TXID](#txid) 11 | 1. [BLOCK_HEIGHT](#block_height) 12 | 1. [BLOCK_TOPOHEIGHT](#block_topoheight) 13 | 1. [SIGNER](#signer) 14 | 1. [IS_ADDRESS_VALID](#is_address_valid) 15 | 1. [ADDRESS_RAW](#address_raw) 16 | 1. [SEND_DERO_TO_ADDRESS](#send_dero_to_address) 17 | 1. [ADD_VALUE](#add_value) 18 | 1. [DEROVALUE](#derovalue) 19 | 1. [TOKENVALUE](#tokenvalue) 20 | 21 | 22 | 23 | ##### LOAD 24 | LOAD(variable) 25 | LOAD loads a variable which was previously stored in the blockchain using STORE function. 26 | Return type will be Uint64/String depending on stored data type. 27 | Panic if the value does NOT exists. 28 | Syntax: 29 | ``` 30 | 10 IF LOAD(name) != SIGNER() THEN GOTO 30 31 | ``` 32 | 33 | #### EXISTS 34 | Uint64 EXISTS(variable) 35 | EXISTS return 1 if the variable is store in DB and 0 otherwise. 36 | Syntax: 37 | ``` 38 | 10 IF EXISTS(name) THEN GOTO 50 39 | ``` 40 | 41 | #### STORE 42 | STORE(keyVariable, KeyValue) 43 | STORE stores key and value in the DB. All storage state of the SC is accessible only from the SC which created it. 44 | Syntax: 45 | ``` 46 | 10 STORE("owner", SIGNER()) // Store in DB ["owner"] = address 47 | ``` 48 | 49 | #### RANDOM 50 | Uint64 RANDOM(), Uint64 RANDOM(limit Uint64) 51 | First form gives a uint64. 52 | RANDOM returns a random using a PRNG seeded on BLID,SCID,TXID. 53 | Second form returns random number in the range 0 - (limit), 0 is inclusive, limit is exclusive. 54 | Syntax: 55 | ``` 56 | 10 LET winner = RANDOM() % deposit_count // Finding winner. 57 | ``` 58 | 59 | #### SCID 60 | String SCID() 61 | Returns SMART CONTRACT ID which is currently running. 62 | Syntax: 63 | ``` 64 | 65 | ``` 66 | 67 | #### BLID 68 | Returns current BLOCK ID which contains current execution-in-progress TXID. 69 | String BLID() 70 | Syntax: 71 | ``` 72 | 73 | ``` 74 | 75 | #### TXID 76 | Returns current TXID which is execution-in-progress. 77 | String TXID() 78 | Syntax: 79 | ``` 80 | 81 | ``` 82 | 83 | #### BLOCK_HEIGHT 84 | Returns current chain height of BLID(). 85 | Uint64 BLOCK_HEIGHT() 86 | Syntax: 87 | ``` 88 | 89 | ``` 90 | 91 | #### BLOCK_TOPOHEIGHT 92 | Returns current topoheight of BLID(). 93 | Uint64 BLOCK_TOPOHEIGHT() 94 | Syntax: 95 | ``` 96 | 97 | ``` 98 | 99 | #### SIGNER 100 | Returns address of who signed/sent this transaction. SIGNER() returns the raw address. 101 | String SIGNER() 102 | Syntax: 103 | ``` 104 | 10 IF LOAD("owner") == SIGNER() THEN GOTO 30 105 | ``` 106 | 107 | #### IS_ADDRESS_VALID 108 | Returns 1 if address is valid, 0 otherwise. 109 | Uint64 IS_ADDRESS_VALID(p String) 110 | Syntax: 111 | ``` 112 | 113 | ``` 114 | 115 | #### ADDRESS_RAW 116 | Uint64 IS_ADDRESS_VALID(p String) 117 | Returns address in RAW form as 33 byte keys, Stripping away textual/presentation form. Addresses should always be compared in raw form. 118 | Syntax: 119 | ``` 120 | 121 | ``` 122 | 123 | #### SEND_DERO_TO_ADDRESS 124 | SEND_DERO_TO_ADDRESS(a String, amount Uint64) 125 | Sends amount DERO from SC DERO balance to a address which should be raw form. address must in string form DERO/DETO form. 126 | If the SC does not have enough balance, it will panic. 127 | Syntax: 128 | ``` 129 | 130 | ``` 131 | 132 | #### ADD_VALUE 133 | ADD_VALUE(a String, amount Uint64) 134 | Send specific number of token to specific account. 135 | If account is being touched for the first time, Tt is done simply. 136 | If account is already initialized ( It already has some balance, but SC does not know how much). So, It gives additional balance homomorphically. 137 | Syntax: 138 | ``` 139 | 140 | ``` 141 | 142 | #### DEROVALUE 143 | DEROVALUE() gives DERO transacted/deposited in current transaction. 144 | Syntax: 145 | ``` 146 | 147 | ``` 148 | 149 | #### TOKENVALUE 150 | TOKENVALUE() gives particular token transacted/deposited in currrent transaction. 151 | Syntax: 152 | ``` 153 | 154 | ``` 155 | -------------------------------------------------------------------------------- /Dero Security Audit Report-May2019.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/Dero Security Audit Report-May2019.pdf -------------------------------------------------------------------------------- /Dero_RPC_API.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/Dero_RPC_API.pdf -------------------------------------------------------------------------------- /Dero_Whitepaper.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/Dero_Whitepaper.pdf -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #### DERO Important Links 2 | 1. [WhitePaper](Dero_Whitepaper.pdf) 3 | 1. [Archived WhitePaper](WhitePaper.md) 4 | 1. [DERO Mainnet](https://github.com/deroproject/derosuite) 5 | 1. [DERO Testnets](https://github.com/deroproject/documentation/blob/master/testnet/Readme.md) 6 | 1. [DERO Premine Details](https://github.com/deroproject/documentation/blob/master/premine.md) 7 | 1. [DERO Wiki and Quickstart](https://github.com/deroproject/wiki/wiki) 8 | 9 | 10 | #### Additional GPG key of DeroProject 11 | ``` 12 | -----BEGIN PGP SIGNED MESSAGE----- 13 | Hash: SHA256 14 | 15 | Additional GPG key[DED1 FEF4 4297 A15C AD9A E283 18CD B3ED 5E85 D2D4] will be used for communications, signing commits, releases and other activies related to DeroProject[www.dero.io]. 16 | 17 | DeroProject main key[GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8] is also completely valid and in use. 18 | -----BEGIN PGP SIGNATURE----- 19 | 20 | iF4EAREIAAYFAl3VYKYACgkQCLIDYKA6neiQ7QD8D/Z9nU9dapckwwSEONQrUgR0 21 | rA9vcemPi9FXiZ7OrTQA/2drjzGy78fHnoY1+c1M1XF2cAO92slwWek1qtFY1GSv 22 | =2fiU 23 | -----END PGP SIGNATURE----- 24 | ``` 25 | [DeroProject second GPG key](https://raw.githubusercontent.com/deroproject/documentation/master/captainKEY2.asc) 26 | [DeroProject primary GPG key](https://raw.githubusercontent.com/deroproject/derosuite/master/Captain_Dero_pub.txt) 27 | 28 | 29 | -------------------------------------------------------------------------------- /SecondGPGkeyMsg.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | Hash: SHA256 3 | 4 | Additional GPG key[DED1 FEF4 4297 A15C AD9A E283 18CD B3ED 5E85 D2D4] will be used for communications, signing commits, releases and other activies related to DeroProject[www.dero.io]. 5 | 6 | DeroProject main key[GPG: 0F39 E425 8C65 3947 702A 8234 08B2 0360 A03A 9DE8] is also completely valid and in use. 7 | -----BEGIN PGP SIGNATURE----- 8 | 9 | iF4EAREIAAYFAl3VYKYACgkQCLIDYKA6neiQ7QD8D/Z9nU9dapckwwSEONQrUgR0 10 | rA9vcemPi9FXiZ7OrTQA/2drjzGy78fHnoY1+c1M1XF2cAO92slwWek1qtFY1GSv 11 | =2fiU 12 | -----END PGP SIGNATURE----- 13 | -------------------------------------------------------------------------------- /WhitePaper.md: -------------------------------------------------------------------------------- 1 | ## [Click here for latest revision of Dero Whitepaper]( https://github.com/deroproject/documentation/blob/master/Dero_Whitepaper.pdf) 2 | 3 | ## Following is archived whitepaper for latest Whiteapaper see above link. 4 | ## DERO Blockchain White Paper (Draft Version) 5 | 6 | ## Table of Contents 7 | * **SUMMARY** 8 | * **CHALLENGES** 9 | * **IDENTITY AND KYC: VERIFICATION AND LIMITING MISUSE** 10 | * **VOTING: SAFE, SECURE, AND TRANSPARENT** 11 | * **ASSET MANAGEMENT: PRIVATE AND AUDITABLE** 12 | * **2FA AUTHENTICATOR: SECURE PASSWORD MANAGEMENT AND ACCESS** 13 | * **INTEGRATION WITH TELECOM GATEWAYS** 14 | * **DERO KEY FEATURES** 15 | * **DERO VIRTUAL MACHINE** 16 | * **ROADMAP** 17 | * **SPECIFICATIONS** 18 | * **DERO BLOCKCHAIN DEVELOPMENT** 19 | * **DERO PROJECT COMPANY** 20 | 21 | ## SUMMARY 22 | 23 | DERO is a new, experimental blockchain technology written in Golang with a focus on enhanced Privacy and Smart Contracts while maintaining the transparency and security of the blockchain. The goal is to create a unique state of the art blockchain technology with enhanced Reliability, Privacy, Security, Usability, and Portability by bringing together some of the best proven technologies like CryptoNote Protocol and Smart Contracts, thereby allowing for the creation of Private Smart Contracts. 24 | 25 | Blockchain is an open, distributed ledger that can record transactions between two parties efficiently, and in a verifiable and permanent way. 26 | 27 | CryptoNote Protocol uses a distributed public ledger that records all balances and transactions of its in-built currency like Bitcoin. Unlike Bitcoin, CryptoNote's transactions cannot be followed through the blockchain in a way that reveals who sent or received coins. The only people with access to the whole set of data about a transaction are the sender or receiver of the transaction. 28 | 29 | A smart Contract is a protocol intended to facilitate, verify, and enforce the negotiation or execution of a digital contract. Smart contracts allow for direct contract execution without a third party. These transactions are trackable and irreversible. Smart contracts were first proposed by Nick Szabo in 1994. 30 | 31 | For more details about Blockchain, CryptoNote Protocol, and Smart Contract see: 32 | * https://en.wikipedia.org/wiki/Blockchain 33 | * https://en.wikipedia.org/wiki/CryptoNote 34 | * https://cryptonote.org/whitepaper.pdf 35 | * https://en.wikipedia.org/wiki/Smart_contract 36 | 37 | 38 | Some brief examples of what a smart contract is capable of managing without third-party intervention include: access authorization to a physical object like a building or internet-of-things (IoT) devices, asset management, trading, ticket purchasing, or share distribution. In some instances, an individual or organization would prefer not to reveal the details of the transaction or contract (i.e. participants, amounts, and contract terms) to the rest of the world. Dero brings true privacy to smart contracts for the first time on any blockchain. 39 | 40 | 41 | Truly private smart contracts are a unique feature offered by DERO that other projects to date (April.1/2018) do not offer. Dero accomplishes this by keeping all ascepts of the transaction, smart contract, and users details private on the original blockchain without the need to trust sensitive or otherwise private information to second layer or off-chain solutions. 42 | 43 | ## CHALLENGES 44 | * **Identification and know-your-client (KYC):**\ 45 | Having briefly touched upon the need for privacy on the blockchain we must also address the need for some degree of transparency in certain limited situations. Dero will allow thoroughly verified and publicly known certifying authorities to add their signature to individual wallets, and only for those who have applied. This signature serves as confirmation that your identity has been verified by a certifying authority such as a Government, Bank, telecom operator, Visa, Mastercard, or other organizations as required. 46 | 47 | When a service provider require verification of your KYC details, similar to what we’ve seen with exchanges, the process can now be made as simple as using a wallet with the appropriate certification. The service provider, vendor, or payment gateway will only get to see a basic signature that confirms it is authorized to use their services. No personal details are available in these situations. Only certifying authorities will have personal information for individual wallets and only with those who have submitted an application. 48 | 49 | In places where KYC compliance is at its most stringent levels, trades would not be possible without pre-authorization from the appropriate authorities. On an individual level, you can choose whom you certify your wallet with, at your discretion. Given the need for robust privacy and security, Dero’s blockchain has been designed to allow full integration of hardware wallets with biometric protection. 50 | 51 | * **Voting using safe, secure, and transparent smart contracts:**\ 52 | Any organization may use Dero’s blockchain for a safe, secure, and transparent voting process that also keeps the identities of all voters anonymous in the eyes of the public. This is achieved through a type of private “voting smart contract” that is only made possible today on Dero’s blockchain. Aside from Dero, current voting solutions to date operate on public ledgers with public smart contracts that don’t obfuscate or shroud your network traffic from identification. Some workaround solutions have been proposed, such as off-chain computations and second layer solutions; however, these solutions leave a number of fundamental flaws that needlessly complicate wide scale adoption of blockchain technology for private voting processes. 53 | 54 | To register for the voting process, an individual must apply to the certifying authority with their public Dero address and documentation as required. In this instance, the authority in charge will validate your wallet and allow for one (1) vote or more as defined by the smart contract. The details of such a contract should theoretically be public, transparent, and fully available in any democratic process. 55 | 56 | A smart contract of this nature will, of course, require flexibility, and the ability to be reprogrammed to suit the needs of any party that chooses to utilize a private smart voting contract. To that end, the Dero development team is working to keep as much flexibility in the system as possible. 57 | 58 | * **ASSET MANAGEMENT: PRIVATE AND AUDITABLE** \ 59 | With Dero, assets can be recorded, distributed, or traded on the blockchain. Perhaps the most critical issue today facing asset management on the blockchain is privacy. Consider for a moment how assets are recorded today. Most assets are recorded in a private or centralized database like you may find at the Department of Motor Vehicles. Organizations or departments often have limited hours, cumbersome access to information policies, and substantial overhead costs. Bringing asset management to Dero’s blockchain will allow individuals unrestricted use of their own data, by allowing 24/7 access to anything they have stored on Dero’s blockchain while simultaneously offering unparalleled privacy. 60 | 61 | Any individual or organization that choose Dero’s blockchain for asset management will benefit from the highest levels of privacy by utilizing the CryptoNote protocol and complete SSL implementation across the entire network, among other critical features. For audits or tax purposes, all you have to do is provide a simple and convenient viewkey that will list all relevant history from the wallet. This view key can be easily programmed into tax software to reduce cost and human error, while insuring accuracy. It’s important to note that all details of wallets are entirely hidden from the rest of the network. As such, it is the individual wallet holders responsibility to make their relevant tax information known as required. 62 | 63 | * **2-Factor authentication: Secure password management and access:**\ 64 | Dero plans to integrate one-time password (OTP) authenticators and passphrases. Subaddresses could be used as the username to keep public address information private, and, if required, a OTP password will appear in the wallet. An application programming interface (API) and software development kits (SDK) will be freely distributed to service providers to facilitate integration of their existing infrastructure with the Dero blockchain. This will create a significantly more secure environment for the users on a particular service or platform. 65 | 66 | * **Integration with telecom gateways**\ 67 | Dero’s blockchain was built in such a way as to allow integration with telecommunication gateways, to send and receive short message service (SMS a.k.a. text) messages. Once your wallet is certified with a telecom operator, you will be able to send text messages that take advantage of the privacy features from the CryptoNote protocol. For example, ring CT signatures are just one of many features used to hide your data. One-time password verified SMS data will be relayed to the appropriate wallet and held completely privately for only the recipient. 68 | 69 | ## DERO KEY FEATURES 70 | 71 | - **CryptoNote privacy:** CryptoNote currencies use a distributed public ledger that records all balances and transactions of its in-built currency like Bitcoin. Unlike Bitcoin, CryptoNote’s transactions cannot be followed through the blockchain in a way that reveals who sent or received coins. Dero utilizes all aspects of the CryptoNote protocol’s privacy features in its new blockchain technology to protect the identities of all parties involved in a transaction. 72 | - **Smart contracts:** A smart contract is a digital self-executing contract that is capable of enforcing the terms laid out by all participants in the contract. The goal of smart contracts is to significantly increase contract security while simultaneously reducing costs associated with traditional contracts. 73 | - **Atomic swaps:** Atomic swaps make the exchange of one cryptocurrency for another possible without the need for a trusted third-party. To prevent one party from failing to send their coins, atomic swaps use something called hash time-locked contacts (HTLCs) to enable a trustless trading system. 74 | - **Mobile and offline wallets:** As with any currency, multiple forms of storage and varying degrees of financial availability are required. Dero is bringing a complete spectrum of wallet storage options to users by providing solutions that range from mobile wallets on mobile devices to offline 2FA (Two Factor Authentication) biometric identification protected hardware wallets. 75 | - **Lightweight wallet:** Instead of downloading the entire blockchain, a lightweight wallet connects to randomly selected decentralized nodes to utilize the data stored there. This dramatically reduces the amount of data required to transact on the network while maintaining the security of your private keys on your device, not the node the device is connected to. 76 | - **Subaddresses:** This technology allows for the creation of additional public addresses for one wallet. This allows a user to differentiate where payments are coming from while preventing privacy loss caused by linking transactions to one public address. 77 | - **Escrow services on the blockchain:** Escrow services may take advantage of Dero’s blockchain technology by using it as the trusted third party. In this instance, a financial instrument or an asset is recorded on the blockchain and held until the appropriate instructions are given, or contractual obligations have been fulfilled. 78 | - **Address signing and certifying:** Comparable to the way a certifying authority may issue a passport or driver’s license, an individual may receive digital signatures and pre-authorizations that are stored on their individual wallet on the blockchain. 79 | - **Voting:** Through the use of blockchain technology any group or organization may create a safe and transparent voting system that also maintains complete anonymity among voters. 80 | 81 | ## DERO VIRTUAL MACHINE 82 | 83 | ​ Smart Contracts on the DERO blockchain will run in a DERO Virtual Machine (DVM). DVM is a Turing complete 256-bit Virtual Machine runtime environment for DERO Smart Contracts with CryptoNote Protocol Privacy and additional modifications. 84 | ​ DVM is unique in its ability to execute Smart Contracts while maintaining the privacy and fungiblity of the identities involved in the Smart Contracts. DVM will support the Golang language for writing Smart Contracts with the possibility of Solidity in the future. 85 | ​ DVM is in the development phase, and several other features and optimizations are planned which may be added in the future. 86 | 87 | ## ROADMAP 88 | * DERO Blockchain full Activation: Q1 2018. - Completed ahead of schedule 89 | * GUI Wallets, Sub Addresses, Atomic Swap, Smart Contract Testing: Q2 2018. 90 | * Smart Contract support on chain. Q3 2018. 91 | * Strategic market expansion. 92 | 93 | ## SPECIFICATIONS 94 | * PoW algorithm: CryptoNight 95 | * Max supply: 18.4 million for first 8 years, Infinite ~157,000 DERO/year 96 | * Block reward: Smoothly varying 97 | * Block time: 120 seconds 98 | * Difficulty: Retargets at every block 99 | * Ticker: DERO 100 | 101 | ## DERO BLOCKCHAIN DEVELOPMENT 102 | DERO takes a utilitarian approach to development. From real world examples, use cases, community suggestions, it strives to develop a blockchain that can be deployed and widely used for practical applications. DERO welcomes everyone to participate in shaping its roadmap and technology by contributing directly to code development, proposing new ideas, or submitting comments and suggestions. 103 | DERO total premine 2 million. Premine will be locked to various heights for the next 4 years, and a portion of the premine will be used for various community activities. 104 | * Total premine 2 million DERO 105 | * First 1 million locked for 4 years. 106 | * Second 0.5 million reserved for various activities. Unlocked at 10%, 20%, 30%, 40% respectively in years 1-4. 107 | * Third 0.5 million for development. Unlocked at 20%, 20%, 30%, 30% respectively in years 1-4. 108 | 109 | ## Areas we will strive to refine constantly in the future 110 | * Reducing energy consumption of the network 111 | * Reducing block times 112 | * Increasing transactions per second 113 | * Reducing blockchain sync times and resource utilization 114 | * Reducing blockchain size 115 | * Increasing reliability and security of the network 116 | * Secure hardware wallet with biometrics. 117 | * Regular audits and updates of the core cryptography to negate the benefits of quantum computations. 118 | 119 | ## DERO PROJECT COMPANY : 120 | Plan to incorporate a company which will market, develop, maintain, and expand DERO. 121 | Company would hire more developers, expand the marketing team, add advisors, and would be representing DERO to the world. 122 | 123 | 124 | 125 | 126 | **Draft Version, This document will be updated based on community inputs.** 127 | -------------------------------------------------------------------------------- /captainKEY2.asc: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | 3 | mQINBF3UyAYBEACv68/rc+Pynp6SNa9PIbxNzsngjDLZR0cPi+YUVVD9h+F5rYnO 4 | B0HZ9dQ9Dua8GeBODVHwQegVcukoSoDXbF2R4p42IHwWtKn/UhrT2f0q3qktYi31 5 | 1TyCMh4q5XgDAWfGtmbGcW9XpFlA10QOaEB9Of/IzX1PpG2LFhBxeJoSKiQtpWtr 6 | apULE9/11arPPx+3OD4lSno8bKgwq1AEDPvWGvuptjKDNfzZXNxySotNJVE4eRh0 7 | YoJ1/m8uiG8jKu/03g6Fs3OWnttWKOXyJ9S3GjO1Vk4wm3s23RWfQKlv+GzBzv1v 8 | FiJR1bb2oV2HjJsQ31uVDOVwZbglyVgxuhyqcbrfTZ4chAZ3uFocwmk0/uC8Wt6s 9 | c9z7yu5lbPub7ruuK4OsEGK3sKaJlA15TQVKfSR8L+M18GF8vl4OFSIVyrkSrotJ 10 | PmjiOImtcvEIhCGYnztG0scYCGNpU+euvAz25VRFO9Z6I1TqNooF61bjmC48KL5A 11 | Og5G5Rt22PGPp/2rBsVuje+lxyrAzMjrCLEy++qee0a1ppH6H4PlhZFi8OknuL4P 12 | bb8hjQi/v2fULBOjl2xe2zinMG6CwkgRL1siU3+bQmaaMOUi4uoXctjyu9qDG56g 13 | xnjJH2Ku1qjWgbURt/Wsnmfer1NWp0ZXCp7mgYEs6bKBpLjn0ieuDq6AgQARAQAB 14 | tC9DYXB0YWluIERlcm9Qcm9qZWN0IChsb3RyODI0KSA8Y2FwdGFpbkBkZXJvLmlv 15 | PokCWwQTAQoARQIbAwUJDShogAIeAQIXgBYhBN7R/vRCl6FcrZrigxjNs+1ehdLU 16 | BQJd1MlZCgsJDQgMBwsKAwIHFQoJCAsCAwUWAgMBAAAKCRAYzbPtXoXS1MB0D/9u 17 | p2jgq9yrILgLc3IK6Xy6xOPQtgzNEUxKTco4PiV79W5V5pTrUmyhrRZiX259n8aI 18 | lnVQecNPpFovkfzf3SSxI4S56DTd/8gLFvA+xVN7OpPaVwot0UZA2pKbfh2OmtJn 19 | o2Z5BkVfJWkLK97GbGR/us4qRTEVPWpL9ZaoJEHn/CWWEqbs02hxAoZ2OVNPLxNn 20 | gKr2o6HgZeHFbPCNn3V15WKw+DXytLnxP2Pl9GwJ36xF1ThjlmZ6VTgeIP7mp73u 21 | 8NmrejvtnRaWB6cp5FEs9KnIL87OaA1ypDO/XNEyCrHbneBiPHg59d1i63Y+qAU1 22 | 6CV5TALAG7a/wBnwyCHYcPq/8EVk3QdPbEyUSfb20MJssj2ai74YvJMGh22roUf4 23 | +U99sUYrRsRZHMpQ3GQO8vPKOrDtLWGiRj0/Uj2M0YIB+40Xj9mHQc+QV3SWVfVx 24 | WwNcxnXjo5ghcYnC77FUYRg4pn8ziPBI31GExP8+sAagWEOKElgI936Fg+JtS6wn 25 | VnCUgnw5DddU47F2MSRkYGqmLgv+gcuddlxj+gAmUN3qsWw6HgkTlfLvTqdEO4Gs 26 | 9Hxs49AIEv+CNfy3AMU1OAhgToKyevnFbZ5ppf6fBlnnFlVbzqIjPhq3eEcIt/r+ 27 | 8jfG5yF3Ak4MB1A1gO/Qrdm7rgQ6DYl3cgbUiLzkFrkCDQRd1MgGARAAsEM/3FdC 28 | p7dfE/BWDKlrxc1GA0g9KJjFBLGt5wbpjEbYubTcj1QveBoHgAxFaVS70e1Cao4x 29 | giN8qG6gDwfoJvr5sLIhIw5Fii/iR+RUIV424whwJ43/wokgBGIjSavZpREDNTCM 30 | 6OshrUiqAt9z9gm11z9JNkbNB/pD3wOBRKq1yAipTPg7XlMJIo6gOrsB8AMqGQm+ 31 | KEiCaIBZMDopns5d3BvYielG2Cm1R1FH/abOc6L5wqOExpX1KlZ2WpqPPQCT0T5n 32 | wdu9rr0NaNurVzEx3wwXN7JKJi6HMwPYtQG3c1KHJwqpUKAaSV0ktH60Bg7nvDW4 33 | qssm3iV/Zgkm/KczyaRVaDmPTT1fz0tuvhYC4oDTmyfkCq4AaYJs3QIU5NDmivn5 34 | zAKW6Zg1ZjqGElbMaNvPyk16OVI25oHorc2ZlkZo9hj+VUnxMF6YDvI0F0zzDCfE 35 | NlOWSVmy7GDUPfYcItScDpK6D0eL9w+UD/mwqAdH9sAXCSTczvbd5A47z5OBBjmw 36 | qINYAa0N4sPzUtQOGAR0xTrVRvpx0L/gSw2sLC4AkA2+8heABTkyAsiW5EN1fHOi 37 | XvuIRgq4tXNW0DH9czZcqptFfgiyquUhhOPYnvxPJu24uBR2nsoA/mXV3Pvwf+2d 38 | y3zmxwvHTJqksubXibbumRejvMPimMm7v2kAEQEAAYkCPAQYAQoAJhYhBN7R/vRC 39 | l6FcrZrigxjNs+1ehdLUBQJd1MgGAhsMBQkNKGiAAAoJEBjNs+1ehdLUBNMP/ixM 40 | 9oQQzSoe2MgCZ3ERe4ufqhjQ2X3mO4x5f1WZ5lw/zBkvOFgDoGoPg2oZVENQleXC 41 | eQdbvYvrp9adM5WMo3jl0qIP08g/3nRhXfdUZk1ix2szJR5CM76EfchViHmjR07O 42 | XinwgsG+vvH5ETo3f4/O+n7ktdxIoHvg2omzq0/iJ/Ir4XOMThq3R/uQVgJEhwSw 43 | Fay1+d2+rWDUkJcS2s1OuLIMvd27azcHtNwim+AO+gn6Pkq4B/YazFguuAwO18RX 44 | UY2u/74m6jELyK97txUXkIcTeN3DzfRf0OyG6cZnNYbOM7jYwFLGUBwA8KbiUOsx 45 | +qPtfJHyl6V4pyWlMRaBPWWkOsqe3EphoL9TR2nDF+KgiaG5AZYgb9snyMT7I2kV 46 | vepwhvIBwO36SZ3zyHxlzqIQcspwCR1MhJTK5k+z5epfzJgCTRTwW9zEYVV+qN08 47 | EN2PNqnOoYodrC++/EV7JfS1TIhIZZNX+coS64ti8b3LUALIkbs0bTlUrtRHpy6V 48 | cFscKqxaVAliza8rOikZyqGDokj8iepXQM8conkjg+MpSadXYj2MbnDdKnyaqh7Y 49 | 4jHJz7znsBfT8idFqCb1SIOBAZ/l4R7LwFaXGfYR/r+oCc7aBbQJ/twibHDO3S4Z 50 | OeVjngY499Hul6WN/YLbgLaZDJXvt7jbZMaRNrH5 51 | =kiZB 52 | -----END PGP PUBLIC KEY BLOCK----- 53 | -------------------------------------------------------------------------------- /images/Dag1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/Dag1.jpeg -------------------------------------------------------------------------------- /images/Readme.md: -------------------------------------------------------------------------------- 1 | ##### DERO Screenshots 2 | -------------------------------------------------------------------------------- /images/dagx1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dagx1.png -------------------------------------------------------------------------------- /images/dagx2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dagx2.png -------------------------------------------------------------------------------- /images/dagx3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dagx3.png -------------------------------------------------------------------------------- /images/dagx4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dagx4.png -------------------------------------------------------------------------------- /images/dagx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dagx5.png -------------------------------------------------------------------------------- /images/dero_explorer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dero_explorer.png -------------------------------------------------------------------------------- /images/dero_wallet_offline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/dero_wallet_offline.png -------------------------------------------------------------------------------- /images/derod-linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/derod-linux.png -------------------------------------------------------------------------------- /images/derod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/derod.png -------------------------------------------------------------------------------- /images/derod1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/derod1.png -------------------------------------------------------------------------------- /images/explorer-prove-tx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/explorer-prove-tx.png -------------------------------------------------------------------------------- /images/remote-node2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/remote-node2.png -------------------------------------------------------------------------------- /images/status-release-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/status-release-1.png -------------------------------------------------------------------------------- /images/wallet-recover2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/wallet-recover2.png -------------------------------------------------------------------------------- /images/wallet1.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/images/wallet1.jpeg -------------------------------------------------------------------------------- /premine.md: -------------------------------------------------------------------------------- 1 | #### Dero premine status and updates 2 | 3 | Following is summary about Dero premine, For details read [Dero Whitepaper updated](https://github.com/deroproject/documentation/blob/master/Dero_Whitepaper.pdf) and [Orignal Whitepaper](https://github.com/deroproject/documentation/blob/master/WhitePaper.md). 4 | 1. Dero launched in DEC-2017 and has no ICO. 5 | 1. There are totally two million Dero premined. 6 | 1. one million Dero for devs. 7 | 1. one million Dero is used for marketing/community growth and project development. 8 | 9 | As of DEC-2019 Dero devs have decided to pay and adjust all expenses of last two years till date like exchanges listing, marketing, servers etc. from dev's premine share. 10 | Community funds are fully intact and community wallet have complete one million Dero as balance. 11 | 12 | Following is the view key of community wallet. 13 | `9b3c5f17a6611cd9a3dfc4e50d01f3aeab30d9d664d0dd1b1a83841b012a13e2de11d1b045ee0b8172044bb8e827a6bc55240474bc76ecfc544be2bb6c25d106` 14 | #### Premine Screenshot 15 | ![Premine Screenshot](https://github.com/deroproject/documentation/blob/master/premine_DEC-2019.png) 16 | 17 | This page will be updated frequently(every 3-4 months) to reflect updated status of the community fund. All expenses if any will be updated here. 18 | There is plan to transfer community funds to Smart Contracts after Fully Homomorphic Encrypted Smart Contracts on mainnet. 19 | -------------------------------------------------------------------------------- /premine_DEC-2019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deroproject/documentation/5f689feedd50481d552554da8decc01006dc027f/premine_DEC-2019.png -------------------------------------------------------------------------------- /proposals/RFP-2.md: -------------------------------------------------------------------------------- 1 | # RFP-2 (Request for Proposals) 2 | ### DERO Mining Pool to Support [AstroBWT CPU Mining](https://github.com/deroproject/astrobwt). 3 | 4 | DERO Project is looking for the development of high-performance DERO mining pool software including complete backend & site. 5 | 6 | 7 | **Requirements:** 8 | 9 | - Developed in Golang 10 | - Golang in-built http server for web UI 11 | - Support of pool and solo mining 12 | - Mining hardware monitoring 13 | - Track accepts, rejects, and block statistics 14 | - Daemon failover 15 | - Concurrent shares processing 16 | - Support mining rewards sent directly to an exchange 17 | - Use of integrated addresses 18 | - User-friendly design 19 | - License will be free and opensource for anyone 20 | - Properly documented README 21 | - PROP/PPLNS and other pool schemes support can be added later after getting basic pool released 22 | - Support of JSON, ~~GRPC~~ 23 | - Mining Algo will be completely in different file/dir in simple format, to support easy update of mining algos in future 24 | - Community members and others too may provide suggestions/guidelines during development phase 25 | 26 | **Proposal Details** 27 | 28 | All RFPs are due by **Open**. Please create an issue with the following information: 29 | 30 | - Detail your design approach 31 | - Development time 32 | - Estimated fee (in DERO), Can PM or Email also. 33 | -------------------------------------------------------------------------------- /proposals/Readme.md: -------------------------------------------------------------------------------- 1 | ### RFP List 2 | 3 | #### OPEN RFP 4 | - [ RFP-2 Dero pool in Golang - 22 NOV 2019](https://github.com/deroproject/documentation/blob/master/proposals/RFP-2.md) 5 | 6 | #### Closed RFP 7 | -------------------------------------------------------------------------------- /testnet/AstroBWT.md: -------------------------------------------------------------------------------- 1 | ### [AstroBWT](https://github.com/deroproject/derosuite_AstroBWT_testnet): DERO CPU mining Testnet. 2 | 3 | 4 | ### How to mine DERO with CPU using AstroBWT CPU mining algo. 5 | 1. Download [AstroBWT binary](https://github.com/deroproject/derosuite_AstroBWT_testnet/releases) or compile from [source](https://github.com/deroproject/derosuite_AstroBWT_testnet). 6 | 1. Extract and execute derod binary with --testnet option and let it sync fully till all green. 7 | ```./derod-linux-amd64 --testnet``` 8 | 1. [Create DERO wallet address](https://github.com/deroproject/wiki/wiki#running-dero-wallet) with --testnet option. 9 | 1. Run DERO miner with --testnet option. 10 | ``` ./dero-miner-linux-amd64 --testnet --wallet-address dEToYsDQtFoabzBCQbBDSqbkLURQyzmPRCLfeFtzRQA3NgVfU4HDbRpZQUKBzq59QU2QLcoAviYQ59FG4bu8T9pZ1woEQQstVq ``` 11 | 12 | 13 | **Note:** 14 | For more details and discussion feel free to use [Discord](http://discord.gg/H95TJDp) or [E-mail](http://support_at_dero.io). 15 | 16 | -------------------------------------------------------------------------------- /testnet/CNminers_hashes.md: -------------------------------------------------------------------------------- 1 | ### CryptoNight miners hash rates list. 2 | ### 3 | |Asic Miner |Hash Rate |Power Consumption| 4 | | -------- | -------- | -------- | 5 | |Baikal BK-N240| 240 kh/s| 650w| 6 | |Innosilicon A8+ CryptoMaster| 240 kh/s| 480w| 7 | |Bitmain Antminer X3 (220Kh)| 220 kh/s| 465w| 8 | |Innosilicon A8 CryptoMaster| 160 kh/s | 350w| 9 | |Innosilicon A8C CryptoMaster| 80 kh/s |175w| 10 | |Baikal BK-N70| 70 kh/s| 240w| 11 | |Baikal BK-N+| 40 kh/s| 120w| 12 | |PinIdea RR-210| 30 kh/s| 350w| 13 | |PinIdea RR-200| 27 kh/s| 350w| 14 | |Baikal BK-N| 20 kh/s| 60w| 15 | 16 | |GPU Miner |Hash Rate |Power Consumption| 17 | | -------- | -------- | -------- | 18 | |SAPPHIRE NITRO+ RX 580 LIMITED EDITION| 5202 h/s| 534w| 19 | |RADEON VII| 2840 h/s | 175w | 20 | |Vega 64| 2200 h/s| n/a| 21 | |VEGA 56 (BIOS VEGA 64) MEM_P3=1100;870| 2110 h/s| 200w| 22 | |RX VEGA 56| 1651 h/s| 225w| 23 | |TITAN RTX | 1200 h/s| 207w| 24 | |RTX 2080TI| 1138 h/s| 230w| 25 | |AMD RX 5700| 1100 h/s| 92w| 26 | |RTX 2080| 774 h/s| n/a| 27 | |NVIDIA RTX 2060| 715 h/s| 120w | 28 | 29 | |CPU Miner |Hash Rate |Power Consumption| 30 | | -------- | -------- | -------- | 31 | |2U4N XEON PHI 7250| 12000 h/s| N/A | 32 | |POWER8 CPU 3.02GHZ 12CORE 2CHIP| 5000 h/s| N/A| 33 | |POWER8 CPU 3.02GHZ 12CORE 2CHIP| 3500 h/s| 336w| 34 | |INTEL(R) XEON(R) CPU E7-8867 V4 @ 2.40GHZ| 3150 h/s| n/a | 35 | |DUAL INTEL XEON PLATINUM 8180 CPU @ 2.50GHZ| 2800 h/s| 410w| 36 | |RYZEN THREADRIPPER 2970WX| 1975 h/s| 200w| 37 | |AMD THREADRIPPER 1950X| 1800 h/s| 210w| 38 | |RYZEN 3900X| 1672 h/s| 130w| 39 | |I7 7820-X @ 4.6GHZ| 591 h/s| 90w | 40 | |I7-8700K 5.1 GHZ (OVERCLOCK)| 541 h/s| 70w | 41 | -------------------------------------------------------------------------------- /testnet/DeroKnight.md: -------------------------------------------------------------------------------- 1 | # DeroKnight testnet is Dropped, Searching other algo. 2 | ### DeroKnight 3 | 4 | [DeroProject](dero.io) is testing new algo code named: **DeroKnight** . 5 | 6 | **Objective of DeroKnight algo is test simultaneous fair mining by ASIC and GPU and removing any unfair advantage of any mining devices.** 7 | 8 | DeroKnight is same as original CryptoNight but works by decreasing the efficiency of ASICs to match with GPUs. 9 | Efficiency of ASICs are decreased by adding an extra rule in DeroKnight to force nonce to be multiples of 101. 10 | Assuming that all ASICs generate nonce sequentially or randomly but do not have the capability to generate nonce of specific series and cannot be reprogrammed. 11 | This extra rule can be implemented in few lines for CPUs and GPUs without any extra load. 12 | 13 | So with (nonce mod 101 == 0) current ASICs effcacy will be down to 1/100 times. 14 | 15 | **Current CryptoNight Asic of 200KHs will deliver 2KHs of DeroKnight. 16 | GPU/CPU will have no extra performance cost and will deliver almost similar hashrate on CryptoNight and DeroKnight.** 17 | 18 | **Note For GPU/CPU software developers:** 19 | 1. DeroKnight POW is CryptoNight original only, There is no change in POW. 20 | 1. To support DeroKnight in your miner softwares **increment nonce in steps of 101**. 21 | 1. Take initial point whose mod 101 is == 0. 22 | 23 | ### DeroKnight Testnet 24 | DeroKnight Testnet has been launched and to test your devices, please see following instructions. 25 | 26 | 1. Download [DeroKnight binary](https://github.com/deroproject/derosuite_testnet/releases) or compile from [source](https://github.com/deroproject/derosuite_testnet) 27 | 1. Extract and execute derod binary with --testnet option `./derod-linux-amd64 --testnet` 28 | 1. [Download and compile DeroKnight patched XMRSTAK(only for CPU atm)](https://github.com/deroproject/xmr-stak) 29 | 1. To build xmr-stak see following steps: 30 | ``` 31 | git clone https://github.com/deroproject/xmr-stak.git 32 | cd xmr-stak; mkdir -p build; cd build; 33 | cmake -DCMAKE_LINK_STATIC=ON -DXMR-STAK_COMPILE=generic -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF -DMICROHTTPD_ENABLE=OFF ../ 34 | ``` 35 | Run xmrstak
`./bin/xmr-stak --currency cryptonight -o stratum+tcp://testnetpool.dero.io:3333 -u dEToRdMj76baEurCdqpn1XZpWnEpSrXQ9WiLWznYz26ECKmnQtFgTxrTc4dxen5YaER8UDpT6a9iGLHfzVd5qXxg5vBT3bhpFp -p x` 36 | 37 | **Note: ASIC operators have to do nothing except connecting to DeroKnight supporting pool.** 38 | 39 | [DeroKnight Testnet Pool](http://testnetpool.dero.io) 40 | [DeroKnight Testnet Explorer](https://testnetexplorer.dero.io) 41 | [DeroKnight pool code](https://git.dero.io/Captain/dero-pool) 42 | 43 | **Note:** Talks of support of DeroKnight algo in popular miner softwares are in process. Please request choice of your mining software in [Discord](http://discord.gg/H95TJDp) or [E-mail](http://support_at_dero.io). 44 | For more details and discussion feel free to use Discord/Email/Github. 45 | -------------------------------------------------------------------------------- /testnet/Readme.md: -------------------------------------------------------------------------------- 1 | ### DeroProject Testnets: 2 | 1. ### Inactive [DeroKnight Testnet - 24 Nov 2019 : Simultaneous fair mining by ASIC and GPU](https://github.com/deroproject/documentation/blob/master/testnet/DeroKnight.md) 3 | 1. ### Non-Active [Stargate Testnet: Private Smart Contacts on CryptoNote](https://github.com/deroproject/documentation/blob/master/testnet/stargate.md) 4 | 1. ### Active [AstroBWT Testnet: DERO CPU mining AstroBWT testnet. ](https://github.com/deroproject/documentation/blob/master/testnet/AstroBWT.md) 5 | -------------------------------------------------------------------------------- /testnet/stargate.md: -------------------------------------------------------------------------------- 1 | ## Dero Stargate DVM Smart Contracts guide to install and test various function of lottery Smart Contract. 2 | 3 | **Download** Dero Stargate testnet [source](https://git.dero.io/DeroProject/derosuite_stargate) and [binaries](https://git.dero.io/DeroProject/Dero_Stargate_testnet_binaries). 4 | 5 | [Dero Virtual Machine](https://git.dero.io/DeroProject/dvm_doc) 6 | [Examples of other Dero Smart Contracts](https://forum.dero.io/t/dero-smart-contract-build-competition/891) 7 | 8 | **Start Dero daemon in testnet mode.** 9 | ``` 10 | ./derod-linux-amd64 --testnet 11 | ``` 12 | 13 | **Start Dero wallet in testnet.** 14 | ``` 15 | dero-wallet-cli-linux-amd64 --rpc-server --wallet-file testnet.wallet --testnet 16 | ``` 17 | 18 | **Start Dero wallet second instance to test transfer/ownership functions etc.** 19 | ``` 20 | dero-wallet-cli-linux-amd64 --wallet-file testnet2.wallet --testnet --rpc-server --rpc-bind=127.0.0.1:30308 21 | ``` 22 | 23 | **Dero testnet Explorer** 24 | ``` 25 | ./explorer-linux-amd64 --rpc-server-address 127.0.0.1:30306 --http-address=0.0.0.0:8080 26 | ``` 27 | 28 | **Dero Stargate Testnet Explorer** 29 | [https://testnetexplorer.dero.io/ ](https://testnetexplorer.dero.io/) 30 | 31 | 32 | **Installing Smart Contract.** 33 | [Download lottery.bas](https://git.dero.io/DeroProject/derosuite_stargate/src/master/cmd/dvm/lottery.bas) 34 | ``` 35 | curl --request POST --data-binary @lottery.bas http://127.0.0.1:30309/install_sc 36 | ``` 37 | 38 | **Examples of various lottery Smart Contract functions** 39 | **Eg: To play lottery** 40 | ``` 41 | curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"Lottery","scid":"ab82caa18753efa0f76e7266af7fdd7f11e0ada5e135bd63f1cd823f5e2c2fdc" , "value":4000000000000 } }}' 42 | ``` 43 | 44 | **Eg: Withdraw balance** 45 | ``` 46 | curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"Withdraw","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0", "params":{ "amount":"1" } } }}' 47 | ``` 48 | 49 | **Eg: To transfer ownership** 50 | ``` 51 | curl -X POST http://127.0.0.1:30309/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"TransferOwnership","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0", "params":{ "newowner":"dETohFmTunwF58wAs5Jn3d1N1oaJqwRxvarNJudUh95nVbZyigTja1W8Ljzp3j8VhxbB9gv3TBs4W5gnFa24cehz2cM6nUg84s" } } }}' 52 | ``` 53 | 54 | **Eg: To claim ownership** 55 | ``` 56 | curl -X POST http://127.0.0.1:30308/json_rpc -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":"0","method":"transfer_split","params":{"mixin":5,"get_tx_key": true , "sc_tx":{"entrypoint":"ClaimOwnership","scid":"55aaf55b5203cd10f473a9bcf641f305885235e176270ae5e38ba6fa05dbf2b0" } }}' 57 | ``` 58 | --------------------------------------------------------------------------------