Jump to content

[Developer-Bounty] Freicoin Blockexplorer 24 Freihours (120.000 Freicoins)


Recommended Posts

  • Replies 101
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

120.000 FRC bounty paid to 1EHMesZiLPqZvU2mVZGeYBaQvSPRUKA8yW Transaction ID:  fb8a98fc3db932f518034f305fb86043cbc62252af57a3d8755f678aa0815f62

UPDATE: Project is finished optional targets still available. here you can find the new Freiexplorer with demurrage display: much thx@Skaro http://freicoin.info/chain/Freicoin Bounty no

I'll update the code on fa github with the current code.  If all agree her to pay out the bounty I'll get a hold of molly. Also I will get the wallet over to you arc. First we need to approve to

Posted Images

That's important yes. 

The explorer is calculating the number how I understand demurrage works. That's why i would like to compare the result with wallets. Also, i have the code for the wallet that I have to look at very closely.

 

But Arcurus, can you explain to me how a wallet can withdraw the same amount of Freicoins it deposited 3000 blocks later? The balance should have reduced by demurrage, right?

Link to post
Share on other sites

Yeah, Arcurus, 

I thought the wallet destroys coins, as a function of block height, every time you open it, as it syncs with the network. That's what i thought I saw my wallet doing.

 

And I thought I read that the Exchange doesn't calculate demurrage. 

 

 

Link to post
Share on other sites

Well, the demurrage fee doesn't appear in the blockchain. 

The wallet may only update when there are transactions concerning the wallet. But I assumed it updates the balance to the new block height, before reconciling transactions. Also, it should be updated before any spending can be made. That appears to be something I have to verify. 

 

 

Link to post
Share on other sites

One factor to remember if you send from a wallet,  you hit send and enter amount. If you have maby 5 addresses there it will pick from them all to sum up what you want to transfer. Wallet is just a placeholder of addresses. 

Link to post
Share on other sites

There are few things to check.

My working theory is that the sum of the adresses balances should be correct and correspond to the wallet. The exchange has one big wallet with many adresses, but the individual accounts are not reduced by demurrage. The explorer is calculating demurrage per address.

 

Link to post
Share on other sites

When looking abit deeper, we are missing coins in a block. Address in questen, when examin the block, you see it somehow says the block is 74 coins (should be 96) and the fees in the the block is summed up so it becomes 96, so we are missing some coins, that is why we se negative balance :)

Link to post
Share on other sites

So it doesn't have anything to do with the exchange (sorry Fedde). The main problem causing the negative values is that the wallet gathers up inputs from previous transactions to make the payment (change is returned to an automatically generated change address). The chain uses the original deposit amounts associated with the inputs. The wallet, however, transfers the original transactions amounts reduced by demurrage (so its good to show 'amounts' already discounted because its what the wallet really has). So I had to go back to attach the original block height to discount the inputs from the beginning rather than the withdrawal date.

 

The discrepancy between the what ABE expected for change and the real change, Abe calculates as the Fee, which are the missing coins that Fedde mentioned.

The changes work on ABE on my laptop, and so you guys will have to wait for Fedde to make the changes.

 

There is still one small thing to be changed (I have other real life things to tend to for a while). We are referring to the block height that contains the transaction. The wallet uses the block height when the transaction is sent. The wallet also sends this reference height. I have to find it in ABE and make changes accordingly. But what we have now should be pretty close, since a transaction gets put in a block quite soon after its made.

 

 

Link to post
Share on other sites

Thanks, Arcurus.

Its doing what its supposed to now, but I think we are realizing its different from what we imagined.

It appears the wallet keeps track of all input transaction and discounts them for demurrage, which makes sense. So its nice to know the remaining value of each transaction in the wallet. After you spend it, however, the values should be frozen in history, but that would require IF statements etc in ABE which don't fit very well with the existing imbedded SQL statements. So the table for any address will constantly change with block height. While correct for balances, its silly when the balance is zero.

The negative value will also change continuously. While mathematically necessary, powerful and simple, it does look a little bizarre. But no rush. I plan to do a lot more playing with ABE this year.

Our original goal was to be able to correctly calculate Foundation coin balance and to correctly estimate circulating currency. So we have more than that.

Link to post
Share on other sites

Yes that's basically how you would calculate it. You have to check if that output has been spent, IF yes, calculate it differently. Its also done in a SELECT statement embedded in Python, which is a little advanced for my level, but I don't mind learning it. Then, finally, we would have to make two separate SELECT statements one to display  differently the 'amounts' the other to calculate the balance using the current method (but if two values cancel each other out maybe not). This may require changes to ABE's display. etc.

The circulating currency is an API. There was a small bug after the recent modifications (yes, I am literally an amateur). I've already corrected and uploaded it, but it may not be 'pushed' yet. 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...