“Ethereum- Smart Wedding Contract”

In our following post, we will go through the technical implementation details of our “Smart Wedding Contract”. This is the prototype model and this is not a full-featured product.

“Are you more interested? Let you can read about it.”

Intro to This Topic:

Here the project is built by truffle framework and we are using web3 for the front end and metamask is used to communicate the ethereum blockchain.


The old marriage contract handles all required functionality that manages the funds and assets. Nowadays we want to make it digital by the way it handles dynamic management of funds and assets.

Deployment of Contract:

First of all to add the spouse wallet addresses (ie) constructor argument to the contract. This is the best way to do it because these addresses never changed.

Upload the Contract:

Why do we upload a written contract while we create a superior digital version?

One of the main reasons is the work is under the legal context. If there is no connection to a plain written legal document.

In the old way, the written contract is signed by hand and this is uploaded as a PDF.

Let us assume by paying for a small file you spend $20+, suppose you want to upload a bigger file. What will you do? Here it costs 100 not 1000 dollars. While storing the file on ethereum, we store only the hash of the file on the blockchain.

Signing up the Contract:

The Smart Wedding Contract is an unsigned state while successfully deploying the contract by uploading the IPFS hash.

To invoke the functionalities the spouses first sign it by using their private keys. And it checks the state of the contract before an invocation. The sign contract function is called by the spouse.


A car, house, or even stock is called an asset. Here one of the main things is managed by a marriage contract and some of the following questions clarify.

  1. What happens after getting a divorce?
  2. Who owns what?

Smart contracts enable dynamic asset management. There are any changes in this contract that must be confirmed by a notary.


When does a marriage contract exist? After divorce what happens?

Here the divorce function is invoked by a spouse. Both are agreed to divorce the contract is changed into the state of divorce. And the remaining funds are split in half and are sent to each party.

The contract state is changed into divorced, there is no more interaction in the contract anymore. There is a Not Divorced modifier, the critical function is added and they ensure nothing will be changed later.

Adding Asset:

One of the spouses needs to propose it, to add an asset. Another one needs to approve it. By using this function here a new asset gets created by the spouse. There is a suggestion to add the asset and immediately approve it.

Approving Asset:

When the contract is signed the assets are approved in the same way. It gets added when both of the spouses agree to add it.

Removing an Asset:

To remove assets both parties agree to remove them.


Many events are made and used by a Dapp(Decentralized Application). In every situation, they are emitted to create a proper log and what happened for the frontend application.






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

Recommended from Medium

How Blockchain Solves Food Supply Organisational Issues

Lytix MaxNode Ecosystem

Month at a Glance — August

How Blockchain Adoption is Expanding Beyond Financial Services

Brú Finance: Early Community Member Pass (ECMP)

Bru Finance: Early Community Member Pass

Neurochain smart contract

BSC Launcher upgraded Tier List

Tokenize This: Week 58 ~ Tokenization for Asset Leasing

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



More from Medium


Ways to Verify the Authenticity of SFIL’s Self-owned Filecoin Hash Power

About $ZIL: Minting NFTs on the Zilliqa Blockchain

Where it all started: BTC

It has no single point of control, relies on no central authority, and cannot be frozen, counterfeited, nor seized by government authorities.