Skip to content

Instantly share code, notes, and snippets.

@tunnckoCore
Last active November 27, 2024 19:41
Show Gist options
  • Save tunnckoCore/04ce9e5b8f5b5523af65f58b9d0d6eec to your computer and use it in GitHub Desktop.
Save tunnckoCore/04ce9e5b8f5b5523af65f58b9d0d6eec to your computer and use it in GitHub Desktop.
Ethscriptions user-owned and user-controlled markets

Motivation and how the process currently works

The current approach is that a user escrows their Ethscriptions to a Marketplace contract that uses the ESIP-2 (contract-based transfers) for transferring when a sale happens. That escrowing process is required, and thankfully tho can be just a one-time cheap thing through the ESIP-5 Bulk transfers. While i was working on indexer, there was few people that transferred over 3000 ethscriptions at one go, for just a few dollars, and that was pre-Blobs with medium to high gas fees. Now would probably be just few cents.

The listing process is not "on-chain", the user just makes a listing through a marketplace site, that listing goes in a database and shows it to other marketplace users. When a user wants to buy, it actually calls the market's' contract with specific "listing id", the "ethscription id" which wants to buy, and the price asked by the seller. All that happens under the hood and is not complex to the end user. Nothing bad in all that.

The other side of the process is that when a buyer buys it can actually tell the marketplace if he wants to unescrow the bought ethscription(s) (eg, to receive it to their actual buyer wallet) or not. If the buyer choose not to unescrow, the ethscription doesn't even move from the market contract, it stays there even after the sale, just a virtual ownership of it is changed. That ownership change doesn't really even happen from protocol perspective. No transfers are used at all. And in the general case, that's the most used scenario. Because it's cheaper. That's why there are ethscriptions that have just a few actual transfers even though they were sold dozens of times. It's because these transfers never really happened. Which kind of pokes a little bit on the idea that you don't "own" the thing. Well, you own it kinda, cuz A) you eventually paid for it, and B) because Ordex says so, based on their database, C) yeah, you definitely can unescrow it, but still.. it depends.

That's how Ordex works, i may not heard if it has changed in recent months. But in anyway it's pretty interesting and elegant design leading to cheaper and easier process in general.

But. There's another problem in all that. Now, Ordex is here for a long time and it's not going anywhere, neither the official Ethscriptions API and indexer. Nothing against them. It's just that there's dependency and trust in all that. I don't know what level of control they have in the marketplace contract, but it doesn't matter much.

Wait, there's one more problem to escrowed marketplaces - that if someone wants to drop a collection, or something like that, and they want to make a snapshot of holders of a given collection, they usually exclude marketplace contracts, thus if you hold your ethscriptions there you won't be eligible for a claim or discounted mint, or whatever the event is. That's why usually when someone wants to make such an event, they specifically ask who wants to participate to unescrow their ethscriptions.

All these are not that bad or big problems. Hopefully users know how the process work and what are the risks. Fact is, that's rarely understood by the users, and it's rarely talked about. In fact, heard about it probably just once or twice.

The idea behind a different approach is just trying to help make it a bit simpler and more user-centric, with a bit more user control, and less risk. Plus, why not try to innovate? I always like to think differently and to try different things.

Why?

It's not an attack on Ordex or the current status quo. It's just different approach, the wiggle way. I'm here since the beginning and worked on many things, helped dozens of projects and people. Every time i tried different things, rewrote few different things a dozen times. And every time i told upfront the people i worked with that i experiment and try different things on purpose, always transparent and honest. Because i like to think, code, and try different things.

I've been in the Ethscriptions ecosystem since the beginning. I've launched wgw.lol almost immediately, at one point many were using it because there were things that no one else had, and was updating it constantly while listening to chats and spaces.

I've worked on a marketplace even before the official Ethscriptions one and before the ESIP-2 which allowed a correct and safe transfers through contracts. Never finalized it, because i realized i don't want a marketplace, then the launches and other ideas came. I don't want WGW to be marketplace, I want it to be open platform for tools, developer APIs, "etherscan for ethscriptions", documentation and learning hub, a search engine, and to allow users to deploy their own markets. Don't want to be in a position of control.

It's safe to say that i'm just The Visionary in the Ethscriptions space, haha. That's why I always talk unbiased about the pros and the cons of the whole or of a specific thing. Sometimes it may sound like fud and doomsday, but at the same exact moment i come up with crazy idea and explain it in length.

This dependency on ESIP-2, btw, is another category of problems on its own too. But won't address that here. Will just say it's hard dependency and trust on an indexer. We should strive to have as less trust and dependence on things as possible. It's my cypherpunk spirit.

By not using a single platform escrow but multiple; and by not using ESIP-2 for transfers but directly the native user ones.. we are safer and better. My stance is max freedom, independence, decentralization, security and safety, that's in short the reason of WHY.

So what we can do?

The way Ordex does things was kind of bugging me a little bit before, specifically that it's not talked about, cuz "it just works" i guess. But it's not bugging me so much now, i'm not against it - it's neat design choice. But it made me think recently.. wait, what if instead of one kind of controlled escrow be replaced by multiple "user market wallets"?

What if users can one-click-deploy their own marketplaces? It's not that complex as it may sound. These marketplaces won't use contracts but EOA market wallets, which on one hand possibly makes the whole process a bit cheaper; on other hand they have full control over the market and their assets; and on third, it can be zero fees.

Now, it's important to clarify that if a user deploys its own marketplace, others won't be able to list their assets there. It's strictly only for the user who deployed the market.

This approach kind of also touches on the core "no contracts" meme of Ethscriptions, right?

There still can be a markets aggregator that shows all listings from all user-deployed marketplaces. A market aggregator would listen on listings through webhooks or similar tech. Not that complex either. These aggregators can be markets.wgw.lol and eventually ordex.io or markets.ordex.io.

I've seen this approach with Metaplex on Solana years ago. They were able to make their own market, with its own pages, and they can list things there. Think about it like Instagram profile with pics, but instead of just pics, it's listings of your artwork or assets.

The plus of a marketplace platform is that users have "convenience" of having a centralized place where they can live and breath with the pulse of the whole ecosystem. This can remain, but you'll also have your own page with market.

Markets that user deploy themselves and they use it as their own "escrow", except that it would be fully functional wallet and they can use it as their "ethscriptions main". It's similar to how these memecoin apps that some people call "bots", does trading "on user behalf". Users connect to Photon for example, it generates a "trading wallet", and then the platform makes operations on user behalf. I've locked some dollars there, cuz apperantly you cannot withdraw under specific amounts.. so.

Now, it's tricky because of two things:

A) i don't know how exactly Photon and the similar "bots" work, and do they can actually suddenly rug the trading wallet; and

B) in token trading case (photon / solana / bots) it's the user who says make this, make that, or make this only if X happens; and it's possible that the platform don't even need to actually know the private key, it can be encrypted and only decrypted when needed - i doubt that tho. While on market case where a buyer comes and makes a buy request, the seller may not be available at the same time so the platform needs to have some sort of access to the private key to be able to make operations. Now THAT is a thing we don't want.

So, we need a way that only the user knows and controls its own "market private key" but the "platform", the marketplace website, should be able to make operations on the user behalf without even knowing the keys.

How?! THAT seems tricky, right? Well.. here come the reason why they would need to deploy it themselves. Total control, privacy, and safety requires a bit of work for the cost of "convenience". But "deploying themselves" is not some hackery hard thing - a user would A) just need to make/have account on Github, Vercel, Fleek.xyz, or Fly.io; and B) just click a "deploy" button - nothing hard, everything else would be automated and they'll have their own full-blown market platform.

It's also similar how industry leaders like TurnKey provide secure enclave non-custodial wallets, or the Privy where neither the Privy, nor the user know the private key. Or the Dynamic.xyz's embedded wallets, which is basically based on TurnKey.

That's also why the whole thing should be Open Source. The power of Open Source is safety, everyone who have knowledge can check what happens. They'll check and see that their deployed market doesn't leak the keys to anybody and while they are not the devs, they are in full control. There's also ways to verify integrity between all user markets, to ensure that it's the exact version and all comply to a specific standard and protocol.

We can expand the idea a bit further. These deployed "markets", to just be an Ethscriptions-dedicated wallets, which can be used as regular wallets, instead of Metamask, and to connect and sign to other apps. Ethscriptions Wallet - an idea i played around a lot in the past few months too.

Technicalities and implementation

This will be shared and discussed further, but wanted to share this as draft proposal of an idea that could help and could work well. I'll play around that more in the coming days and weeks, and will share the tech specifics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment