Bitcoin Forum
December 06, 2016, 10:30:28 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Implementing demurrage: how many functions to change?  (Read 1479 times)
jtimon
Legendary
*
Offline Offline

Activity: 1246


View Profile WWW
August 08, 2011, 07:22:19 PM
 #1

Hi, I've been reading the bitcoin code lately looking for the functions that have to be modified to implement demurrage.
With demurrage, when the client wants to know the balance of an address, it has to take into account how many blocks ago was each transaction made.
The only change that is needed is there, how to interpret the balance of accounts.
I think I only have to change three methods for that:

CWalletTx::GetAvailableCredit()
CWalletTx::GetAccountAmounts(strAccount, nGenerated, nReceived, nSent, nFee);
CWalletTx::GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);

Am I right?

EDIT: new forum at http://www.freicoin.org/

2 different forms of free-money: Freicoin (free of basic interest because it's perishable), Mutual credit (no interest because it's abundant)
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
1481020228
Hero Member
*
Offline Offline

Posts: 1481020228

View Profile Personal Message (Offline)

Ignore
1481020228
Reply with quote  #2

1481020228
Report to moderator
kokjo
Legendary
*
Offline Offline

Activity: 1050

You are WRONG!


View Profile
August 08, 2011, 07:28:02 PM
 #2

Hi, I've been reading the bitcoin code lately looking for the functions to modify to implement demurrage.
With demurrage, when the client wants to know the balance of an address, it has to take into account how many blocks ago.
The only change that is needed is there, how to interpret the balance of accounts.
I think I only have to change three methods for that:

CWalletTx::GetAvailableCredit()
CWalletTx::GetAccountAmounts(strAccount, nGenerated, nReceived, nSent, nFee);
CWalletTx::GetAmounts(allGeneratedImmature, allGeneratedMature, listReceived, listSent, allFee, strSentAccount);

Am I right?

isent demurrage just making the value smaller?
then you could just continue giving a block reward of 50.

it *should* do it.

"The whole problem with the world is that fools and fanatics are always so certain of themselves and wiser people so full of doubts." -Bertrand Russell
jtimon
Legendary
*
Offline Offline

Activity: 1246


View Profile WWW
August 08, 2011, 07:59:01 PM
 #3

isent demurrage just making the value smaller?
then you could just continue giving a block reward of 50.

it *should* do it.

I think you're talking about timecoin (constant generation). Some people claim that expocoin (exponential monetary base growth) would have the same economics effects, but I think the effect on interest is different. Expocoin would rise nominal rates by adding an inflation premium but would keep real interest untouched. On the other hand, frecoin (constant monetary base through constant generation and demurrage) would lower real interest.

So I think I need to reduce the nominal value of "accounts" proportionally each block. This also puts lost wallets "back into circulation".
I just need to change the way balance for each address is interpreted like this:

amount - (demurrage_rate ^ (current_block_number - tx_block_number))

2 different forms of free-money: Freicoin (free of basic interest because it's perishable), Mutual credit (no interest because it's abundant)
cunicula
Hero Member
*****
Offline Offline

Activity: 756


Stack-overflow Guru


View Profile WWW
November 11, 2012, 01:24:36 PM
 #4

Jtmon, I had an idea for a demurrage-based reward system and would like to hear your thoughts.

The core principles are as follows:
a) Demurrage is charged as a mandatory txn fee based on coin-age (basically it is like your coins are constantly earning negative interest)
b) There is a mixed PoW and PoS system. Miners and stakeholders are paid via demurrage.
c) The money supply is constant (neglecting losses).
d) PoW cannot be used to mine secretly [either effectively or at all depending on implementation parameters]. This prevents double-spends which are based on secret mining.

There are other details, but the following is enough for now. The mining process is as follows:
1) Tentative PoW block is mined. Hash of work submission determines random lottery draw.
2) Random lottery draw determines stakeholder. Winning probability is proportional to stake holdings. [there are modifications of this to harden further against PoW attacks]
3) Tentative PoW block is broadcast. Winning stakeholder is invited to sign block.
Note: Rewards from come from demurrage charged on txns in block. They are divided between PoW miner and stakeholder. This can be a special txn in the block.
The stakeholders coins are refreshed in the process of signing a block. Meaning that his demurrage is reset to zero. This together with txn fee earnings provides the stakeholders participation incentive.
4) If block gets signed, then it enters the main chain upon signing. Otherwise block is orphaned and we return to step 1.
5) Once the block is signed, the chain can be extended via step 1.
6) There is also space after each block for an optional stake signature. This stake signature can be provided any time between when a block is mined and 6 blocks afterwards. This signature is not directly rewarded. However, these optional stake signatures serve as heartbeats. Keys that fail to provide heartbeats forfeit their right to participate in the lottery draw until they move their coins to a new public key. Such inactive keys cannot avoid demurrage penalties. Accordingly you want to provide a heartbeat if possible.

Notes:
a) If stakeholders leave their clients up and ready to sign blocks, they avoid demurrage charges and may earn some profit via txn-fees.
b) Mining a secret sequence of blocks is almost impossible. You would need to select yourself as the lottery winner. For example, if you have 1% of active mining coins then you have to provide 100 times as much work to generate a block as a public miner. This ratio can be increased arbitrarily via modification to step 2. Just ask for a sequence of random signatures instead of just 1. e.g. If you ask for 5 sigs, than the secret work requirement will be 10 billion times the public work requirement.
c) People who are not actively signing blocks face demurrage.
d) Security here is primarily provided by forcing miners to broadcast blocks. People who aren't present to sign are weakening security. Thus the rationale for charging them demurrage.
e) Since signers are given some fees, the incentive to provide signatures increases if other people are keeping their clients offline.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
        AltCoinInternalExperts                Get Your Altcoin Promoted On Social Media       
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
maaku
Legendary
*
Offline Offline

Activity: 905


View Profile
November 11, 2012, 07:29:36 PM
 #5

Maybe I'm being thick-headed and just not getting it, but could you explain what problem(s) that solves? It's hard to have an opinion without some context.


PS: If anyone came to this resurrected thread based on the title, we've since gotten demurrage fully implemented and worked out the various best practices for handling accounting with a rotting money supply. Code is on github here. Discussion about Freicoin is happening on its forums and the #freicoin IRC channel (freenode).

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
cunicula
Hero Member
*****
Offline Offline

Activity: 756


Stack-overflow Guru


View Profile WWW
November 12, 2012, 01:25:45 AM
 #6

Maybe I'm being thick-headed and just not getting it, but could you explain what problem(s) that solves? It's hard to have an opinion without some context.


PS: If anyone came to this resurrected thread based on the title, we've since gotten demurrage fully implemented and worked out the various best practices for handling accounting with a rotting money supply. Code is on github here. Discussion about Freicoin is happening on its forums and the #freicoin IRC channel (freenode).

What problem are you looking for?

One problem is double-spend attacks using 51% of hashing power. Impossible with the above system. Moreover threshold can be made arbitrarily strong. e.g. double spend attacks with 99.999% of hashing power can easily be made impossible.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
        AltCoinInternalExperts                Get Your Altcoin Promoted On Social Media       
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
maaku
Legendary
*
Offline Offline

Activity: 905


View Profile
November 12, 2012, 03:56:50 AM
 #7

My immediate concern is that it undoes demurrage for participating actors, thereby eliminating the positive economic effects which come from universal demurrage, making me wonder what the purpose would be at all.

What you devised seems to be a mechanism for punishing people who don't participate in proof-of-stake. If that's your goal it's fine (although I don't agree with it), but the consequences are antithetical to what we're trying to do with demurrage and Freicoin specifically.

By the way, that's not to say that there aren't interesting consequences from integrating proof-of-stake with demurrage currency. As I've talked about on the Freicoin forums, it could lead to a sort of decentralized republican (small-r) parliamentary government:

http://www.freicoin.org/demurrage-should-it-all-go-to-miners-t20.html

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
cunicula
Hero Member
*****
Offline Offline

Activity: 756


Stack-overflow Guru


View Profile WWW
November 12, 2012, 09:19:31 AM
 #8

My immediate concern is that it undoes demurrage for participating actors, thereby eliminating the positive economic effects which come from universal demurrage, making me wonder what the purpose would be at all.

What you devised seems to be a mechanism for punishing people who don't participate in proof-of-stake. If that's your goal it's fine (although I don't agree with it), but the consequences are antithetical to what we're trying to do with demurrage and Freicoin specifically.


As I see it everyone is subject to demurrage. People are paid for participating by having their demurrage forgiven. That is, this is money for services rendered, not money for doing nothing.

Anyways, good luck with Freicoin then.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
        AltCoinInternalExperts                Get Your Altcoin Promoted On Social Media       
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Rudd-O
Jr. Member
*
Offline Offline

Activity: 56



View Profile WWW
November 12, 2012, 09:25:21 AM
 #9

Try as I might... I still don't understand why anyone would voluntarily choose a currency with built-in savings devaluation over a currency that does not exhibit this trait.

1FPwsMACGqCFtAxpMVHznHe7TkrHMRxB6M GPG key.  Only civil and rational replies accepted.  If you can't follow this flowchart or engage in verbal abuse, I'll point it out and add you to my ignore list.
grau
Hero Member
*****
Offline Offline

Activity: 836


bits of proof


View Profile WWW
November 12, 2012, 02:57:02 PM
 #10

regarding demurrage: miner could impose floor to transaction fee based on coin age. No code change needed for that just, their majority will to do so.
cunicula
Hero Member
*****
Offline Offline

Activity: 756


Stack-overflow Guru


View Profile WWW
November 12, 2012, 03:18:05 PM
 #11

regarding demurrage: miner could impose floor to transaction fee based on coin age. No code change needed for that just, their majority will to do so.

You could do this, but it is hard to get 51% to join a cartel. The idea of rejecting blocks from independent-minded miners would be very controversial.
You may see something like this in the future, however. As mining gets more centralized, it will be easier to form cartels. The decrease in block reward will also make cartels more profitable.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
        AltCoinInternalExperts                Get Your Altcoin Promoted On Social Media       
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
grau
Hero Member
*****
Offline Offline

Activity: 836


bits of proof


View Profile WWW
November 13, 2012, 04:39:21 PM
 #12

regarding demurrage: miner could impose floor to transaction fee based on coin age. No code change needed for that just, their majority will to do so.

You could do this, but it is hard to get 51% to join a cartel.

That applies to using a vhanged code too.
cunicula
Hero Member
*****
Offline Offline

Activity: 756


Stack-overflow Guru


View Profile WWW
November 13, 2012, 05:39:47 PM
 #13

regarding demurrage: miner could impose floor to transaction fee based on coin age. No code change needed for that just, their majority will to do so.

You could do this, but it is hard to get 51% to join a cartel.

That applies to using a vhanged code too.
How is that? Changed code allows an arbitrarily small minority to vote with their feet.

Mining power requires majority consensus AND the will to impose that consensus on any deviant minority.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁
        AltCoinInternalExperts                Get Your Altcoin Promoted On Social Media       
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!