πŸ”’ Triple lock royalties via a Merkle Tree Royalties Distributor

The backstory

As you may or may not know, OpenSea and other aggregators do not always pay out royalties to KnownOrigin creators. Beyond the typical annoyances, such as non-custodial payouts, delayed or batched payouts and a reliance on a central body to fulfil them, we have been hamstrung on how to handle this problem for artists.

In a nutshell, OpenSea allows all NFT contract deployers to set a single address to capture royalties, this does not work with 4000+ creators on the KnownOrigin platform and contracts.

How do you pay out 4000 artists to one single address … not only that how do you know who and what to pay to each of them?

As a platform, if we start to process this directly then it opens up ourselves and our community to larger amounts of risk plus it’s not decentralised and trustless. We are a non-custodial platform and want to stay that way for us and all involved with us.

In my opinion the longer term solution is to push for wider adoption of ERC-2981 then all marketplaces can simple query and fulfil any required royalties but until this happens we will carry on trying to fix these problems for the good of all involved in this burgeoning creative economy.


The backstory

In our never ending quest to fulfil the promise of NFT royalties, we are proud to announce the triple lock royalties solution πŸ”₯

But what does this mean?

  1. ERC-2981 support - Our latest contract are compliant with this standard and should allow for other marketplace to easily query and distribute royalties to the KnownOrigin creators.
  2. Our latest contract is compliant with this standard and should allow for other marketplace to easily query and distribute royalties to the KnownOrigin creators. - A tool allowing for other royalties to be captured by a single address and then distributed to creators using the power of merkle trees.
  3. Support for Rarible royalties schema - our latest contracts support the Rarible royalties schema meaning that if things sold on Rarible, creators should also receive any royalties.

Also not forgetting any sale made on KnownOrigin itself will also handle royalties as standard. With these points we hope to cover as many bases as possible and actually fulfil the promise of NFT royalties to all creators in perpetuity.


What have we built? β€” Merkle tree royalties distributor

Standing on the shoulders of giants, such as OpenZeppelin and Uniswap, we have built and deployed an open source merkle tree driven royalties distributor which can enable non-custodial royalties to be claimed by all artists on the KnownOrigin platform. We can now redirect all royalties from OpenSea to the single address of the deployed distributor smart contract.

This then allows us to encode a large set of data and store only a small amount on-chain, providing a GAS efficient way to distribute royalties to many, many participants, something which will also scale as we grow. We also publish the full dataset to IPFS and version the hash within the smart contract along with the proofs, creating a public and transparent, auditable trail of funds and rewards.

We are still beholden to OpenSea or others to payout royalties but when we do receive a payout, we can then run a reconciliation process to work out where the sales came from, construct a merkle tree and proofs, then set this within the distributor and bingo πŸš€ all those who are involved in the creation of the work sold on OpenSea can now visit their profile and claim any earned royalties πŸ’₯

Longer term ownership of the contract can be handed over to a DAO structure as we work toward further decentralisation of the platform. We are also trusting the OpenSea API feeds to build up the list of accounts who have earned royalties but it is a step in the right direction which we hope others can build on further.

How it works

A basic flow of how this process works:

Claiming royalties on KnownOrigin

As a creator or someone who has been registered as a recipient of royalties in some form, you will see a new button called Claim royalties.

This then opens a simple modal which firstly checks what royalties are due, and presents you with the option to withdraw them. You don’t have to always withdraw any royalties, they can be built up and then claimed when the amount if higher enough to justify any GAS costs or when you need to access them.


You can find the code here. If you want to use this in your project then feel free to drop in our discord and ask for help about how to use the code.

Github: https://github.com/knownorigin/merkle-royalties-distributor

Discord: https://discord.gg/p6xmt64rGq

We hope you like our efforts, also don’t forgot that this is not the end game!

We hope you like our efforts, also don’t forgot that this is not the end game!

James & the KnownOrigin team 🐝