Pages:
Author

Topic: [GAM] Gambit | Private Trading Group | Trading Indicators | Trading Classroom - page 58. (Read 297543 times)

legendary
Activity: 1610
Merit: 1119
It's all mathematics...!
hero member
Activity: 595
Merit: 500
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
OK, I dug into the debug log to find the transaction that combined many inputs and found that actually 23 inputs were being
combined into one staking event, see the relevant part below. Interesting that the total value is over the 1000 coin threshold:

 Coinstake(hash=044fc0a62f, nTime=1432792100, ver=1, vin.size=23, vout.size=2, nLockTime=0)
Hmmm, the plot thickens: all other times I see that vout.size = 3 which causes the wallet to skip the re-combination,
only when the vout.size = 2 will the "if" statement pass to enter the re-combination code.
So, now it is a question as to *why* the vout.size parameter is only rarely equal to 2.
hero member
Activity: 595
Merit: 500
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
OK, I dug into the debug log to find the transaction that combined many inputs and found that actually 23 inputs were being
combined into one staking event, see the relevant part below. Interesting that the total value is over the 1000 coin threshold:

CheckStake() : new proof-of-stake block found 
  hash: c942288626a9e212b9e782491fd61feb37910f518cb8e84403d9f4bed3cbd8db
proofhash: 00007b6c34df468ef70da12b881144d1b6a6c36ebe8e5323b553c81c41bf1895 
target: 0001054033000000000000000000000000000000000000000000000000000000
CBlock(hash=c942288626a9e212b9e782491fd61feb37910f518cb8e84403d9f4bed3cbd8db, ver=1, hashPrevBlock=b5ee180a3ee8b1fd928138ac145cb8d98cac2ce39eaf456ce8f5addea900d542, hashMerkleRoot=27e9616631d1713bd889e86777318a6b767aaac49e020ba710ca1d195f6ad416, nTime=1432792100, nBits=1e086d6d, nNonce=0, vtx=2, vchBlockSig=304402202d285b22021aa5e94b2deeeba7778190a958c57e1bcc73d2fa3433bc06056a950220175b3fcd53e9bc8462c07af638f8794f6c7f655c91f104b581dac5977153525b)
  Coinbase(hash=ffc78ce152, nTime=1432792100, ver=1, vin.size=1, vout.size=1, nLockTime=0)
    CTxIn(COutPoint(0000000000, 4294967295), coinbase 02e145)
    CTxOut(empty)
  Coinstake(hash=044fc0a62f, nTime=1432792100, ver=1, vin.size=23, vout.size=2, nLockTime=0)
    CTxIn(COutPoint(4404a90e6f, 2), scriptSig=3045022100b5a4a3931a0153)
    CTxIn(COutPoint(1b6489ac13, 2), scriptSig=304502210094e1da3c7a7c02)
    CTxIn(COutPoint(8b960d2fad, 2), scriptSig=3044022062b5af64dc0dca33)
    CTxIn(COutPoint(270e618cad, 1), scriptSig=304402205b57faa1b397a971)
    CTxIn(COutPoint(270e618cad, 2), scriptSig=3044022056912b2c2506534a)
    CTxIn(COutPoint(aad1e729b8, 2), scriptSig=30440220327e771c09996dc4)
    CTxIn(COutPoint(e23f021dbb, 1), scriptSig=3044022004a33ec90b8485ee)
    CTxIn(COutPoint(e23f021dbb, 2), scriptSig=3045022100f07a01eceda782)
    CTxIn(COutPoint(e257db3bea, 1), scriptSig=3045022100b7e8e4b562b5de)
    CTxIn(COutPoint(4da73a41ff, 1), scriptSig=304402206577b450afcf2a94)
    CTxIn(COutPoint(4b738ee171, 2), scriptSig=304402204771e02cbaa12b17)
    CTxIn(COutPoint(31888d73d1, 1), scriptSig=3045022100e220a34031e894)
    CTxIn(COutPoint(31888d73d1, 2), scriptSig=304402207e2cd617db349016)
    CTxIn(COutPoint(972db1944e, 2), scriptSig=3045022100865f99092ca443)
    CTxIn(COutPoint(c2f3be3074, 2), scriptSig=304402204b5f16e2c5bf88ae)
    CTxIn(COutPoint(e5a39d41f6, 2), scriptSig=3045022100d91d839599209a)
    CTxIn(COutPoint(af3243daeb, 1), scriptSig=3045022100dae9646561be1c)
    CTxIn(COutPoint(af3243daeb, 2), scriptSig=3044022032432ba8774cb600)
    CTxIn(COutPoint(16714a68e7, 1), scriptSig=3045022100f3763055fb9f11)
    CTxIn(COutPoint(16714a68e7, 2), scriptSig=304402200ac8bb49dfb8f8e2)
    CTxIn(COutPoint(43bc199157, 1), scriptSig=3045022100f1e36bce1d9647)
    CTxIn(COutPoint(18b1058b91, 1), scriptSig=3044022017aa0130147355e3)
    CTxIn(COutPoint(18b1058b91, 2), scriptSig=3045022100b93d20024661c8)
    CTxOut(empty)
    CTxOut(nValue=1157.08334162, scriptPubKey=03d2e666928bae3c75ec37de0d56bc02f772a559e20f51319b154faed043794c2d OP_CHECKSIG)
  vMerkleTree: ffc78ce152 044fc0a62f 27e9616631
out 1157.08334162
AddToWallet 044fc0a62f  new
hero member
Activity: 595
Merit: 500
hero member
Activity: 595
Merit: 500
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
Proof of stake is not my expertise but I will ask around and see if anyone can chime in.  Feel free to take a look at the source code yourself if you would like:  https://github.com/collinlahay/gambitcrypto
Thanks Collin, I believe that wallet.cpp has the relevant code:
in function CWallet::CreateCoinStake when a Staking Kernel is found, we are going through this code:
        // Attempt to add more inputs
        // Only add coins of the same key/address as kernel
        if (txNew.vout.size() == 2 && ((pcoin.first->vout[pcoin.second].scriptPubKey == scriptPubKeyKernel || pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey))
            && pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
        {
            int64_t nTimeWeight = GetWeight((int64_t)pcoin.first->nTime, (int64_t)txNew.nTime);

            // Stop adding more inputs if already too many inputs
            if (txNew.vin.size() >= 100)
                break;
            // Stop adding more inputs if value is already pretty significant
            if (nCredit >= nStakeCombineThreshold)
                break;
            // Stop adding inputs if reached reserve limit
            if (nCredit + pcoin.first->vout[pcoin.second].nValue > nBalance - nReserveBalance)
                break;
            // Do not add additional significant input
            if (pcoin.first->vout[pcoin.second].nValue >= nStakeCombineThreshold)
                continue;
            // Do not add input that is still too young
            if (nTimeWeight < nStakeMinAge)
                continue;

            txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
            nCredit += pcoin.first->vout[pcoin.second].nValue;
            vwtxPrev.push_back(pcoin.first);
        }
    }
    // Calculate coin age reward

Now, all my inputs are under the same key; I have no reserved balance and nStakeCombineThreshold is supposed to be 1000 coins.
So, why are my dozens of 15 Gambit inputs that are all mature not combining? Beats me...
sr. member
Activity: 332
Merit: 250
@CollinCrypto [GAM]
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
I have now 143 inputs in my wallet, down to small fragments of 16 Gam (and this is only half the balance, the other half is immature).
Anybody know when they are being recombined, or do I need to do that by hand when there is too much dust?
I rather wait for the wallet to do this for me, since if I recombined staked inputs the wallet hides them while they are immature,
so I can only select them after 8 hours, but combining them causes me to lose the 8 hours maturity again...
So - how/when is recombination done?
Thanks!

Proof of stake is not my expertise but I will ask around and see if anyone can chime in.  Feel free to take a look at the source code yourself if you would like:  https://github.com/collinlahay/gambitcrypto
hero member
Activity: 595
Merit: 500
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
I have now 143 inputs in my wallet, down to small fragments of 16 Gam (and this is only half the balance, the other half is immature).
Anybody know when they are being recombined, or do I need to do that by hand when there is too much dust?
I rather wait for the wallet to do this for me, since if I recombined staked inputs the wallet hides them while they are immature,
so I can only select them after 8 hours, but combining them causes me to lose the 8 hours maturity again...
So - how/when is recombination done?
Thanks!
sr. member
Activity: 289
Merit: 250
Good work, this should get interesting when that doc starts to fill up!!
hero member
Activity: 532
Merit: 500
Crypto is boring nowadays. Sad

Guess i'll invest small amount in this one then.
legendary
Activity: 1044
Merit: 1050
bought some more. This is Looking good.  Grin
sr. member
Activity: 332
Merit: 250
@CollinCrypto [GAM]
Proof of Stake:
Just to reiterate for those unaware: Proof of work ended at block 15,000 without any hiccups, and we are currently nearing 17,500.  The coin is now 100% proof of stake, so remember to download the wallet and start staking to earn 5% interest per year.

Source code released:
EDITED: View Gambitcrypto.com for the most up-to-date source code.

sr. member
Activity: 252
Merit: 250
sr. member
Activity: 252
Merit: 250
Dev, very cool - holy crap the value of GAM has VERY strong potential from what i see with a bit of time.

I see David Seaman on there, lol.  just saying.

He seems to be doing it right.  Love how this is evolving.  Crypto is scary as fuck right now....even giving new coins a look, but this dev seems to have his shit together.  Keep it up!
legendary
Activity: 2730
Merit: 1068
Juicin' crypto
Dev, very cool - holy crap the value of GAM has VERY strong potential from what i see with a bit of time.

I see David Seaman on there, lol.  just saying.
full member
Activity: 207
Merit: 100
sr. member
Activity: 332
Merit: 250
@CollinCrypto [GAM]
EDITED


This post is very old.  Please see the main thread at GambitCrypto.com for up-to-date information.


EDITED
sr. member
Activity: 387
Merit: 250
Collin, trading was not supposed to start yesteday? The google spreadsheet is blocked now, but I didn't saw any announcement

I had read that somewhere as well....that trading started yesterday.  Would love to hear an update too.
hero member
Activity: 784
Merit: 1000
Collin, trading was not supposed to start yesteday? The google spreadsheet is blocked now, but I didn't saw any announcement
full member
Activity: 128
Merit: 100
How about the future of this coin?
hero member
Activity: 595
Merit: 500
Hey Collin,
How does the wallet decide to re-combine inputs that it earlier split in half?
I see with every time staking the inputs go from 1000 to 2x500 to 4x250 to 8x125 and so on,
but occasionally I see a large stake reward and the number of inputs has decreased by about 15,
so apparently if the bits get too small, it will at times decide to collect a bunch of inputs that are ready to stake
and create a single bigger input again. But it does not do this every time, it seems kinda random?
Staking works on set parameters designed to keep the network secure and stable.  Some coins have bad settings because they mess around with things like coins supply (too much, too little). Gambit is based on the Jumbucks code base with similar specs so I know it works well.

So the staking parameters are based on consensus so everyone works based on the same rules. Coin inputs may split, combine, etc...  It's all programmed in. Some things are also based on the staking difficulty at the time as well.
But in general it all "works out".  There is no quick answer though so you'd need to read up on Proof of Stake networks to get the full answer.
Hi Jyap,
I have been involved since early 2014 with one of the first coins that switched from PoW to PoS (Orbit) and we have made modifications
to the parameters to make that coin work better over the first months, so I have an idea how it is supposed to work, that is why I was
looking at Coin Control and trying to figure out when the wallet decides to re-combine inputs - I can see that normally inputs are always split during staking, but at times I see a larger than expected staking reward pop up and when I look at the inputs, there are fewer than I expect, so there are some times that the wallet decides to re-combine, but to me it appears to happen at random, not at a specific (low) value of input (which is what I have seen with other coins - a configurable threshold when it starts to re-combine, so you could manipulate how fast staking was happening without running into the max staking reward. This was sort of a game with the HyperStake coin.
So, I am still looking for a confirmation if the re-combination is at random or that there are certain fixed criteria when it is happening.
I could pull the repository and inspect the source code, of course but have no time to dig in right now.
Pages:
Jump to: