Modeling a mudaraba smart contract

2020 Update

Enter Flint

Basics of Mudaraba

  • If the investment loses money, the loss is split proportionally to the initial investment. It’s easy to remember by thinking what would happen in a 100% loss.
  • If the investment is profitable, those profits are split according to an agreed ratio. Lenders will incentivize the business owner, and compete with each other, by offering a greater share of profits. For example, a 80–20 partnership may agree to split profits 70–30. In any case, the success of the investment depends on reliable accounting, which typically involves more overhead and complexity (potentially another crypto solution?).
  • Unlike other types of musharaka, a mudaraba lender is typically a “silent partner” and not deeply involved in business decisions.
  • There are additional rules about adjusting the profit ratio and mutual decisions to end the contract, but I don’t want to code everything at once. For this example, we have a fixed profit ratio and either side can end the contract at any time.

Initial structure

What anyone can do

  • if the owner does not invest satisfactory funds or takes time to invest for some reason, the bank can delay calling start() of the contract, or cancel().
  • if the bank does not set the promised profit ratio, or invest satisfactory funds, the owner can cancel() or not move funds into the contract

What business owners can do

What banks can do

The contract closing function

Compiling the contract




Web->ML developer and mapmaker.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Introducing Elysian: An Ethereum-based, DeFi Security Token

Electra Partners with UniFox

The Real Potential of NFTs


PancakeSwap and KingSpeed Crystal ($KSC)

What Problems is izumi Solving for Uniswap V3

Switcheo, beat Nex to it! Exciting Dex on NEO blockchain ….Plus updates on ICO

Botcrypto Review 2021 | Build Your Own Trading Bot

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Nick Doiron

Nick Doiron

Web->ML developer and mapmaker.

More from Medium

Assuring the quality of blockchain apps: 6 specific features to consider

How to Deploy Hyperledger Fabric Node

Hyperledger fabric node


Technology in the era of cloud, blockchain and IoT