Moneypipe

minimal building blocks for playing with money on ethereum

Skøgard
7 min readJan 5, 2022

What if you could create a magical address for a group, and all the money sent to this address gets automatically split to the members, forever?

I am NOT talking about some app you need to sign up to.

I am NOT talking about some complex smart contract only developers can use.

I’m talking about a dead simple address, period. Just send money, and it’s automagically split to the members. This is moneypipe.

Example

Here’s an example: https://buffer.moneypipe.xyz/ethereum/group#address=0xD6A72cc77FbFb2007BE916505A3C88320eD600C3

Basically I created a group of addresses from all the people who responded to my Tweet below, and started by sending 0.1ETH to the group (If you are one of the members, you should be able to claim a small fractional amount, but I encourage you to share Moneypipe with many people so they can test out the pipe by sending some money to it. The more people try the demo, the more you will be able to claim since all money is evenly split among the members)

Unix pipes for money

In Unix/Linux, you can compose multiple commands using what’s called a “Unix pipeline”. Starting with a set of simple commands and allowing composability gives us a lot of flexibility.

Same with Moneypipe. Moneypipe is made up of two minimalist modules for splitting money:

  1. Stream
  2. Buffer

The “stream” and “buffer” reference is easy to understand if you compare it to Node.js. In node.js, buffer is for storing data, and stream is for allowing data to “flow” in realtime.

1. Stream

Here’s what a stream money flow looks like (Create a stream, and send it money, and all incoming funds are synchronously sent to the members’ addresses in the same transaction):

2. Buffer

On the other hand, here’s what a buffer money flow looks like (Create a buffer, and send it money, and all incoming funds are stored inside the address, and each member can asynchronously withdraw their shares whenever they want):

How to use

Creating a buffer or stream is easy. Just enter a list of addresses, and tweak the ratio to which each address is entitled:

If you’re creating a stream, that’s pretty much it! Just send money to the created address and you’ll see that they are automatically split to the members in realtime!

If you’re creating a buffer, that’s all you need to do as well. But the difference in this case is that the receivers don’t automatically receive funds, they need to “claim” their funds by withdrawing. Withdrawing is very easy as well. If you are one of the members in a group, just go to the group landing page and you’ll see a “withdraw” button. Just click it to withdraw money:

Why didn’t this exist before?

If you’ve read this far, you might be asking “this sounds like a no-brainer idea, who wouldn’t want a dead simple way to autonomously split money? why didn’t this exist before?”

The answer is, there have been several attempts, but all of them were less than satisfactory. Most of them suffered from one or more of the following problems:

  1. Not minimal enough. Usually the people who built them wanted to include some additional features and the protocols end up being bloated.
  2. Not easy to integrate. Often, whoever’s behind the protocol was focused on building a “moat” or “network effect” for their business, and made it difficult or unnatural to use them outside of their app or platform.
  3. Not optimized. Lastly, all existing implementations were NOT focused on efficiency because they were built when the gas price wasn’t a big issue.

Moneypipe was designed from scratch to solve all of these problems.

What makes Moneypipe special?

1. Minimal + Gas Efficient

The code is as minimal as it can get, with the most efficient gas usage.

The small size saves costs when deploying these modules to the blockchain.

Furthermore, the code has been optimized to be as gas efficient as possible, which is important for saving money.

2. Not just an app. A building block.

As mentioned above, most of the past attempts tried to build a whole business out of this feature. They were building an app, not an “invisible” protocol that can be built into any other apps or protocols.

Moneypipe was designed to be integrated. I mean, it’s just an address. It can’t get any simpler than that. You simply need to create a stream or a buffer and stick its address into another contract or another app, fully trusting that it will work in 100% deterministic manner forever.

Users can use the moneypipe.xyz website to use the protocol, but I bet most of the usage will come from people simply embedding the created address into other apps and forget about it, and everything will “just work”.

3. For developers

The composability aspect is such an important aspect that I have written and open sourced a whole JavaScript library to programmatically create and manage moneypipes.

Even the moneypipe.xyz website itself is built with this library, which means anyone can build their own interface. See here:

4. Immutable

One important aspect that makes all of this possible is that Moneypipe modules are immutable. When you create a buffer or a stream, the rules are set in stone forever and no one — not even the original deployer — can change it.

For example, if Alice, Bob, and Carol created a Moneypipe together that splits money 1:1:1, and they wanted to switch to 2:1:1, this is impossible.

However, the right way to approach this is you can simply create a new pipe and use that one instead.

Because all pipes are immutable, you don’t have to worry about the logic changing in the future, and safely hardcode the addresses into any app, and even other smart contracts.

5. Decentralized public utility with NO owner

One of the top priorities was to build it so that there is no owner.

The entire protocol has no 3rd party reliance and there is no cloud somewhere that locks you in (This is the exact same philosophy I took with Factoria, a decentralized minimalist NFT collection management system). And there is ZERO fee. It’s 100% free to use.

Even the merkle tree used to power the buffer is stored on IPFS, and the IPFS hash is stored on the contract, so there is no centralized server aspect. Moneypipe is a public utility, and it’s all yours.

Example use cases

There are many potential use cases for this:

  1. NFT revenue split: Everyone who contributed to building an NFT collection can automatically share revenue from their NFT sales, simply by withdrawing money to the group address, and the group address automatically takes care of the splitting.
  2. NFT royalty split: It’s not just about the primary sales. You can even apply the same principle to NFT royalties for all future sales. For example, you can create a group address, set it as “royalty recipient” address on NFT marketplaces like Opensea or Rarible, and all the royalty payments can be auto-split among the group members.
  3. A minimal plugin for DAOs: DAOs (Decentralized Autonomous Organization) are smart contracts that help a group of members make decisions together. You can imagine creating a group address using Moneypipe, and simply including them anywhere necessary. You can even programmatically do this using Solidity or Web3 (and if you want a whole library that makes this as easy as possible, check out moneypipe.js)
  4. Autonomous charity: You can create a Moneypipe buffer that pays out DIRECTLY to all the recipients, and people could send the address money. You can even build this into another contract to automate this.

Conclusion

Moneypipe is just an address.

You create a group made up of members, and give it an address. Then from that point on, the address indistinguishable from any other regular wallet address and you can use it like a regular wallet.

The only difference is, the money will be automatically split to the members based on the pre-programmed ratio. Very simple.

This is a super simple building block for Ethereum that anyone can use. If you like the idea, please share it with friends and people who might be interested.

All I want from this is to see it help many people with a dead simple way to split money in their projects, such as NFT collections, DAOs, and any other kind of blockchain project that needs a feature to control money flow.

--

--