2
src/ac/ccl
Executable file
2
src/ac/ccl
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
./komodo-cli -ac_name=CCL $1 $2 $3 $4 $5 $6
|
||||||
@@ -132,5 +132,15 @@
|
|||||||
"ac_name": "SEC",
|
"ac_name": "SEC",
|
||||||
"ac_supply": "1000000000",
|
"ac_supply": "1000000000",
|
||||||
"ac_cc": "333"
|
"ac_cc": "333"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"ac_name": "CCL",
|
||||||
|
"ac_supply": "200000000",
|
||||||
|
"ac_end": "1",
|
||||||
|
"ac_cc": "2",
|
||||||
|
"addressindex": "1",
|
||||||
|
"spentindex": "1",
|
||||||
|
"addnode": "142.93.136.89",
|
||||||
|
"addnode": "195.201.22.89"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -38,3 +38,4 @@ echo $pubkey
|
|||||||
./komodod -pubkey=$pubkey -ac_name=RFOX -ac_supply=1000000000 -ac_reward=100000000 -addnode=78.47.196.146 &
|
./komodod -pubkey=$pubkey -ac_name=RFOX -ac_supply=1000000000 -ac_reward=100000000 -addnode=78.47.196.146 &
|
||||||
~/VerusCoin/src/komodod -pubkey=$pubkey -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_veruspos=50 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -addnode=185.25.48.236 -addnode=185.64.105.111 &
|
~/VerusCoin/src/komodod -pubkey=$pubkey -ac_name=VRSC -ac_algo=verushash -ac_cc=1 -ac_veruspos=50 -ac_supply=0 -ac_eras=3 -ac_reward=0,38400000000,2400000000 -ac_halving=1,43200,1051920 -ac_decay=100000000,0,0 -ac_end=10080,226080,0 -ac_timelockgte=19200000000 -ac_timeunlockfrom=129600 -ac_timeunlockto=1180800 -addnode=185.25.48.236 -addnode=185.64.105.111 &
|
||||||
./komodod -pubkey=$pubkey -ac_name=SEC -ac_cc=333 -ac_supply=1000000000 -addnode=185.148.145.43 &
|
./komodod -pubkey=$pubkey -ac_name=SEC -ac_cc=333 -ac_supply=1000000000 -addnode=185.148.145.43 &
|
||||||
|
./komodod -pubkey=$pubkey -ac_name=CCL -ac_supply=200000000 -ac_end=1 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=142.93.136.89 -addnode=195.201.22.89 &
|
||||||
|
|||||||
@@ -16,30 +16,29 @@
|
|||||||
#include "CCdice.h"
|
#include "CCdice.h"
|
||||||
|
|
||||||
extern std::string CCerror;
|
extern std::string CCerror;
|
||||||
#define ERR_RESULT(x) result.push_back(Pair("result", "error")) , result.push_back(Pair("error", x));
|
|
||||||
|
|
||||||
// timeout
|
// timeout
|
||||||
|
|
||||||
/*
|
/*
|
||||||
in order to implement a dice game, we need a source of entropy, reasonably fast completion time and a way to manage the utxos.
|
in order to implement a dice game, we need a source of entropy, reasonably fast completion time and a way to manage the utxos.
|
||||||
|
|
||||||
1. CC vout locks "house" funds with hash(entropy)
|
1. CC vout locks "house" funds with hash(entropy)
|
||||||
2. bettor submits bet, with entropy, odds, houseid and sends combined amount into another CC vout.
|
2. bettor submits bet, with entropy, odds, houseid and sends combined amount into another CC vout.
|
||||||
3. house account sends funds to winner/loser with proof of entropy
|
3. house account sends funds to winner/loser with proof of entropy
|
||||||
4. if timeout, bettor gets refund
|
4. if timeout, bettor gets refund
|
||||||
|
|
||||||
2. and 3. can be done in mempool
|
2. and 3. can be done in mempool
|
||||||
|
|
||||||
The house commits to an entropy value by including the hash of the entropy value in the 'E' transaction.
|
The house commits to an entropy value by including the hash of the entropy value in the 'E' transaction.
|
||||||
|
|
||||||
To bet, one of these 'E' transactions is used as the first input and its hashed entropy is combined with the unhashed entropy attached to the bet 'B' transaction.
|
To bet, one of these 'E' transactions is used as the first input and its hashed entropy is combined with the unhashed entropy attached to the bet 'B' transaction.
|
||||||
|
|
||||||
The house node monitors the 'B' transactions and if it sees one of its own, it creates either a winner 'W' or loser 'L' transaction, with proof of hash of entropy.
|
The house node monitors the 'B' transactions and if it sees one of its own, it creates either a winner 'W' or loser 'L' transaction, with proof of hash of entropy.
|
||||||
|
|
||||||
In the even the house node doesnt respond before timeoutblocks, then anybody (including bettor) can undo the bet with funds going back to the house and bettor
|
In the even the house node doesnt respond before timeoutblocks, then anybody (including bettor) can undo the bet with funds going back to the house and bettor
|
||||||
|
|
||||||
In order for people to play dice, someone (anyone) needs to create a funded dice plan and addfunding with enough utxo to allow players to find one.
|
In order for people to play dice, someone (anyone) needs to create a funded dice plan and addfunding with enough utxo to allow players to find one.
|
||||||
|
|
||||||
createfunding:
|
createfunding:
|
||||||
vins.*: normal inputs
|
vins.*: normal inputs
|
||||||
vout.0: CC vout for funding
|
vout.0: CC vout for funding
|
||||||
@@ -73,7 +72,7 @@ loser:
|
|||||||
vout.1: tag to owner address for entropy funds
|
vout.1: tag to owner address for entropy funds
|
||||||
vout.2: change to fundingpk
|
vout.2: change to fundingpk
|
||||||
vout.n-1: opreturn 'L' sbits fundingtxid hentropy proof
|
vout.n-1: opreturn 'L' sbits fundingtxid hentropy proof
|
||||||
|
|
||||||
winner:
|
winner:
|
||||||
same as loser, but vout.2 is winnings
|
same as loser, but vout.2 is winnings
|
||||||
vout.3: change to fundingpk
|
vout.3: change to fundingpk
|
||||||
@@ -81,12 +80,12 @@ winner:
|
|||||||
|
|
||||||
timeout:
|
timeout:
|
||||||
same as winner, just without hentropy or proof
|
same as winner, just without hentropy or proof
|
||||||
|
|
||||||
WARNING: there is an attack vector that precludes betting any large amounts, it goes as follows:
|
WARNING: there is an attack vector that precludes betting any large amounts, it goes as follows:
|
||||||
1. do dicebet to get the house entropy revealed
|
1. do dicebet to get the house entropy revealed
|
||||||
2. calculate bettor entropy that would win against the house entropy
|
2. calculate bettor entropy that would win against the house entropy
|
||||||
3. reorg the chain and make a big bet using the winning entropy calculated in 2.
|
3. reorg the chain and make a big bet using the winning entropy calculated in 2.
|
||||||
|
|
||||||
In order to mitigate this, the disclosure of the house entropy needs to be delayed beyond a reasonable reorg depth (notarization). It is recommended for production dice game with significant amounts of money to use such a delayed disclosure method.
|
In order to mitigate this, the disclosure of the house entropy needs to be delayed beyond a reasonable reorg depth (notarization). It is recommended for production dice game with significant amounts of money to use such a delayed disclosure method.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -39,3 +39,4 @@ curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dp
|
|||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RFOX\",\"freq\":10,\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RFOX\",\"freq\":10,\"pubkey\":\"$pubkey\"}"
|
||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VRSC\",\"freq\":10,\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"VRSC\",\"freq\":10,\"pubkey\":\"$pubkey\"}"
|
||||||
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEC\",\"pubkey\":\"$pubkey\"}"
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEC\",\"pubkey\":\"$pubkey\"}"
|
||||||
|
curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CCL\",\"pubkey\":\"$pubkey\"}"
|
||||||
|
|||||||
2
src/fiat/ccl
Executable file
2
src/fiat/ccl
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
./komodo-cli -ac_name=CCL $1 $2 $3 $4 $5 $6
|
||||||
@@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#define ERR_RESULT(x) result.push_back(Pair("result", "error")) , result.push_back(Pair("error", x));
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@@ -119,9 +118,9 @@ string AccountFromValue(const UniValue& value)
|
|||||||
return strAccount;
|
return strAccount;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *komodo_chainname()
|
char *komodo_chainname()
|
||||||
{
|
{
|
||||||
return(ASSETCHAINS_SYMBOL[0] == 0 ? (char *)"KMD" : ASSETCHAINS_SYMBOL);
|
return(ASSETCHAINS_SYMBOL[0] == 0 ? (char *)"KMD" : ASSETCHAINS_SYMBOL);
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue getnewaddress(const UniValue& params, bool fHelp)
|
UniValue getnewaddress(const UniValue& params, bool fHelp)
|
||||||
@@ -4567,7 +4566,7 @@ int32_t komodo_notaryvin(CMutableTransaction &txNew,uint8_t *notarypub33)
|
|||||||
utxovout = out.i;
|
utxovout = out.i;
|
||||||
best_scriptPubKey = out.tx->vout[out.i].scriptPubKey;
|
best_scriptPubKey = out.tx->vout[out.i].scriptPubKey;
|
||||||
//fprintf(stderr,"check %s/v%d %llu\n",(char *)utxotxid.GetHex().c_str(),utxovout,(long long)utxovalue);
|
//fprintf(stderr,"check %s/v%d %llu\n",(char *)utxotxid.GetHex().c_str(),utxovout,(long long)utxovalue);
|
||||||
|
|
||||||
txNew.vin.resize(1);
|
txNew.vin.resize(1);
|
||||||
txNew.vout.resize(1);
|
txNew.vout.resize(1);
|
||||||
txfee = utxovalue / 2;
|
txfee = utxovalue / 2;
|
||||||
@@ -5779,5 +5778,3 @@ UniValue getbalance64(const UniValue& params, bool fHelp)
|
|||||||
ret.push_back(Pair("notstaking", b));
|
ret.push_back(Pair("notstaking", b));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1148,7 +1148,7 @@ public:
|
|||||||
int minDepth=1,
|
int minDepth=1,
|
||||||
bool ignoreSpent=true,
|
bool ignoreSpent=true,
|
||||||
bool ignoreUnspendable=true);
|
bool ignoreUnspendable=true);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/** A key allocated from the key pool. */
|
/** A key allocated from the key pool. */
|
||||||
@@ -1204,4 +1204,8 @@ public:
|
|||||||
READWRITE(vchPubKey);
|
READWRITE(vchPubKey);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Error status printout */
|
||||||
|
#define ERR_RESULT(x) result.push_back(Pair("result", "error")) , result.push_back(Pair("error", x));
|
||||||
|
|
||||||
#endif // BITCOIN_WALLET_WALLET_H
|
#endif // BITCOIN_WALLET_WALLET_H
|
||||||
|
|||||||
Reference in New Issue
Block a user