Author Topic: 1500 PTS - Bitcoin clone with Dividends, POS, and Signature POW [CANCELED]  (Read 17020 times)

0 Members and 1 Guest are viewing this topic.

Offline bytemaster

only one mining machine, lol centralization!!!  :P

ok, i''l see what i can do.

One machine mining, but not earning anything for doing so.  Everyone else is securing the network with every single transaction.   To attack this network the "one miner" would also have to control the vast majority of the money supply... however, this one miner will not be anonymous and all double spend attacks would be obvious.   In reality this network is less centralized than bitcoin which has GigaHash + 1 :)
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
only one mining machine, lol centralization!!!  :P

ok, i''l see what i can do.
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline bytemaster

I would like the one 'mining' node to automatically build and publish blocks every 30 seconds if there is a new transaction.  The private key for this node should be stored in a password protected file on the master miner machine.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai

Here is verification
https://github.com/Nameshar/Divsshares/blob/master/src/main.cpp#L2047

Replace the place it calls CheckProofOfWork with a call to a custom CheckProofOfMasterSignature, which needs to access the master signature on a block

https://github.com/Nameshar/Divsshares/blob/master/src/main.h#L836

^ I recommend we add a new field of the right type rather than changing the nonce's type and setting it there, that lets us touch less code.


Creating a block:
https://github.com/Nameshar/Divsshares/blob/master/src/main.cpp#L3992

In the non-PoS case "mining" is just waiting until a new signature has been approved, we should let it try to mine so it builds up a valid block in the process

The interface for creating a master-signed block might be the longest part of this step. How about an rpc call which asks for the key, which will immediately publish whatever block the client is "mining" at that moment?
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline toast

  • Hero Member
  • *****
  • Posts: 4001
    • View Profile
  • BitShares: nikolai
Do not use this post as information for making any important decisions. The only agreements I ever make are informal and non-binding. Take the same precautions as when dealing with a compromised account, scammer, sockpuppet, etc.

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline bytemaster

I am increasing the bounty on this to 1500 PTS. 
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline bytemaster

Quote
Tell me more about the Signature PoW that you want.

Every block is signed by one person.  Difficulty of producing blocks is infinite for everyone but the person with the private key.

Replace the nonce with a ECC signature and the POW validation to make sure it was signed by one or more trusted keys.
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline AdamBLevine

  • Sr. Member
  • ****
  • Posts: 492
    • View Profile
    • Let's Talk Bitcoin!
I'm very interested in the results of this bounty.  I'm creating a proprietary coin where the proof-of-work is non-computational, this would make a great transactional layer.

Email me at adam@letstalkbitcoin.com

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
return ((nBalance/HashCash) * 100);

should suffice, I am now looking at getting the total supply from main.h

so since there is no recursion i have just added an include main.h

then int64 HashCash = nMoneySupply
« Last Edit: January 02, 2014, 11:38:14 pm by barwizi »
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
In order to appease both sides, why not display both the actual money supply and the number of coins?
I am having difficulty wrapping my head around buying something for X%.

You will not have to think in terms of X% you will just see X BTS... from the user's perspective it is just a number.  The only place shares matter is under the hood, but that is an implementation detail.

so balance is (walletbts/totalbts ) * 100. and the user just sees this, number? That is doable.

I'll think more into cleanly writting that in c++.

Tell me more about the Signature PoW that you want.
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline bytemaster

Added one little detail:

8) Unspent outputs after 1 year expire and thus can be pruned because they cannot be spent, this forces people to spend their money once per year (Proof of Stake, and keeps the blockchain size to a maximum size).

Ok, would that be a literal year or coin year?

I think that would be a literal year based upon timestamp in the block header.  With this chain there is no fixed number of blocks so you cannot estimate time by number of blocks.   
For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
Code: [Select]
int64 GetAccountBalance(CWalletDB& walletdb, const string& strAccount, int nMinDepth)
{
    int64 nBalance = 0;

    // Tally wallet transactions
    for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
    {
        const CWalletTx& wtx = (*it).second;
        if (!wtx.IsFinal())
            continue;

        int64 nGenerated, nReceived, nSent, nFee;
        wtx.GetAccountAmounts(strAccount, nGenerated, nReceived, nSent, nFee);

        if (nReceived != 0 && wtx.GetDepthInMainChain() >= nMinDepth)
            nBalance += nReceived;
        nBalance += nGenerated - nSent - nFee;
    }

    // Tally internal accounting entries
    nBalance += walletdb.GetAccountCreditDebit(strAccount);

    return nBalance;
}

int64 GetAccountBalance(const string& strAccount, int nMinDepth)
{
    CWalletDB walletdb(pwalletMain->strWalletFile);
    return GetAccountBalance(walletdb, strAccount, nMinDepth);
}


Value getbalance(const Array& params, bool fHelp)
{
    if (fHelp || params.size() > 2)
        throw runtime_error(
            "getbalance [account] [minconf=1]\n"
            "If [account] is not specified, returns the server's total available balance.\n"
            "If [account] is specified, returns the balance in the account.");

    if (params.size() == 0)
        return  ValueFromAmount(pwalletMain->GetBalance());

    int nMinDepth = 1;
    if (params.size() > 1)
        nMinDepth = params[1].get_int();

    if (params[0].get_str() == "*") {
        // Calculate total balance a different way from GetBalance()
        // (GetBalance() sums up all unspent TxOuts)
        // getbalance and getbalance '*' should always return the same number.
        int64 nBalance = 0;
        for (map<uint256, CWalletTx>::iterator it = pwalletMain->mapWallet.begin(); it != pwalletMain->mapWallet.end(); ++it)
        {
            const CWalletTx& wtx = (*it).second;
            if (!wtx.IsFinal())
                continue;

            int64 allGeneratedImmature, allGeneratedMature, allFee;
            allGeneratedImmature = allGeneratedMature = allFee = 0;

            string strSentAccount;
            list<pair<CTxDestination, int64> > listReceived;
            list<pair<CTxDestination, int64> > listSent;
            wtx.GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);
            if (wtx.GetDepthInMainChain() >= nMinDepth)
            {
                BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listReceived)
                    nBalance += r.second;
            }
            BOOST_FOREACH(const PAIRTYPE(CTxDestination,int64)& r, listSent)
                nBalance -= r.second;
            nBalance -= allFee;
            nBalance += allGeneratedMature;
        }
        return  ValueFromAmount(nBalance);
    }

    string strAccount = AccountFromValue(params[0]);

    int64 nBalance = GetAccountBalance(strAccount, nMinDepth);

    return ValueFromAmount(nBalance);
}

rpcwallet.cpp

I believe this is where we meddle with for the balance
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline barwizi

  • Hero Member
  • *****
  • Posts: 764
  • Noirbits, NoirShares, NoirEx.....lol, noir anyone?
    • View Profile
    • Noirbitstalk.org
Added one little detail:

8) Unspent outputs after 1 year expire and thus can be pruned because they cannot be spent, this forces people to spend their money once per year (Proof of Stake, and keeps the blockchain size to a maximum size).

Ok, would that be a literal year or coin year?
--Bar--  PiNEJGUv4AZVZkLuF6hV4xwbYTRp5etWWJ

The magical land of crypto, no freebies people.

Offline bytemaster

Added one little detail:

8) Unspent outputs after 1 year expire and thus can be pruned because they cannot be spent, this forces people to spend their money once per year (Proof of Stake, and keeps the blockchain size to a maximum size).

For the latest updates checkout my blog: http://bytemaster.bitshares.org
Anything said on these forums does not constitute an intent to create a legal obligation or contract between myself and anyone else.   These are merely my opinions and I reserve the right to change them at any time.