Decentralizing Hive dApps: HBD Potato

Decentralizing Hive dApps
HBD Potato


This is the first (and hopefully not last) part of my new series Decentralizing Hive dApps. I will try to find solutions (and also implement them) for some centralized Hive projects and dApps (mostly where community funds could be at risk).


Today, we will take a look at HBD Potato (@hbdpotato). It's a project dedicated to keeping HBD pegged to 1 USD.

To achieve this, it's selling HBD on the internal market, converting it to HIVE, and repeating this circle until the HBD peg is achieved. Funds required for this operation were raised by daily posts and from the DAO proposal, so they belong to the community (keep this in mind, we will get back to this later).

slika.png

Photo from @themarkymark's post

HBD Potato (called SBD Potato back then) started back in November 2019 on Steem and it has a nice chunk of HIVE (and STEEM), around 300k STEEM and 200k HIVE.

You might be curious now, what does this have to do with decentralization? Well, let's take a look at how is @sbdpotato doing its job back on Steem.

slika.png

Strange, it's not converting funds or trading on the internal market (that's normal since SBD is above $1). But instead, it's funds are powered up and delegated using a dLease.io marketplace.

Most of you know dLease.io is a for-profit project. It's charging a 10% fee! And who is operating it?

@thecryptodrive, the same person running HBD /SBD Potato project.

As custodian of this project I, @thecryptodrive, will not derive any monetary value therefrom and undertake this under my duty as Steem consensus witness and ambassador.
source

It seems to me that making 10% from any lease is definitely deriving monetary value. Just because Steem is centralized shit, the rules of SBD potato are no different. It's still a community project and funds shouldn't be used for any private gain.

I think it's clear funds are not used as they should be.

How can we prevent something like this from happening on Hive?

The core cause of something like this is centralization. If multiple community members would have to approve transactions, such misuse of funds would be much harder to achieve.

Well, Hive has one feature I'm fascinated (& obsessed) with: Multisignature

It's possible to set up an account that can only transact if the transaction is signed by multiple keys. This is also the core idea behind Wrapped Hive 2.0.

But HBD Potato is transacting a lot, no one wants to be manually signing transactions. Well, we can just create an app that will do this for us.

On this Christmas eve, I spent a few hours writing a validator and then modifying @hbdpotato's existing code to be compatible with validators.

How does it work? Every time the main app is trying to trade/convert coins, it will have to request signatures from different "validators". It's a much simpler system than Wrapped Hive, since adding validators is still manual. Validators will check only 2 conditions:

  • Is operation one of the following: convert, limit_order_cancel, limit_order_create, limit_order_create2?
  • Does the transaction include only 1 operation?

If both conditions are true, it will sign a transaction and return the signature to the main app, where it's then broadcasted to Hive blockchain.

Validator: https://github.com/fbslo/hbdpotato-validator
Fork of main app: https://github.com/fbslo/hbdpotato
Pull request: https://github.com/stoodkev/hbdpotato/pull/5

I also did some testing with 3 validators and it's working like a charm: https://hiveblocks.com/tx/78c108104eb285fa7993aeefff5466307f575f25

My account @whive.testnet-1 also has declined owner authority, so there is no way for it to transact without the approval of 2/3 of its multisig authorities.

Even just one or two validators would increase the security of a such project a lot. I'm already running validator at https://hbdpotato.fbslo.net (with @fbslo-b account)


My goal is to prove that decentralization does not have to be that hard & complicated (and to show how can problems be solved), not attacking the operator of HBD potato or any of his projects.

@fbslo

If you like my work, please support me by voting for my Hive Witness!
Witness announcement


H2
H3
H4
3 columns
2 columns
1 column
20 Comments
Ecency