Payment Splitter

Split payouts equally among a list of specified payees

A payment splitter can be used for example to create a shared project donation address, ensuring that all payees receive the same amount

Sending lovelace to the contract works similarly to sending lovelace to any other address. The payout transaction can only be submitted by one of the payees, and the output addresses are restricted to the payees. The output sum must be equally divided to ensure the transaction is successful.

There are 2 actions (or endpoints) available to interact with this smart contract:

  • Send Lovelace to Payment Splitter
  • Trigger Payout

To initialize the payment splitter, we need to initialize a provider, a MeshTxBuilder, and a MeshPaymentSplitterContract. Additionally, a list of payees is required to define the allowed payout addresses for the contract.

import { BlockfrostProvider, MeshTxBuilder } from '@meshsdk/core';
import { MeshPaymentSplitterContract } from '@meshsdk/contracts';
import { useWallet } from '@meshsdk/react';

const { connected, wallet } = useWallet();

const blockchainProvider = new BlockfrostProvider(APIKEY);

const meshTxBuilder = new MeshTxBuilder({
  fetcher: blockchainProvider,
  submitter: blockchainProvider,

const contract = new MeshPaymentSplitterContract(
    mesh: meshTxBuilder,
    fetcher: blockchainProvider,
    wallet: wallet,
    networkId: 0,

Both on-chain and off-chain codes are open-source and available on Mesh Github Repository.

Send Lovelace to Payment Splitter

sendLovelaceToSplitter() will lock Lovelace in the contract. The function accepts the following parameters:

  • lovelaceAmount (number) - the amount of Lovelace you want to send to the contract

The function returns a transaction hash.

This demo, shows how to send 10000000 Ada to the payment splitter.

const lovelaceAmount: number = 10000000;

const txHash = await contract.sendLovelaceToSplitter(lovelaceAmount);

Trigger Payout

triggerPayout() will split the locked amount equally among the list of payees. The function doesn't need any parameters.

The function returns a transaction hash if the payout has been done successfully.

This demo, we will trigger the payout of the locked amount equally among the list of payees. The amount has been locked in the previous step.

const txHash = await contract.triggerPayout();