RFC 57: Safecoin Revised

Or just penny where 10^6 (or similar) of them is a safecoin perhaps?

6 Likes

Maybe we could hold a competition (no prizes :dizzy_face:though) for a name that people think it should be.

I dunno penny seems too overloaded now-a-days and we did away with them in 66 over here.

9 Likes

Technical points aside, I think we should reflect as a community on how our passion can be received. We see it in this topic IMO and in others, when people tread on our toes or bump up against views we hold strongly.

I love that we have that passion, and Iā€™m prone to doing exactly what Iā€™m cautioning about here. I could easily have been at the centre or caught up in it too, and I have done so many times on this forum when I spent more time in discussions. I think itā€™s generally OK, but when itā€™s lots of us against one, I get concerned, particularly when itā€™s someone who we all know is very committed to the same vision and working hard to implement it.

Personally, if I was getting told one of my SAFE Drive coding decisions was rubbish and must be changed - I would feel hurt and demoralised - regardless of the technical validity (and for goodess sake donā€™t look, much of my code is not pretty).

I realise this is much more important than anything in SAFE Drive - but that would not change my experience.

One of the things David, Nick, Viv and all at Maidsafe have helped me with, by their example is taking that passion and directing it. I want to comment on this because I know one reason I can let that impact on others without realising it, is because if Iā€™m on the receiving end it hurts. And Iā€™m concerned that may happen here.

I donā€™t know Fraser, but I know most humans are sensitive to this stuff - including some who who donā€™t realise it (points to past self). I donā€™t think it matters if Fraser is completely fine with this, which he may be (and good for him if so), but I donā€™t think we knew that he would be.

Maybe Iā€™m being over sensitive here. I can accept that, but it wonā€™t do any harm to reflect on the possibility Iā€™m not. :heart:

16 Likes

I bought them up only in the context of ā€œcore-based handling of sub-coin units when values are represented as a single u64ā€ to argue itā€™s a bad idea because the only meaningful non-u64 number that we could hand over to the core is the f64 and that doesnā€™t have the necessary precision.

3 Likes

Even a dollar cent coin is called a ā€œpennyā€ so I feel it is not as much overloaded as it is a well-established generic name for ā€œsmallest indivisible unit.ā€

3 Likes

I know Iā€™m definitely one whoā€™s personally at fault here and I do apologize. I came back from a funeral on Thursday and my filters were way off for the rest of the day. Not cool.

8 Likes

No worries, we all know each other enough at least to debate. Everyone, me included are allowed to react like humans and not robots. Anyhow, I know @anon86652309 pretty well, he is hard to shake, so I doubt he was shaken :wink: Anyhoo, all cool,

12 Likes

There was a thread with a poll about this before:

8 Likes

I only looked briefly at the RFC, but this looks interesting: ā€œAs in RFC 0051, this proposal is that safecoin doesnā€™t exist as units of data representing individual coins (or parts of coins), but rather only balances of safecoin exist on the network.ā€

It seems to mean that Safecoin transactions are done directly with those balances, and therefore will be very efficient regardless of the amount in the transactions.

7 Likes

Well, we did have a topic devoted to this question: What is your favorite name for a SafeCoin analogy to BTCā€™s Satoshi? (reboot) divs = irvines, troons, and ayrs?

Perhaps, we start there? :slight_smile:

Just noticed @drehb noted this too

7 Likes

I always liked the name ā€œTroonsā€ in regard of tiny parts. Send me some Troons! :joy:

4 Likes

Aye, gimme some Ayrs.

2 Likes

My remarks on this RFC:

  • Each CoinBalance has an associated queue named credits, but it isnā€™t stored in struct CoinBalance. So, where is it stored?

  • credits is a queue but no POP operations are described in the RFC. The Drawbacks section suggests that there is a size limit, but its value isnā€™t mentioned anywhere.

  • Relocating chunks seems risky because a fundamental invariant is not maintained anymore: the 8 nodes nearest to its address store a chunk (8 or whatever duplication factor is). I propose that elders kill a node that cannot a store a chunk, at least in a first version and improve it later.

  • Also remove the concept of good node and, instead, find a way to truly measure the space dedicated by a vault. There was a very good topic created by @mav on the subject (Proof Of Storage prototype).

4 Likes

Thanks for the concern folks, but no need to worry/apologise :slight_smile: Iā€™m as frustrated at my own obvious inability to make myself clear as I am at anyone in this thread!

Iā€™m not refusing the feedback, Iā€™m disagreeing with it. Possibly because Iā€™m not understanding it, or Iā€™m not being understood. @neo made a point in response to the previous safecoin RFC about the fractional part representing a decimal fraction rather than my proposed binary fraction, and I understood and agreed with his point pretty readily.

What concerns me here (and this is how I deal with code reviews too, both as reviewer and as author) is that I donā€™t understand where the breakdown in understanding is. What Iā€™m proposing seems to me to be ticking all the requested points by @neo and others in terms of safety and historical lessons learned. Iā€™m not going to just roll over and agree to something because lots of people are in agreement if I think it doesnā€™t make sense.

On that noteā€¦ I rewrote the example code getting rid of the two u32s in favour of a single u64. In my opinion, itā€™s slightly inferior to the previous version in terms of clarity, but as promised, the libraryā€™s API has remained the same (wellā€¦ almost).

One change I made was to rename the types as plurals, since Iā€™m wondering if that could be the root cause of the resistance to my proposed example? Some notion that these types arenā€™t all roughly equivalent ways of expressing an amount of safecoin up to approximately the limit of 2^32 safecoin?

Another thought I had was that there might be a notion that the two inner u32 fields would be directly exposed. They wonā€™t.

Just to be clear, with my proposed API, it will be exactly as safe to get the sum of two NanoCoins as it will be to get the sum of two Coins with the same respective values - thereā€™s absolutely no loss of information/rounding errors/floating point calculations happening under the hood when using the Coins.

What Iā€™m proposing is also integer maths, just abstracted in some cases via the Coins struct.

Your links are interesting though - thanks for posting them! It led me to this article which states:

Why do we care about floating point values if we have integers? Because many higher-level programming languages (eg. Javascript) do not expose the low-level ā€œfloating pointā€ and ā€œinteger representationsā€, instead providing the programmer with only the concept of ā€œnumberā€ - represented in floating point form, of course. If Satoshi had chosen 210 million instead of 21 million, Bitcoin programming in many languages would be considerably harder than it is today.

If we want to follow Bitcoinā€™s lead, we could use 52 bits to represent safecoins including their fractional parts, and that quote in @mavā€™s post indicates that gives enough divisibility. Their points seems fairly convincing - I find them more convincing than the arguments to not use 250 pico-safecoin as the base units under the hood.

So that could be presented as something like 4,294,967,295 safecoins as the limit (as per original proposal) with divisibility up to single micro-safecoin (10^-6, i.e. 0.000001) and that would fit in a 52 bit integer. Similar to Bitcoin, but not identical. ~4.3 billion coins vs 21 million and divisibility down to a mico-coin vs a hundredth of a micro-coin.

Or, if the marketing folks think itā€™s viable and the majority on here prefer, rather than having safecoins being divisible at all, just change the limit of safecoin from 4,294,967,295 to 4,294,967,295,000,000.

14 Likes

I was thinking just as an in-memory queue by the vaults managing that CoinBalance.

All I had in mind was that as a new transaction is added, if the size of the queue is above the limit, we pop the oldest. The size limit isnā€™t mentioned because I just donā€™t know what a reasonable value would be right now.

Also, Iā€™d hope that this whole mechanism of holding size-limited queues could be replaced by messaging from vaults to clients eventually. I see this as a stop-gap solution until then and would be happy if we could find a better way to let paying and receiving clients know that a given transaction succeeded without a need for them to be connected for the duration of the transaction.

These are both thorny issues, and I do feel theyā€™re worth discussing further. I know theyā€™re both mentioned in the RFC, but I wonder if the actual rationale behind them should be discussed in separate threads? Just to try and keep this one focussed on the actual safecoin details?

4 Likes

I think this would not be an option as it would effectively mean a dilution for existing coin holders.

As others here Iā€™m also in favor of introducing a sub unit compared to ā€œSatoshisā€ and just store this amount. Wallets then of course can give users then the choice in which units they want to operate in the frontend.

5 Likes

I meant without the dilution though. So, 1 maidsafecoin would be equivalent to 1,000,000 safecoins.

6 Likes

For folk who are interested in a broader treatment of the issues around programming money, not just representation, this article just popped up in my twitter aboutā€¦ wait for it : safe-money (a Haskell library)!

Although it is about a Haskell library, it covers all the issues I can imagine to do with how you might write a program to do stuff with money and explains the different techniques, when and why to use them.

https://ren.zone/articles/safe-money

6 Likes

I donā€™t quite understand what the problem is. MaidSafe can say:

The total market cap is 4,294,967,295 safecoins (as we already stated years ago) and each can be divided down to a million ā€œpenniesā€, as we call them.

By the way, as a side note for the devs in the audience, as you may have already guessed, the network works with pennies expressed as 64-bit integers under the hood so thereā€™s no need to worry about rounding errors.

Itā€™s all a question of definition. Just because we stored safecoins as pennies in a single u64, they would not become any less ā€œsafecoinyā€ than if we stored them as two u32s, one for the whole coins and one for the decimals.

8 Likes

There is a better way - you give the smallest unit a different name (nano-safecoin) and you call 1,000,000 of them 1 safecoin.

The same as representing Ā£1 as 100 (penny) units.

18 Likes