Smart Multi-sig wallets is how we bring KYC-free p2p trading onchain

First off, I'm not a developer and do not know how difficult(or impossible) this may be. I only know basic HTML and CSS but a dev on Hive I follow once said that if you can describe in English perfectly enough, it can be made into code.

This is going to be an attempt to describe what I've imagined for a decentralized and KYC-free peer-to-peer trading solution, onchain.

I wrote an article earlier on layer 2 blockchains, highlighting several flaws including the centralization of liquidity and this got me thinking about p2p trading.

The reason p2p trading has yet to be implemented onchain could mean anything from it simply being that developers don't know how to or that they simply don't want to focus on this, as a solution they are willing to work on.

Whatever the case may be, one thing remains true, and that is that we eventually will need to have p2p trading solutions directly onchain to rid ourselves of the flaws of centralized crypto exchanges.

Now when I say I see p2p trading, I am specifically referring to the trading of crypto assets for several fiat currencies(and vice versa), so we're looking at how we can deliver a platform where on-chain and off-chain currencies can be traded back and forth without the need for centralized intermediaries and KYC.

It is clear to most people that one way to do this would be to have smart contracts as escrows, replacing centralized platforms. But this does not solve much as it is only the first step and might I add early on that it introduces a central risk factor because even though we're dealing with a smart contract, it is an autonomous single agent that can be attacked or exploited.

Knowing this, it became evident that p2p trading was likely going to suffer the same fate as L2 blockchains stacking up liquidity in wallets controlled by individuals that may not have the Protocol’s best interests at heart.

The solution had to be something that introduces a layer of randomness(multiple smart wallets depending on volumes overtime) where each party involved in a transaction had a say in the process. The only way to do this was through a smart Multi-sig wallet.

Specificialized P2P trading protocol: incentivized and powered by smart multisig wallets

Multi-sig (Multi-Signature) wallets are cryptocurrency wallets that require multiple private key signatures to authorize a transaction. Unlike single-signature wallets, where one private key is enough to approve transactions, multi-sig wallets enhance security by distributing access among multiple parties.

A multi-sig address is created with a predefined rule, such as "2-of-3" or "3-of-5", meaning a minimum number of signatures are needed to approve a transaction.

When sending funds, the required number of signers must approve the transaction before it is broadcast to the blockchain.

Multi-sig ensures that no single entity has full control, reducing risks like hacking, theft, or human error.

A multisig wallet is a cool solution to p2p trading, but they have to be enforced with smart contracts to make it best fit for decentralized trading.

So how would that work?

Our p2p trading platform has to be running on its own designated protocol, this is so that stake-based validators can exist. The protocol will also have a reputation system that's applied to all network participants including traders(buyers and sellers) and validators.

With that known, the protocol will be based on a temporary-access, trustless dispute resolution multi-sig system. This means that firstly, multi-sig wallet key access will be temporary for all participants(the keys will be unknown to participants and useless afterwards), and a trustless dispute resolution system is built in to ensure all parties, including validators, play fair.

The system would ensure that no single person knows nor controls private keys, validators are chosen based on qualifications by the network and transaction parties do not need to disclose personal information unless they need to resolve disputes and these data will remain encrypted onchain.

I ran a couple of these ideas by ChatGPT and they are apparently some tech solutions out there that can be used to build something like this, so I'll highlight a few — as recommended by it — as a reference.

Of course, the AI chatbot doesn't know that this was intended for a p2p trading protocol, so it mostly ran with the idea that it's DAO governance related, I'll have to ask it to guess what I'm looking to build with this later.

Moving on.

We need a system that allows us to generate temporary signing rights to all parties involved in a transaction, ChatGPT recommended using Keyless Signing via Threshold Signature Scheme (TSS/MPC). And apparently Litprotocol offers that — haven't verified personally.

Also, Gnosis Safe was recommended for the multi-sig as it supposedly supports dynamic signer management, meaning signers can be assigned temporarily and removed after each case(transaction) — also haven't verified that.

Some other recommendations included a Chainlink randomized validator selection solution, an encrypted onchain messaging solution(because that's needed to converse securely and resolve disputes) and some Ethereum-based time-lock solution for locking the assets for a specific period of time.

How the system should work in practice

First things first, we have a network of validators that are required to stake any amount of the protocol’s native token and set up their account including information such as which currencies they are open to validate trades on.

The validators are allowed to stake any mount because that directly affects what type of transaction they are chosen to validate. If the size of their stake is as large as the value of a trade(case), they would be picked. Also, the info on currency is merely a case of what specific countries are the validators' knowledgeable about so that they can be able to understand information presented in case of disputes and judge properly.

Given that traditional payment systems differ, this would be very vital. If it would be possible to keep this info private but usable by the protocol, it would be perfect to potentially eliminate the risks of validators getting doxed.

Moving on to the traders. Generally, buyers may be required to also have a security stake that's locked, that's based on the volumes they are looking to trade. If very low, it may not be necessary, but keep in mind that the protocol generally will have a reputation system that changes upon the completion of each trade.

Now, onto the fun part.

When a seller initiates a transaction, an encrypted message which would include information such as rate for the assets being traded, payment bank data and currency is tied, the protocol will post the value of the trade, the payment bank(without personal details) and the currency on the open market. Once a counterparty is reached, that is: a buyer accepts the trade offer, the protocol will autonomously match the case(open order) with a befitting validator.

At this point, the assets will be locked into a multi-sig wallet where the seller, buyer and validator all have “key shares” that grant temporary signing rights to direct funds within the wallet.

If the buyer makes payment and it is confirmed by the seller, the buyer will request a funds release and the seller can sign the transaction and the case(open order) will be closed because the multi-sig needs 2 out of 3 signatures to move funds out of the wallet.

If a dispute arises, the validator is invited into the room by either party(typically this is when the validator would earn a key share) to look over arguments from both parties.

The validator’s job is to determine who is truthful and sign a transaction in their favor and bring the case to a close.

The entire process is incentivized and also has its risks.

Validator assets are locked and cannot be accessed within a specified period of time from their last case. This gives traders enough time to be able to challenge any transactions after a validator has signed to have it closed as all data remains accessible except multi-sig keys, which are practically useless after a case is closed.

Whilst the network incentivizes validators assigned to each case, even if the case does not end in requiring dispute resolutions, the ones that do, come with higher rewards. All participants can directly influence the reputation of others through votes that are weighted and results in onchain ratings that can limit the ability of specific users being able to use the protocol whether as a validator, buyer or trader.

The general idea here is that a single smart contract isn't in charge of the funds, the validator and traders involved in each case are. What are the chances that two would collide to scam the other when the rights far outweigh the benefits?

Or what are the chances that all participants will be compromised at once?

In terms of implementation, I have no idea how difficult it would be to make this a functional product, but I expect that this article would serve as a little brain tickle on how multi-sig wallets can be the ultimate tool for achieving decentralized p2p trading that eliminates the need for centralized cryptocurrency exchanges acting as escrows or centralized on and off-ramp services.

Posted Using INLEO



0
0
0.000
2 comments