Make Crypto Currency Again - Infrastructure for Commerce

ETHCC 7 · 8 Jul 2024 · 23:10

Martin Becze of Mass Labs presents Mass Market, a proposed open protocol for crypto-native commerce of physical goods. He covers the thin layer it standardizes (listings, inventory, order status, customer accounts, checkout and payment), an ERC-721 shop registry, a payment contract, and relays that store and stream signed events. He compares it with OpenBazaar, pure on-chain marketplaces and ONDC, discusses privacy, and shows a demo of three clients using one shop on Sepolia. In Q&A he explains that disputes are left to third-party escrow.

Speakers

Topics

From ETHCC 7, hosted by Ethereum France.

Transcript

Hello, uh I'm Martin Beasy um from Mass Labs. Um I'm gonna be giving a talk about uh Mass Market. So a long time ago, um uh crypto used to be thought of as currency, um and we're interested in being able to use it as currency again. So um as you all know, DeFi has been lots of fun. Um it has uh given a lot of people liberating access to financial concepts, ideas, and markets. Um it's had a few bumps on the ways, but you know, we think uh crypto can be a lot more than just uh DePi uh and fundamentally change the structures that uh underpin uh our economies.

So we propose to complement pure financialization uh building an open infrastructure for native crypto native comment uh commerce of physical items. Um and this talk is going to be about that. So uh we are going to uh uh explain uh why we're doing this, how we how we plan to do it, sort of the architectural comparisons and some challenges we have along with privacy. I should profess this is a fairly technical talk.

Um so uh it will be uh we'll get into the details. So uh why are we doing this? I think there's a lot of good reasons. Um there's a lot of good reasons to use crypto. But fundamentally, uh we want to uh uh free markets uh from ownership of monopolistic platforms and enable uh direct commerce without intimarities. And I think this was like kind of the original promise of cryptocurrencies. Um we'd like to get back to that uh issue.

But along with that, there's a whole host of other good reasons. I'd like to talk about one, which is um why building a protocol and not a platform makes sense. As a as a protocol, we propose building a set of specifications that are permissionless and locked open. So anyone that implements the specification can uh utilize the protocol. Um should be familiar uh with other protocols like TCP, IP, etc. Uh data ownership.

So users own their data. And um what this means is it in the technical level, everything is cryptographically signed and it has a challenge privacy versus discovery, which we'll talk about later. And lastly, like we hope that uh protocol will enable a creation of a shared uh data layer, and this shared data layer uh can be drawn upon from many applications, and what this will do is hinder uh m monopolistic practices uh that lead to things as price gouging and also uh will lower the barrier uh to competition uh for uh merchants and marketplaces. So um to start with, I'm going to define like the boundaries of the system.

Like we want we want to find a uh very thin layer to protocolise. Like it's very easy to like try to protocolze the whole stack, but that would be I think uh too uh complicated and would not make sense in our situation. So uh what we are interested in handling is the following listings. So uh listings are the description of what is being sold uh and other metadata about it, and pricing information, for example. Inventory, inventory is uh correlated to listings.

Every listing has an inventory amount associated with it, and the system needs to know um about the inventory amounts to be able to uh correctly process payments. Um the system tracks uh the status of um a listing from being uh uh in a cart to being purchased to being shipped, etc. It can have many different states, uh, but we track that. Um customer accounts, so we have some notion of who bought what, and um payment and checkout flow.

And uh these uh five things are pretty uh linked together. Um this is where we've chosen to sort of uh handle and define the boundaries of the protocol. So design goals. We want this to be delegatable, and I think this is an interesting issue. We will talk about that later with uh the historical um aspects of this. But what delegatable means is um the uh software, you shouldn't have to run the software yourself as a merchant or a marketplace. Like you can delegate it to a third party and trust that this computation is being done correctly.

Uh that gets to the next point, trustless. We are not trusting a third party to do the computation correctly, censorship resistant, um, meaning you like the third party, if the third party goes down or decides to take your uh data down, um that doesn't stop operations, you can have multiple replica, etc. Accessible. Um what we mean by accessible in this context is that regular web technologies, uh WebSockets in our case can be used to access this data layer. Um so there's several components.

Uh we have on-chain and off-chain components. Um-chain, uh we have two smart contracts. One is an ERC721. This regist is simple a simple shop registry. So every shop on the protocol is represented as an NFT. This registry uh just provides a global index of all the shops and provides access control. So whoever owns the NFT can decide who can update their shop. And you can also uh delegate uh access to third parties or clerks.

Um lastly, the shop registry stores the state route of the store. Um and this is useful for verifying that the correct uh state or the correct you're being served the correct data. Um the other smart contract we have is a payment smart contract. Um this handles validation, so the deadline, amount, what currency, et cetera, is uh correctly paid. Um it also has hooks for other on-chain actions. So maybe uh if uh you want to issue an NFT or have some sort of reward mechanism or uh you want to have escrow systems, et cetera.

Um the payment contract will do the validation and hand it out hand control over to uh other on-chain uh entities to do things. And lastly, it provides an attestation so you can later go back and prove that you did buy something. Um relays are similar. So relays are off-chain component, and really it relays are similar to um Noster. Uh they're called relays also.

Um Blue Sky has personal data servers, Scuttlebutt has PD pubs. Um they all pretty much act in a similar manner. Um they store and serve listings, provide data availability. They process uh events. So this is like checking signatures and um uh building the state correctly. Um they provide locks on items. So when someone wants to purchase something, that needs to be locked.

So two or more people don't purchase the last item that isn't uh available for a store. Um and they watch for payments. This is the main uh duty of relays. Um the topology of them is that merchants and their uh delegated clerks can write signed events to the relay. Um the relays themselves can gossip in between each other, and then the relays can push events to clients. Um how do we like verify that you know this information is correct when we're getting it?

So we have a stream of events. Uh these might be mutations on the listings, um, and then each listing is signed, so we know the individual listings are correct. Um we can check from the on-chain uh contract that it's either signed by the merchant or a delegated party. The um relay will compute the state of of um uh the store by re by combining these events. Clients will do the same.

And then uh the relay stores the state root on chain. Um the green part is the only part that is written. We also store the height, so the number of events that went into creating the state root. And that is done for later when clients load the state from the relay. So yeah, clients will load the state directly from the relay.

They have a state root, so they can download the state and the Merkle uh the associated Merkle proofs. And then after they've downloaded the state, uh they can uh start receiving events on top uh of that and start building a new state as they come in. So um the protocol itself does not provide any uh aggregation or any knowledge of um like multiple things.

Uh so we leave this up to other people to build. Um and uh there are some projects working on this. There and so aggregators will uh be able to pull from the relays and uh they can read directly from the relay register so they could um see the different stores being created and prevent uh and present an overall view of um the the m stores or shops to the end users. So architecturally um like where we sit uh is a bit different than what has existed before so like on-chain commerce has a history and um i think this what makes this different um is several factors I think the OG in this space was open bazaar um open bazaar uh started out as a bitcoin only uh project has anyone used open bizarre okay one person um so it it uh was based off IPFS and Bitcoin although they did expand to other payment methods.

Um every node had to be on a node had to be on every device um mer like that was one one problem you had to always run a node. Uh merchants always had to be online to serve the data, although theoretically that could have been uh delegated it would have been they had no mechanism to ensure the latest state was always being served though. So like you could have um like the third party could have always served a really old state of the store. And there was no uh way to interact with the protocol directly through um the web so you always needed some sort of specialized client um to do that.

Five minutes all right um so uh another approach is pure on-chain uh marketplaces, um, which is a fine way to do this, but um we think that we can scale a lot better. Like if we really want to have millions and millions of listings, then this isn't really gonna scale. Uh also if you have inventory tracking on chain, then uh payments for your listings is attached to that L2 that it exists on, right? Um also it's hard to do off um offline usage.

So we lastly, I'll the last comparison I'd like to make is to uh ONC ONDC in the back-end protocol. Um I think spiritually, we're closest to uh we're very close to what they're trying to do. Um we have a long quote here, but I'm gonna pick out some parts of it. So regulating e-commerce monopolies and duopolies is becoming one of the biggest challenges facing policymakers. The winner-take all nature of e-commerce platforms has provoked regulatory responses that range from calls for breaking up these platforms to imposing heavy fines and penalties.

Breaking up a one platform might solve a uh violation by a specific organization, but it will not fix the system that spawns them because of the technological and economic incentives that exist today. Unless the basic plumbing of technology is fixed, policy responses will continue to look like a perpetual whack-a-mole. And this is very much in line with what we believe also. Um where we different from ONDC though, is it's uh government gated, it requires registration, it's not really permissionless. Um it is a protocol, but it's very much like Web2.

It's not sovereign, your data isn't signed, etc. Um and lastly, um privacy. Um relays are authenticated, meaning like when you connect to them, um if you can present the right signature, then the relays will give back certain data and will not give back other data. Messages, uh messaging is encrypted, will be encrypted. We haven't implemented messaging yet.

Uh listings are always public, everyone wants to see them. Inventory is kept private. It's uh only accessed via authentication, but is unencrypted because the relay needs to de-increment and needs to have knowledge of the uh inventory. And this is like something we could research and implement zero knowledge for, but um we'll see if that's necessary. Um, come speak to us if you like to evolve and have a really quick demo, because I have two minutes left, of how uh this open data layer will work. Um this demo is between um ourselves uh and a uh another project call uh called Hamza, which is a marketplace that is pulling data from this open data layer and presenting it on in their interface as well.

Um so this is us showing uh how to create a shop. This is all on uh Sopolia, it's also very fast Cepolio. Um you can add a product. Um these products are being saved on the relay. Set the price, set the unit. Here's another client. It's written in Python, not a web interface, that is writing products to the relay, and it's showing up on this interface automatically because the vents are just being streamed. And then here's a third interface.

And this one is going to be an aggregator over multiple stores. And you can purchase the item from it. So like you have potentially various different sources to read and write from this protocol. And yeah. So that is it. We think this is pretty exciting. And we hope that we can make crypto viable as a currency. Let me know if you have any questions.

Thank you. Thanks. So that was a great talk. So it I mean it sounds like you're going after like the eBay shop Shopify sort of, you know, trying to provide a solution for that rather than just get back to crypto, which is cool, but with so few people using crypto to pay. Sorry.

EIP 681. That's where you can have a QR code where people can just, you know, it'll tell your wallet what what pl whether what chain and what token you're gonna use. So that was the easy one. So um but uh payment rails, uh yeah, I think that's an important thing. Um but like uh mass market itself is a thin protocol layer uh that deals with yeah, uh a limited set of things. Higher level applications, I think this will be very necessary. Um yeah. So it's not it's really not Shopify or or eBay?

Uh the protocol itself is probably more closely related to like what Shopify's capabilities are. Um and then from that you can build things maybe like an Amazon like thing with the aggregates over multiple shops. Um it's hard to say exactly, is it more like Shopify or eBay since it's uh a protocol and probably can be used by applications in lots of different ways, I think. Hi.

Uh so just hopefully a quick question. So with all real world assets and things that are being sold online, etc., you've got the mechanics to be able to take payment, ma manage inventory and order and everything. Are there plans for this protocol to be extended to refunds, RMA, that kind of management for people to come back if there are issues? Because I think that's one of the other areas with real-world assets that people have a lot of issues with being able to have some form of recompense if something goes wrong. So by default, it's uh it wouldn't give you any sort of um uh dispute resolution other than um what the merchant uh it's just direct merchant to uh user um or consumer relationship, right?

But since um the payment contract can forward the payment onto anywhere, um there will be systems developed to have escrow and other source of arbitration. So it's up to any third party to uh decide what kind of arbitration system they want to use. So um, like maybe when you're going to check out, you could select for an extra price to use a particular arbitration um system. Or you could choose for a lower price, maybe to purchase from the uh merchant directly.

Um so yeah, it's quite flexible in that regard. Thank you. Okay, perfect. Thank you. All right, thank you.

Related talks