Decentralized Advertising: Marketing for Web3

Daryoush Ghoreishi
4 min readNov 8, 2021

Advertisements are found everywhere from billboards to digital ad space on the websites we browse. They come in many shapes and form, however they all share a similar purpose of attracting new users or customers to the advertised product or service. Although there are plenty of forms of advertising located in the real world such as billboards and spots on newspaper magazines, today we are going to be focusing on exploring how Blockchain technology can be leveraged to create a decentralized digital advertising experience for websites.

If you are reading this article already, I will be assuming you are familiar with Blockchains such as Ethereum, Solana, and Cardano that support smart contracts. If you aren’t familiar with the concept of smart contracts, I would suggest viewing this video by Simply Explained on YouTube.

Photo by Joe Yates on Unsplash

To first determine how we would build a decentralized advertising network we need to identify all the users who would participate in it. I’m not too familiar with the official names for those who act in advertising, however for the purposes of this article we will define the following three participants.

  1. Advertiser: The individual or group who wishes to publish an advertisement onto the network.
  2. dApp: The website & smart contract supporting the network
  3. Host: The website that integrates the network to host advertisements

Because digital advertisements can come in many forms such as horizontal/vertical banners to videos, the main challenge for this project would be to ensure that we account for different types of advertisements. With that being said, our decentralized advertising network will support three types of advertisements.

  1. Vertical Banner
  2. Horizontal Banner
  3. Video

The actual advertisements themselves will not be stored on the blockchain. Instead, the deployed smart contract would store the HTTP links to the advertisement. The smart contract itself is simply going to keep track of the advertisement campaigns that are currently on the network. In order to do this, we will use a custom data structure for the campaign. Campaigns are an advertisement run that would be comprised of the following sets of information:

  • Budget: The amount of crypto allocated to the campaign
  • Resource Link: The link that will retrieve the advertisement
  • Content Link: The link that a viewer should be sent to upon clicking the advertisement
  • Resource Type: An integer (0–2) representing the resource’s type (Horizontal/Vertical Banner or Video)

The smart contract itself will keep track of all this campaigns by holding an array of campaigns and a counter for the number of campaigns currently in the array.

Once the advertiser has created their advertisement and hosted it on a server of their choice, they will then proceed to visit the dApp’s website. The website will allow them to connect their wallet to login and then manage their campaigns. They can enter in the needed information (Budget, Resource Link, Content Link, Resource Type) and submit the campaign data to the Smart Contract. Once the campaign has been rolled out to the smart contract through the dApp, advertisers will only be able to add additional funds to the campaign.

The next important part of the ecosystem would be the hosts. The hosts are individuals who run and operate websites. In order to get paid to host advertisements on their sites, the host will use a public JS module that they can embed into an area of their website. When the host website is loaded, the module will request information from the smart contract on the blockchain:

  • Number of Running Advertisements
  • Cost per view

The module will then generate a random number i in [0, Number of Running Advertisements) and request the data from the struct stored in campaigns[i]. where campaigns is the array holding the struct data for each listed campaign. At the same time, the smart contract will reduce the budget of the chosen campaign by the flat price paid per view. This number can be arbitrarily chosen by the developer of the dApp. If that advertisement’s budget reaches 0, or doesn’t have enough funds to continue being displayed, then the Module proceeds to randomly choose another campaign and load it to where the module was embedded on the website.

Although this was a very generic and simple explanation as to how we might create a decentralized advertising network on the blockchain, I hope that it was an interesting read. There are many factors to consider when designing such as network that can quickly complicate it. For example, what if we were to instead of having a fixed cost per view, allowed advertisers to submit their chosen bid per view with their campaign and then selected an advertisement with the bid per view in consideration? How do we monitor the advertisements to ensure that no laws have been broken? These are some questions that could be explored further and discussed for hours. Maybe I’ll try to create this in the next Hackathon I participate in, but for now I’m happy to simply share my ideas with the public.

--

--