Multi-Signature is Here

in #hive2 months ago

The Paradigm Shifts Today

What are the differences between centralized and decentralized exchanges? We know at the heart of a centralized exchange is a central account controlled by one party. This usually gives way to convenience and speed of transactions. A decentralized exchange is a comparatively finicky exchange built with smart contracts that can have high transaction fees and the possibility of transaction failures.

What if there was a way to merge the best of both into a Decentralized Exchange? Well this would be a bad post if I wasn't about to explain how that works on Hive and what it will allow us to do.

dlux is DeFi

DLUX is a decentralized layer 2 on Hive. What that means is several accounts run the same software to maintain the same database. Once a user told me his funds were missing, and sure enough his wallet said null. It turns out that every other node had his correct balance, and the consensus was that his tokens were there. The node automatically recovered from this condition after autonomously conferring with the other nodes and recovering the consensus database. In computing there will be errors if for no other reason than cosmic rays can flip bits. For this reason alone a centralized exchange has to run verification on it's own database.

By distributing this verification across multiple accounts we can also do something pretty clever. Control a central hive wallet with our nodes. Let me introduce @dlux-cc, the dlux community chest.
This account has been set up for testing our new multi-signature transactions.
Let's take a look at the aspects that make this account special:

active: {
    "account_auths":[
        ["disregardfiat",1],
        ["dlux-io",1],
        ["markegiles",1]
    ],
    "key_auths":[],
    "weight_threshold":2
}

Normally accounts on Hive have key_auths. They also normally have a weight_threshold of 1. This means that the single key can be used to make a single signature to authorize a transaction. But here, this account has a weight_threshold of 2, and account_auths. Which means it will take active signatures from 2 of the 3 listed accounts to authorize a transaction. These accounts currently run consensus nodes in the dlux layer 2, and part of establishing that consensus will be building transactions to complete exchanges.

They automatically consolidate multiple transactions to the same accounts, then sign the transactions. After which the transactions are stored with out signatures so they can be in consensus. Each node will send their signature of this transaction block along with their consensus report. As the nodes are tallying consensus hashes, they'll also query the HIVE API if each reported signature is valid. The valid signatures will be attached to the transactions and broadcast to the network. Well, this would be ideal, but as of now you have to verify signatures in a valid configuration. 3/3 is not valid in a 2/3 weight, and verification doesn't scale very well... but it works.

Once the nodes read these transactions on chain, they'll delete the transaction block from their collective database.

The next special thing about @dlux-cc is it's owner keys:

owner:{
    "account_auths":[],
    "key_auths":[
        ["STM5Rp1fWQMS7tAPVqatg8B22faeJGcKkfsez3mgUwGZPE9aqWd6X",1],
        ["STM7Hgi4pjf5e7u6oKLdhWfgForEVikzvpkK5ejdaMzAzH6dWAtAD",1],
        ["STM8TPTJXiCbGaEhAheXxQqbX4isq3UWiPuQBnHLmCKpmmNXhu31m",1]],
    "weight_threshold":2
}

Like discussed earlier there are multiple keys, each being a part required to get over the threshold. As new dlux nodes are run, or some go offline, the accounts will need to have a way to make sure only consensus accounts have a portion of the authority. In order to keep owner keys off of any servers, a new key is generated and put in the dlux nodes. Much like a witness key, it's only purpose is to update the community account as the consensus nodes come in and out of consensus, and change their levels of governance tokens.

Security that must be mentioned. The accounts that run this account have to put up collateral, and the lowest collateralized minority is the deciding factor as to how many resources can be controlled by this account at any one time. For instance, if the weight threshold is 3/5 and 3 accounts have $10k of collateral: those 3 accounts can take any amount in excess of $30k and profit from their collusion. Therefore if this is the case, the account should never be controlling more than $20k. If a confidence hack does happen, the accounts that signed the transaction can cover any losses with their collateral and transactions will look no different than a "failed" transaction on another DEX.

In action:

Screenshot from 2021-11-29 18-30-45.png


The first application of this is to have partial fills on our DEX orderbook. If you want 10 DLUX you'll be able to send ~10 Hive as either a market or limit order, and your Hive will be distributed to the accounts that had their orders filled.

We'll be able to accept Hive and HBD for NFT sales and auctions.

This will enables cross chain swaps and wrapped assets, and also means our account can distribute funds from the Hive DAO... and even pay them back.

This functionality will be rolling out to HoneyComb, our community token software.


This code is open source and as such we hope the community as a whole can use it to build bigger and better things on Hive. We're the smart contract platform that can scale right now.

If you find my work compelling please support my Hive Witness, run a dlux node, or build dlux dApps or NFTs.
You can find me on discord

Sort:  

would it be possible to implement a Lightning Network like system on Hive with multisig accounts? Not everyone wants to share their socialmedia history when they buy something, would be great in conjunction with a stable HBD

that's closer than you think :)

I just fell in love with you 😉

Now this is epic! Keep advancing the blockchain. We need those smart contracts etc

!PIZZA This is very pog.

That is awesome. It seems as though you have put a lot of time into this. I guess I know what you have been busy slaving away on now. I hadn't seen you around Discord much. I am glad to know this is still being worked on and hopefully close to completion!

I don't totally understand the significance of this, not being a developer myself, but I recognise the general jargon and this appears to be a net positive 😃

Same here. No idea what this is about, or why it affects users of this blockchain.

if i'm not mistaken it allows you to have 1 main acct (eg @adetorrent ) which has sub accounts ( @dingdong1233123, @codefee1231231 ) directly under it. you can then create multiple acct for different apps however its funded by your main app.

You would not require to create a brandnew acct on HIVE and remember they keys and such as it would all be shared / authorised by the main acct.

ps. i could be wrong .. but thats what I get to understand from the post

Maybe a little backwards. Imagine you and your friends are the main accounts... and the cashbox at your lemonaid stand was the sub account. If 2 of the 3 of you want to open the cash box... it'll work; but not so with just 1. Our lemonaid stand sells NFTs, has it's own Proof of Brain token, and the cashbox is a DEX

PIZZA! PIZZA! PIZZA! PIZZA!

PIZZA Holders sent $PIZZA tips in this post's comments:
shmoogleosukami tipped disregardfiat (x1)
hivetrending tipped disregardfiat (x1)
opinizeunltd tipped disregardfiat (x1)
@thebeardflex(1/18) tipped @disregardfiat (x1)

Learn more at https://hive.pizza.

I was just wondering the other day when would multisig come to HIVE. As accounts get bigger it will become very useful. Nice job.

PS, I have been trying to join the Discord server with the link given on your daily update post but it does not seem to work. I would like to experiment with some VR on Dlux but need guidance. The GLTF converter link does not work.

Multi-sig on the base layer has been around for awhile... but when it comes to tools to use it, especially autonomously... we've been lacking.

https://discord.gg/Beeb38j apparently still works... https://discord.gg/xR6m3NaX just in case

Thank for clarifying. Great work you guys are doing with DLUX. I used your link and I have joined. Now to start experimenting.

another web3 app. It will be a great features if user can track their assets and leverage their Crypto asset on Dlux.


Hey @disregardfiat, here is a little bit of BEER from @flemingfarm for you. Enjoy it!

Learn how to earn FREE BEER each day by staking your BEER.

Game changer !PIZZA




The rewards earned on this comment will go directly to the person sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.

great elaboration.

Great post and do with the good work

GM, good job. The foundation of Dlux becomes better and better to build on!

Nice post. I have really gained a lot of knowledge from this post...

This is really wonderful. Thank you so much for the good job...

Well done, thank you for sharing!

!PIZZA

wow amazing work!

This is great

Amazing work!

Tiny steps for DLUX = giant leaps for Hive = gargantuan somersaults for humanity

Still trying to find you on discord... Nice work ✌😎

Wow, this is good and packaged information. Lovely

Good ideia and vision about the @dlux-cc we are go!
@ocd

This is some technical post it makes me so dizzy I’m heading off.
Rocket science should be easier than this
Haha 😅

This is interesting to me. So is it open source?

When the best of graphene blockchain tech comes together =)

Didn't know you had this, but nice to know. (Hint: multikeys)