Devcoin

From Bitcoin
Jump to: navigation, search

Note: the latest version of this document is at:
https://raw.github.com/Unthinkingbit/charity/master/devcoindescription.html

Introduction

Devcoin is the coin where 90% of the generation goes to open source developers and 10% to the miners.

The biggest categories of developers are programmers and hardware developers, writers, musicians, painters and graphic artists, and filmmakers.

In each category, devcoins would go to the developers for ongoing development, and if applicable for that category, bounties.

Administrators get 10% of the generation to induct new developers, to maintain the list of receivers, and to release bounties. The administrators are drawn from the developers.


Purpose

The purpose of the devcoin is to give money to open source developers for their work in as fair a manner as possible.

Many open source developers do not get a significant amount of money for their work. Advertising, charity and sometimes consulting provide some income, but many developers, even those with projects used by several thousand people, only get a few dollars a month. In a typical economy, in the ballpark of 1% goes to charity. That is not enough to support people.

Because developers get so little, they can only develop their projects in their spare time, which makes development really slow. Feature requests and critiques do not accelerate development, money will.

Devcoins provide an income for everyone who wants to work, even if they live in an area with more job seekers than jobs. With devcoin, no one who wants to work need be completely out of money. Anyone who does good work will get some devcoins. There is no guarantee that this will be a high income, but something is way better than nothing.

By buying devcoins you help developers and give the world more open source software, books, music, art, and movies.


Categories

Licenses for programming and hardware which qualify for devcoins are the AGPL, Apache, BSD, GPL, LGPL, MIT, public domain, and unlicense. Licenses for writers, musicians, painters and graphic artists, and filmmakers which qualify for devcoins are the Creative Commons Share Alike (wikipedia license), Creative Commons Attribution, public domain, and unlicense.

Programmers and hardware developers includes, but is not limited to, people who develop open source software, websites, machinery, circuits, vehicles, housing, games, medicine, and transportation, energy and resource extraction systems.

Writers includes people who write books, articles, fiction, poetry, and documentation. Fan fiction only qualifies if the source license also qualifies for devcoins.

The musicians category includes people who perform music and people who create or record unique sounds.

The painters and graphic artists category does not currently include photographers because photography can be done mechanically with little or no creative work.

The filmmakers category includes people who make movies, shorts, and animation. Fan films only qualify if the source license also qualifies for devcoins.


Bounties

The initial bounties are for making a web site where all devcoin qualifying writing could be uploaded. The web site would have limited advertising (only text ads or a single non animated banner ad), which would support the site, any remaining income would be distributed among the writers. The next bounty is for an open source devcoin block explorer.

The medium term bounties are for a forum site which requires bitcoins / devcoins to join and post, the money would support the site, any remaining income would be distributed according to the wishes of the posters. A web email which requires coins to join and post, the money would support the site, any remaining income would be distributed to charity. Software upgrades to the mainline client to make it more difficult to double spend. Software changes to the mainline client to make it easier to make alternative clients. Expansion of the devcoin writer web site to also host music, art and movies.

In the long term, bounties for improvements of open source software in general. Bounties for open source machinery, circuits, vehicles, housing, games and medicine. Bounties for open source villages and other types of communities. Bounties for open source transportation, energy and resource extraction systems. The ultimate purpose of the bounties is to fund all kinds of open source development, so that people could choose to live in an open source community where everything therein could be developed or built by anyone.


Active Developer

If you actively develop open source of any kind, you can apply to get a share of devcoin generation by posting in an induction thread, like: https://forum.bitcoin.org/index.php?topic=18498

Your candidacy would then be voted on, usually within a week. Depending on the vote you would either be inducted or you could try again after a certain time.


Voting

Voting for will be range voting on a scale of 0 to 99:
<a href="http://rangevoting.org/">http://rangevoting.org/</a>
<a href="http://rangevoting.org/Why99.html">http://rangevoting.org/Why99.html</a>

For induction, three administrators will be chosen at random. They will range vote to decide whether the candidate will be inducted. If the candidate gets 50% or more (49.5 on the 0 to 99 scale), they're. In they get 33% or more (33 on the 0 to 99 scale), they can try again in a month. If they get less than 33%, they can try again in 3 months.

Other issues will be decided in a similar fashion. If the issue is particular to a single developer, bounty or prize, three administrators are chosen at random to vote. If the issue affects the community, every active developer can vote.


Administration

Any active developer can choose to be an adminstrator at any time, and leave at any time. They are paid for the time they administrate.

An administrator has to maintain at least one copy of the receiver list. They have to be available within four days notice for voting. They have to choose at least one category to vote on inductees.

The administrators get 10% of the devcoins as payment for their work and for being available for voting.


Technical

Devcoin is an alternate bitcoin block chain. The devcoin client is a fork of bitcoin-qt. The generation is constant at 50,000 coins per block, which is 1,000 times higher than the bitcoin starting rate. At a typical rate of 144 blocks a day, 1,008 a week, roughly 4,000 a month, that means the 200,000,000 devcoins are generated each month. Of those, 90% go to the developers, so the developers get 180,000,000 devcoins a month in total.

The sending code in CreateBlock looks like the following:

	vector<string> coinAddressStrings = getCoinAddressStrings(GetDataDir(), string("receiver.csv"), (int)pindexPrev->nHeight+1);
    txNew.vout.resize(coinAddressStrings.size() + 1);
    txNew.vout[0].scriptPubKey << reservekey.GetReservedKey() << OP_CHECKSIG;
    int64 minerValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
	int64 sharePerAddress = 0;
	if (coinAddressStrings.size() == 0)
		minerValue -= fallbackReduction;
	else
		sharePerAddress = share / (int64)coinAddressStrings.size();
    for (int i=0; i<coinAddressStrings.size(); i++)
    {
        // Create transaction
        uint160 hash160 = 0;
        if(!AddressToHash160(coinAddressStrings[i], hash160))
        {
            return NULL;
        }

        txNew.vout[i + 1].scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
        txNew.vout[i + 1].nValue = sharePerAddress;
        minerValue -= sharePerAddress
    }
..
//    pblock->vtx[0].vout[0].nValue = GetBlockValue(pindexPrev->nHeight+1, nFees);
    txNew.vout[0].nValue = minerValue + nFees;

The validation code in ConnectBlock needs the addition of:

	//
	// Check that the required share was sent to each beneficiary
	//
	if (vtx[0].GetValueOut() > (GetBlockValue(pindex->nHeight, nFees) - fallbackReduction))
	{
		std::vector<std::string> addressStrings;
		std::vector<int64> amounts;

		for (int i = 1; i < vtx[0].vout.size(); i++)
		{
			addressStrings.push_back(vtx[0].vout[i].scriptPubKey.GetBitcoinAddress());
			amounts.push_back(vtx[0].vout[i].nValue);
		}

		if (!getIsSufficientAmount(addressStrings, amounts, GetDataDir(), string("receiver.csv"), (int)pindex->nHeight, share))
			return error("ConnectBlock() : Share to beneficiary is insufficient");
	}


Receiver.h accesses a synchronized list of receivers:
https://raw.github.com/Unthinkingbit/charity/master/receiver.h

For example, say the devcoin client requests the height 9000 receivers, the height step is 4000 and only the root receiver_0.csv saved. Receiver.h will first look for the receiver_2.csv file. Since it's not there it will step down and look for receiver_1.csv. Still not there so it looks for and finds receiver_0.csv. It then downloads receiver_1.csv by looking at the peers in receiver_0.csv and saves in the data directory. It then downloads receiver_2.csv by looking at the peers in receiver_1.csv and saves in the data directory. Once it has receiver_2.csv, it parses it to get the list of receivers and uses height modulo list length to return the receivers for height 9000.

Receiver also looks ahead, after it is a random portion between 0.75 and roughly 0.95 of the way to the next step so that there is no mass downloading when the block height switches from x999 to x000. To resist ddos attacks and to work even when some web sites are down, it picks the page which the majority of peers have available. The step size of 4000 gives an update roughly each month.

The constants required for the subsidy are changed and constants for share, and fallback reduction are added.

static const int64 initialSubsidy = 50000 * COIN;
static const int64 share = initialSubsidy * 9 / 10;
static const int64 fallbackReduction = (initialSubsidy + share) / 2;

Code in GetBlockValue is changed:

//int64 nSubsidy = 50 * COIN;
int64 nSubsidy = initialSubsidy;


There has been talk about shifting the decimal place in bitcoin, because a maximum of 21,000,000 bitcoins would lead to people having to deal in milliBitcoins if bitcoin gets really popular. However, once a block chain is made, it is really difficult to change the value of the currency. So even though people will generally want to move the decimal place, it would be not be done and people would be stuck with an awkward currency unit. In the 'RFC: SI-type of naming convention for BTC' thread a lot of the problems people have dealing with a large currency unit are discussed.
http://forum.bitcoin.org/index.php?topic=9299.0

Since devcoin is a new currency, it is easy to multiply the coins by 1,000. The constants for the transaction fees and max money are changed:

//static const int64 MIN_TX_FEE = 50000;
static const int64 MIN_TX_FEE = 50000000;
//static const int64 MIN_RELAY_TX_FEE = 10000;
static const int64 MIN_RELAY_TX_FEE = 10000000;
//static const int64 MAX_MONEY = 21000000 * COIN;
static const int64 MAX_MONEY = 21000000000 * COIN;

and CENT was replaced by the MIN_TX_FEE wherever the min transaction fee was meant to be used.

The default data directory, irc channel and pchMessageStart was changed to devcoin. The default directory code in GetDefaultDataDir was changed to:

    // Windows: C:\Documents and Settings\username\Application Data\Devcoin
    // Mac: ~/Library/Application Support/Devcoin
    // Unix: ~/.devcoin
#ifdef __WXMSW__
    // Windows
    return MyGetSpecialFolderPath(CSIDL_APPDATA, true) + "\\Devcoin";
#else
    char* pszHome = getenv("HOME");
    if (pszHome == NULL || strlen(pszHome) == 0)
        pszHome = (char*)"/";
    string strHome = pszHome;
    if (strHome[strHome.size()-1] != '/')
        strHome += '/';
#ifdef __WXMAC_OSX__
    // Mac
    strHome += "Library/Application Support/";
    filesystem::create_directory(strHome.c_str());
    return strHome + "Devcoin";
#else
    // Unix
    return strHome + ".devcoin";

The send code in ThreadIRCSeed2 was changed to:

            Send(hSocket, "JOIN #devcoinTEST\r");
            Send(hSocket, "WHO #devcoinTEST\r");
        } else {
            // randomly join #bitcoin00-#bitcoin99
//            int channel_number = GetRandInt(100);
//            Send(hSocket, strprintf("JOIN #bitcoin%02d\r", channel_number).c_str());
//            Send(hSocket, strprintf("WHO #bitcoin%02d\r", channel_number).c_str());
            Send(hSocket, "JOIN #devcoin\r");
            Send(hSocket, "WHO #devcoin\r");

The pchMessageStart in LoadBlockIndex was changed to:

        pchMessageStart[0] = 'd';
        pchMessageStart[1] = 'e';
        pchMessageStart[2] = 'v';
        pchMessageStart[3] = '-';

The default port was changed to 52333 and the default test net port changed to 62333:

inline unsigned short GetDefaultPort() { return fTestNet ? 62333 : 52333; }


Random numbers for voting are determined by a hash of the string composed of the name of the person and the next block of the highest difficulty block chain, which at the time of this writing is bitcoin. For consecutive random numbers, the next number is the hash of the string doubled and so on. For example, say someone applies to be accepted as an active developer. When they post their application, the hash of their name and the next block after their post is combined to make a string. The hexadecimal hash of that string is used as a number from zero to one, multiplied by the number of administrators, to get the first administrator. The hexadecimal hash of the doubled string is multiplied by the number of remaining adminstrators, to get the second administrator. The hash of the tripled string is multiplied by the remaining, to get the third administrator.


Concerns

The primary concern is that in the long term, most organizations become corrupt, regardless of the intentions of the founders. The single best defense against the corruption of an organization is competition. Devcoin would be the first currency to give part of its generation to developers. However, developers are welcome to fork it in turn, and create say a reformcoin, that also gives generation to developers, but starts with another set of founders. If the reformcoin is less corrupt than devcoin, people will sell the devcoin and buy reformcoins. Even if most people remain with devcoin, just the possibility that people could move to reformcoin will tend to rein in the corruption of the devcoin. To increase the availability of competition, there will be bounties for software to easily make alternate currencies derived from devcoin, and bounties for easy to use range voting software. This would also make it easier for people to make other coins like town coins and project coins.

To further reduce corruption, all meetings and votes will be public, because sunshine is the best disinfectant. Everyone would be able to post on every thread; however since without a postage fee this would lead to enormous spam and trolling, a fee of up to 0.05$/post along with an entry fee of 5$ (which prepays for posts) is acceptable. Also, people could rate posters and those lists could be used by forum participants, or people looking at the forum records, to screen out trolls. Because the value of the $ varies, for this document a $ is defined as being 1 / 25,000 of the median of the median income of the top 20 countries ranked by median income with a population over one million.

Because miners get only 10% of the coins, the difficulty will be 10% that of a bitcoin type chain of equal value. So double spending attacks will be much easier. To protect against this, bounties will be offered for upgrades to the mainline client to make it more difficult to double spend.

For active developers, their receive key will a large portion of their devcoins, and if that key was lost or stolen they would suffer terribly. So the almoner software will be upgraded to handle a list of keys. There will also be bounties for software and hardware key generators.