OpenSea 🛠Seaport Protocol Intro
ETHGlobal·Sun, Oct 9, 2022, 12:00 AM
Join 0age of OpenSea for a workshop titled, "Seaport Protocol Intro." This workshop is part of ETHNewYork 2022, a three-day in person hackathon that will feature hackers, mentors, enthusiasts, sponsors and speakers who are all gathering in New York June 24-26, 2022 to talk about the future of money, finance, the web, ownership, the way software works and the way power is distributed. We're excited about a new frontier. ---------------------------------------------------- Follow us: https://twitter.com/ETHGlobal​ Check us out: https://ethglobal.co​m Email us at: hello@ethglobal.com
Transcript
[Music] hey everyone i'm zeroage i'm the head of protocol development at openc and we're very excited that you're looking to build on top of seaport brand new protocol owned by the community so seaport is an nft marketplace that in contrast to many other nft marketplaces where you have a distinct item that's being bought or sold in seaport you have an offer which is an array of items where an offerer or user can elect to include as many items ether or native tokens erc20 esc 721 erc1155 they can include as many items as they like and they also include as many items as they like as the consideration another array that is a group of items along with the recipient that should receive back those items so a fulfiller can then come and spend those offer items as long as all of the consideration items are received back so seaport doesn't have any notion of fees or uh special permissions embedded in that gives offer a lot of flexibility as to how they want to list or make offers on nfts groups of nfts and has a couple different new mental models for how to approach this when you're coming from other nft marketplaces so as a high level overview offers layout exactly the terms that they're interested in in addition to the offer and the consideration they will also specify an optional zone that they'd like to give a thumbs up or a thumbs down on the order's validity zones are a really interesting concept for extending what seaport can do and adapting to different types of order listing like auctions and commit reveal and a number of other novel mechanics for how orders are validated there's also a notion of a conduit the offer can specify a conduit that is where they approve their tokens so the core seaport contract the marketplace is totally unowned unupgradeable hyperstructure whereas the conduit each offer can decide their own conduit as well as the fulfiller can specify their own conduit and that is what they approve they give their erc 20 721 1155 token approvals to the conduit and then seaport or other marketplaces will tell the conduit how to transfer tokens so that is a way that the protocol can be broadly composable with other marketplaces and upgradeable um but there's also it's totally up to the the offer and the fulfiller what conduit they want to use or if they want to just approve seaport directly you don't have to use a conduit so you lay out all of these terms every single order that's created has the same structure the same syntax and you'll be presented with a eip712 payload to sign that lists out exactly what items are going to be leaving your wallet and exactly what items are going to be received back and by whom and the way that fees often work is that there are additional consideration items on a given order you can also extend those consideration items when you're filling an order by adding additional ones that's called a tip and so from the perspective of the offer they don't mind it's the filler that's choosing to apply this tip and and especially when paired with zones which can look and see what the tips are enables more dynamic consideration items so the the standard flow is an offer will create an order that lays out exactly what they're interested in listing or or except or putting out an offer for an nft and then a fulfiller can choose a number of different ways to fulfill the order depending on the type of order or if there's multiple orders so on so forth the most simple is to just call fulfill order and you start within with the order you're fulfilling and you take the mirror image of it create this second implied order and all of the offer items the fulfiller will just take them as consideration items for itself and all of the consideration items the fulfiller will pay out as offer items in addition you can specify fulfill advanced order and an advanced order has two additional tools in its toolkit the first is that it can resolve criteria based items every item can specify in in place of an identifier a specific token id for the nft you're interested in you can also supply a criteria which is a merkel route that contains a number of token ids and then the fulfiller gets to decide i would like that token id and they provide a proof that that particular token id is contained within the merkle root in addition advanced order fulfillment you can specify partial fills if the offer indicated that they that the order supports partial fills then all of the offer items and all of the consideration items will be scaled down with the condition that the scaling factor has to be exact for every single item and then you can fulfill some portion of the order and that's effectively the advanced orders there's a number of fulfillment methods you use fulfill advanced but it's once again the fulfiller that gets to choose which method they want to use there's a subset of orders that are called basic orders that if you have a single offer item and one or more consideration items where all of the additional consideration items share the same item type token and etc with whatever the item that is not an nft so if i'm putting an offer to purchase an nft then i might have weft that i'm offering and then there would be some consideration items in west as long as the order has that and a few other conditions then you can call fulfill basic order as a fulfiller and that is a heavily optimized version of fulfill order where you can bypass certain approvals because you don't need to take all the tokens and then pay them out and the example i just gave i wouldn't necessarily have to have wealth approved because it gets sourced from the um the offer item and the order that's being fulfilled rather than paid out to me and then paid again and it utilizes extensive optimization and inline assembly to make it as cheap as possible to fill those orders and provide a subset of the call data that you would normally need to supply then there's also a number of methods for fulfilling a bundle of orders or a group of orders all at once the most straightforward is to call fulfill available orders which takes a mirror image of a number of different orders and tries to fulfill as many as it can skipping any that have been cancelled or already filled or are expired and just processing the ones that are the orders are still available up to a limit that's specified by the fulfiller and the last method for processing orders and fulfilling orders the fulfiller can choose to use what is called match orders in which you ex fulfiller explicitly supplies all of the orders so there's no implied mirrors and then the fulfiller chooses how to move the tokens in whatever manner they want but each of those fulfillments will then be applied to the orders that are specified take these offer items on these orders these ones all are the same item type token and they're all coming from the same source or headed to the same recipient basically they can be aggregated into a single transfer and then crunch through all those fulfillments that the fulfiller has supplied and once that's done then we'll just check all of the consideration items on every order and make sure that all of those considerations have been met if they have then all of the offers terms have been met and the fulfillments can they can execute token transfers so it lets the fulfiller choose novel ways of transferring token a to b b to c c to a you can fulfill that in three transfers or routing through interesting paths to get to everybody being happy so really puts a lot of power into the hands of offerers where they can choose exactly the terms that that matter to them as well as fulfillers the users that are interacting with the protocol and fulfilling orders can choose exactly the method that makes sense from a gas perspective from the token approvals perspective from a perspective of sourcing orders from a bunch of different sources and um really excited to see what everyone builds one last thing i'll mention is that eip 1271 is supported as a first-class citizen so any offerer can also be a smart wallet and sign listings off-chain you can also verify you can call validate which lists on chain and [Music] when you use 1271 you can also do clever tricks like bulk listing you can sign a merkle root of a number of orders and then when a fulfiller is taking those orders they just choose a particular order and provide a proof that the order's in the the merkle route that you signed for there's also um interaction with zones by default no need to even use a zone seaport is a single contract and handles everything inside this contract apart from telling the tokens where to move and the conduits likewise but you can also specify as part of the order that it's a restricted order and then that order will call into the name zone supply a zone hash that's also specified by the offerer that can be used to commit to the state of the zone or extra data which could be supplied on that call to a zone and for instance you could supply a whole bunch of extra data that um needs to hash to the zone hash and then that zone will give a thumbs up or thumbs down and if the order can proceed so imagine you have an you have an nft collection with dynamic on-chain metadata now all of a sudden i can use that on-chain metadata to construct valid orders and make adaptive trait-based orders something to that effect so some of the cool things that you can build with seaport first example is anyone can come and build on top of this unowned unupgradable contract and it's just going to work out of the box so if you want to build a marketplace for swapping nfts directly for other nfts or any kind of interface that really requires moving nfts around seaport is a really good tool for that because it's been very thoroughly optimized and vetted and will also be broadly composable so if you have users that are creating orders and making listings then you take those listings and service them in other domains another really interesting application is to explore what you can build with zones so you can do english auctions in a totally native format one very interesting application of zones is for doing white lists or blacklists you can combine a number of tricks on seaport to effectively run a primary sale that would be available in any nft marketplace that supports seaport what you do is you have a it's a restricted order so you have a zone where you have a white list for everyone that's eligible for the mint and um have the fulfillers that are minting supply of a proof that they're in a route on the zone you have the nft contract auto approve c port and set it up for lazy minting so that by default ten thousand nfts are all held by the creator they don't actually have to be minted yet but on that first token transfer hook as long as it's coming from seaport and the owner is this this known creator address then it will mint them as part of the transfer you include you just have a single criteria based partial fill support order as well that as soon as that order is a piece of it is fulfilled the fulfiller just chooses a token id that they want or you could even pass through the zone and increment along the way and then basically this primary sale would populate here's 10 000 tokens that or work really well for 1155 tokens that um now it's just gonna show it's gonna show your primary sale directly on a marketplace and the contract is still gonna be a contract that's owned by the creator but um you'll have this broadly composable primary sale mechanic that does not uh does not actually require reapproving tokens on a sketchy mint site somewhere everyone's already gonna have their approvals set on some aspect of seaport another really interesting thing that is worth exploring is better simulation of seaport as we mentioned there are a lot of different ways that a fulfiller might choose to fulfill a given order or group of orders the power is totally in the hands of the users as to how they want to fulfill these orders and so really good tooling around okay i've got this order what is the best way to fulfill this that would be really interesting to see to simulate what's going to happen show what nfts are going to leave the fulfiller's wallet and what's going to come back and where it's going to where those nfts are going to go and what uh what method to call on seaport to make that happen and that's really just a a broad overview oh one other functionality that a piece of functionality that's worth mentioning every item can specify a start and an end amount the order itself also has a start time and an end time assuming you've got a start and end amount that are different then cport will figure out based on what time the current block is it'll it'll interpolate a linear fit and pick okay so the start amount is one weft the end amount is 10 with that's an ascending amount item say the 10 weather is a week later i i fulfill that order halfway through now that's going to be five and a half left so you can do ascending and descending reverse dutch auction type mechanics and they that pairs with partial fills as well both the start and the end amount just gets scaled down depending on how much you're filling that's that's seaport at a high level really excited to see what everyone comes up with and builds we are all building this together at this point seaport is a community resource and i'm looking forward to seeing what everyone builds thank you
Automatic transcript — names and jargon may be misspelled.