Book An Appointment

SMART CONTRACTS AND BLOCKCHAIN IN KENYA

1 Smart contracts and blockchains

As a fintech innovation hub on the African continent, the use of blockchain and smart contracts is rising in Kenya to drive efficiency, transparency, and cost savings.

However, these developments bring with them new legal challenges and regulatory ambiguities. This blog looks at smart contracts, how they operate and can be used, and some legal implications for fintech players in Kenya.

What Are Smart Contracts in Blockchain?

A smart contract is a computer code running on top of a blockchain containing a set of rules under which the parties agree to interact.

It’s like an online contract that doesn’t require someone in the middle, like a lawyer or your bank, to enforce it.

Smart contracts are coded and stored on a blockchain, ensuring security, transparency, and immutability.

Let us say you’re purchasing a car in Kenya. Rather than wait for papers to be signed and a bank to process payments, a smart contract can transfer the car’s ownership to you once you send the payment.

This removes the delays and the potential for fraud with the existing system. Smart contracts, in simple terms, are self-executing agreements on the blockchain smart contracts technology.

What Are Blockchain Smart Contracts?

Blockchain technology smart contracts

Blockchain smart contracts are programs running on the blockchain. The blockchain is a distributed, digital ledger for securely recording transactions.

In contrast to regular contracts that require trust and intermediaries, smart contracts and blockchain technology mean that parties can be sure that contracts are automatically enforced as written.

No one can tamper with fulfilling them. Blockchains with smart contracts, such as Ethereum, Cardano, and Stacks, make these agreements possible.

Innovative contract blockchain technology is taking off in finance, real estate, and supply chain management verticals in Kenya.

As one example, smart contracts for real estate can automate the transfer of properties, ensuring transactions between buyers and sellers are processed without delays caused by cumbersome paperwork.

How Do Smart Contracts Work?

This is the simple process of smart contracts:

Creation

A competent contract developer designs the contract in a programming language, such as smart contract solidity (Ethereum-based) or Clarity (Stacks-based). The provisions of the code are the terms and conditions of the agreement.

Deployment

The smart contract is deployed to a blockchain (Ethereum, Cardano, etc.) and is now a permanent record.

Execution

When the conditions are satisfied (for example, when a payment is made), the smart contract executes the specified behaviours, such as payment of funds or disbursal of assets.

Verification

The smart contract is tamper-proof and transparent from the distributed ledger. The transaction is secure because each node in the network validates/sanctions the transaction.

For example, smart contracts on the Stacks escrow model can withhold tokens until a buyer confirms they received goods, leading to trustless transactions. Indeed, this mechanism makes intelligent contract automation potent, eliminating the middleman.

How Do I Get a Smart Contract?

smart contracts blockchain

To obtain a smart contract, follow these steps:

Determine Your Requirements

Determine what you need your smart contract to do. For example, do you need smart contracts for NFTs to handle ownership of digital art, or smart contracts for your real estate to facilitate property transfer?

Hire a Smart Contracts Developer

Choose a talented smart contracts developer with a Broad scope and in-depth knowledge of innovative contract programming. Services such as Upwork or local Kenyan tech communities can help get you in touch with experts on smart contracts.

Choose a Blockchain

Choose a blockchain platform like Ethereum, Cardano, or Stacks. Each has pros and cons. Ethereum is well-known for Ethereum smart contracts, while Cardano uses Cardano ZK smart contracts for better privacy.

Develop and Test

The developer will code the smart contract, usually in Solidity. Before going live, the code is independently reviewed by a competent contract auditor and becomes free of vulnerabilities.

Deploy

Following the audit, the smart contract is deployed on the blockchain, allowing it to be used.

Fintechs can partner with local blockchain developers and innovative contract development companies to develop local solutions in Kenya.

How Much Do Smart Contracts Cost?

Several factors determine the costs of smart contracts:

Complexity

Simple smart contracts like those underpinning basic cryptocurrency transfers are cheaper than complex ones, such as DeFi smart contracts for decentralized finance.

Platform

Releasing on Ethereum could be costly because of high gas fees (transaction costs), though Cardano or Solana could be less expensive.

Development

A competent contract developer in Kenya may charge between KES 50,000 and KES 500,000, based on experience and the project size.

Auditing

A smart contract audit for guaranteed security of the smart contract can start from KES 100,000 and depends on the auditor’s experience.

Deploy

Fees for blockchain transactions are fluctuating. For instance, Ethereum’s gas fees can be $10-$100 per transaction, whereas Cardano’s fees are cheaper.

You won’t spend less than 100,000 KES on a basic smart contract, including development and auditing.

More complex smart contract use cases (eg, smart contracts, crypto, or Web-3 smart contracts) could be much more expensive.

Applications of Smart Contracts

smart contracts in blockchain

Innovative contract use-cases are broad and continue to expand in Kenya’s fintech and tech ecosystems. The following are some of the more critical smart contract use cases:

Finance (DeFi)

DeFi smart contracts support decentralized lending, borrowing, and trading. In Kenya, fintech firms have turned to smart contracts and crypto to provide peer-to-peer loans without banks.

Real Estate

Smart contracts can automate all types of property sales, rentals, and escrow services, simplifying contracts and lowering the risk of fraud.

Supply Chain

Goods and products are tracked from origin to point of delivery using blockchain smart contracts, thereby providing transparency and trust for industries such as agriculture and logistics.

NFTs

Smart contracts for NFTs organize ownership and transactions of digital assets such as art or collectibles, which are flourishing in the creative economy emerging in Kenya.

Voting

Smart contracts can establish secure, transparent voting processes that minimize the risk of election fraud.

Insurance

Smart contract automation only processes claims when conditions (i.e., an accident report) are fulfilled, and can do so simultaneously.

Medical

Smart contracts ensure patient records can be securely stored and accessed for better data privacy.

Top Ten Smart Contracts

Here are ten worthy smart contract use cases to prove this technological concept’s flexibility across industries.

1.  Uniswap (Ethereum)

a uniswap etherium smart contracts

Uniswap is a DeFi smart contract on Ethereum that facilitates decentralized trading of cryptocurrencies. However, there are smart contracts that crypto can use to perform trades and provide liquidity without intermediaries.

Intelligent contract automation means transparent pricing and instant settlements. The Uniswap model may encourage domestic innovative contract applications for peer-to-peer trading, but smart contract audits are necessary for investments in securing the applications.

2.  OpenSea (Ethereum)

OpenSea uses smart contracts for NFTs to enable the purchasing, selling, and trading of digital items such as art and collectibles.

Its smart contracts in Ethereum also handle ownership and royalties automatically, so creators get paid when NFTs are resold.

In Kenya’s rising creative economy, smart contract use cases such as OpenSea could give power to artists, but smart contract security is vital to thwart hacking.

3.  Compound (Ethereum)

Compound etherium smart contracts

The creator of smart contracts, crypto facilitates decentralized lending and borrowing on Ethereum.

They can stake assets to earn interest or borrow against collateral, with smart contracts automating calculations on interest rates and repayments.

This blockchain innovative contract solution could revolutionize the Kenyan microfinance scene, but fintechs have to ensure smart contract auditing for the sake of the CBK regulations.

4.  Aave (Ethereum)

d Aave etherium smart contracts

Aave is another DeFi smart contract on Ethereum, famous for flash loans, or uncollateralized loans that are paid back within the same transaction.

Its smart contracts support DeFi gems, such as yield farming. In Kenya, fintech lending could benefit from applications of smart contracts, similar to Aave, but solidified code for smart contracts should be audited for security and compliance.

5.  CryptoKitties (Ethereum)

Cats are digital tokens that live on the blockchain and can be bred and traded using smart contracts powered by NFTs.

The breeding mechanics and ownership transfer are done through smart contracts. In Kenya, this is a brilliant contract example that can also stimulate the creation of gaming or collectible platforms.

However, developers must trust innovative contract development services that promise reliable code.

6.  Chainlink (Ethereum)

e Chainlink Etherium smart contracts

Smart contracts on Chainlink serve as the oracles that bridge blockchains and the real world, such as running flight status data into an agreement with data like prices or weather.

This is what allows innovative contract applications such as auto insurance payouts. In Kenya, blockchain smart contracts, such as those provided by Chainlink, can improve agricultural insurance, but competent contract auditors are necessary to validate data integrity.

7.  Tune.fm (Hedera)

f tune.fm hedera smart contracts

Tune.fm leverages smart contracts on Hedera to pay musicians real-time royalties as the music is streamed. The intelligent contract automation of the platform guarantees a fair and transparent payout.

Smart contracts for such a use case in Kenya’s music industry can empower artists; however, smart contract security is key to securing funds.

8.  AllianceBlock (Hedera)

g Alliance block hedera smart contracts

AllianceBlock’s smart contracts bridge the gap between decentralized and traditional finance to allow for compliant asset tokenization.

If a Kenyan fintech can be made to work with an innovative contract blockchain solution, it may also tie Kenyan fintech into global markets, while smart contract auditing ensures it complies with all regulations.

9.  Axie Infinity (Ronin/Ethereum)

h axie infinity smart contracts

Axie Infinity is a smart contract based game played on the blockchain. Players breed, trade and compete with digital Axies, which appear as non fungible digital tokens (NFTs) within the game.

On the Ronin (Ethereum sidechain) smart contracts automate processes like Axie breeding; players pay with cryptocurrency to breed new Axies; the smart contract secures the transaction and the new Axie is minted as an NFT.

It also performs marketplace trades by transferring ownership and funds when a condition is met, all automatically so all trades are transparent and trustless.

For Kenyans, the use case of smart contract can serve to power homegrown gaming or NFT platforms on which creators can monetize digital assets, with a smart contract audit by a smart contract auditor necessary to protect against smart contract exploitation and make the smart contract secure.

10.      Stacks Escrow Smart Contracts

i stacks escrow smart contracts

Stacks escrow smart contracts make secure Bitcoin transactions by locking Stacks tokens until conditions are satisfied.

These Bitcoin smart contracts could be used for remittances in Kenya. Still, it is essential to complete audits of smart contracts, as even the slightest mistake for large financial transactions is disastrous.

Emerging Legal Issues for Smart Contracts in Kenya

Given the rise in fintech, blockchain, and smart-contract projects in Kenya, these developments raise some legal issues:

1.  Smart Contract Enforcement

Under Kenyan Law, an enforceable contract is formed by offer and acceptance of the same, due consideration, and mutual intention of the parties.

Smart legal contracts (enhanced traditional blockchains with code-based sections) might satisfy that condition, but “pure smart contracts” (code-based only) seem questionable.

Smart contracts are still not determined to be enforceable by Kenyan courts because they do not have a human signature or a traditional signature.

To fix this, fintechs in Kenya need to:

  • Smart contracts need to have well-defined terms based on Kenyan contract law.
  • Leverage smart legal contracts that combine code and written agreements for legal certainty.

2.  Regulatory Uncertainties

Kenya’s regulations around blockchain are still in a stage of evolution. The Capital Markets Authority (CMA) and the Central Bank of Kenya (CBK) have not yet given regulations towards smart contracts and blockchain technology. Key uncertainties include:

KYC/AML Compliance

Smart contract crypto also has to adhere to Kenya’s AML and KYC laws.

Tax

Income generated with the help of smart contracts (like in Bitcoin smart contracts or Ethereum smart contracts) could potentially be taxed as capital gain, although there is no clear answer.

Consumer Protection

Fairness is assured by smart contracts to prevent disputes, a particularly relevant consideration for smart contracts in real estate and DeFi smart contracts.

Fintechs can prepare by:

  • Working with regulators to correlate innovative contract applications to current regulations.
  • Audit of Smart contracts for compliance and security.

3.  Dispute Resolution

Compatible with Bitcoin, Ethereum, and other blockchain networks, smart contracts are programmed with arbitrary coded logic that cannot be modified once deployed to a network.

This presents an issue if there are disputes, as Kenyan jurisdiction may not uphold the brilliant contract results.

For instance, if a bug in the solidity code of a smart contract triggers undesired events, it will be difficult for the courts of law to handle such disputes.

Fintechs should:

  • Have dispute resolution in the smart contract.
  • Collaborate with professionals in smart contracts for sound code and audit quality.

4.  Security and Auditing

Good smart contract security is necessary, as mistakes can cost money. In Kenya, the importance of smart contract audit lies in revealing weaknesses.

They hire a competent contract auditor to review the code and ensure it’s safe and works. Cardano ZK smart contracts (for example) are less transparent to the public (use zero-knowledge proofs), which makes it even more critical to be audited.

Below are some ways in which Fintechs can make smart contracts more secure:

  • Engaging a trustworthy, competent contract auditor who will provide meaningful code inspection.
  • Leveraging libraries such as OpenZeppelin in the course of innovative contract development.

How To Legally Prepare If You’re A Fintech In Kenya

Blockchain and smart contracts

For fintechs to navigate Kenya’s legal labyrinth, they ought to:

Involve Lawyers

Engage with lawyers experienced with/blockchain and smart contracts to ensure that the solution trades within the boundaries of the Kenyan legal framework.

Audit Smart Contracts

By auditing the smart contract regularly, you establish that the contract complies with code, eliminating potential legal issues.

Keep up with the Regulation

Look for announcements from the CMA, CBK, and international organizations such as the Financial Action Task Force (FATF) to guide you in smart contracts crypto.

Educate Stakeholders

Provide training on smart contracts explained for employees and customers to create trust and confidence.

Leverage Smart Whales and Smart Contracts

Utilize smart and hybrid contracts that are legally connected as much as possible to allow for enforceable contracts in Kenyan courts.

Smart Contract Platforms

Many blockchain smart contracts are enabled by innovative contract platforms such as:

  • Ethereum: A demystified overview of the most popular platform for Ethereum smart contracts and smart contract solidity.
  • Cardano: Famous for Cardano ZK smart contracts – scalability and privacy.
  • Stacks: Bring Bitcoin smart contracts and Stacks escrow smart contracts to your app.
  • Hyperledger Fabric: Best for private enterprise blockchains.
  • EOS: Provides fast processing speeds for smart contracts.

Each platform has unique features, and Kenyan fintechs must choose based on what is important to them, whether it be scaling up an app or the cost.

Smart Contracts and AI

AI smart contracts merge artificial intelligence and smart contracts to form more intelligent, agile contracts. For instance, AI might process data to drive intelligent contract automation, such as updating loan terms based on market conditions.

AI smart contracts could transform microfinance in Kenya through automated credit scoring and repayment.

Conclusion

Kenya is entering a new age of fintech based on smart contracts, which are becoming key in achieving efficiency, transparency, and security in fintech in the country.

Smart contracts range from real estate smart contracts to DeFi smart contracts. Nevertheless, it does require careful planning because of legal risks of enforceability, regulation, and dispute resolution.

Smart contract auditing, consulting with legal experts, and keeping up to date with rules are ways that Kenyan fintechs can utilize blockchain and smart contracts to minimize risk.

It does not matter whether you are delving into Ethereum smart contracts, Cardano ZK smart contracts, or Stacks escrow smart contracts; the future for smart contracts is promising in Kenya. Ready to get started? We can do that for you. Contact us.

FAQs

What do smart contracts mean?

They are self-executing code on a blockchain and will execute the terms of an agreement upon certain conditions. They are secure, transparent, and do not require intermediaries.

Can smart contracts be enforceable in Kenya?

They currently have no clear legal framework for smart contracts in Kenya. Also, hybrid smart contracts, one foot in the law and another in computer code, will likely enjoy enforceability.

How do I go about hiring a competent contract developer in Kenya?

There are competent contract developers on the likes of Upwork, local tech hubs, or local firms that offer innovative contract development services in Nairobi.

Why is it so important to audit smart contracts?

An innovative contract audit guarantees the code is safe and error-free, which guards against losing money and facing legal actions.

What are the use cases of smart contracts in Kenya?

Some potential use cases for smart contracts could be in real estate purchases, DeFi lending/borrowing, supply‐chain tracking, and NFT (Non­-Fungible Token) marketplaces.

Written By:

James Chepchieng

Advocate of the high court of kenya

SHARE
Facebook
Twitter
LinkedIn