Monthly Update: The Stacks WiFi Ad Bidding System

StacksCity Project
8 min readFeb 12, 2019

--

The first month of 2019 quickly flew by. We had our annual yearend meeting where we saw how great a year 2018 was for StacksNetwork. And of course, the Stacks WiFi Ad Bidding System MVP was finally ready for alpha testing. We even had a secret mission (have a look here).

Last year, we talked about our vision of a secure interconnected world, with a smart city as a starting point. The first stage in the StacksCity project is the StacksCity public WiFi ecosystem, which also features an advertisement bidding system. We provide Stacks routers to brick-and-mortar businesses so they can offer free WiFi to customers. In exchange, we connect advertisers to the businesses that are frequented by their target audience through the ad bidding. Owners of Stacks routers get paid for the ad displays and Stacks receives a small commission. The ecosystem is supported by our experience and infrastructure in the internet industry and groundbreaking blockchain technology.

The ad bidding system is a good initial use case to achieve our vision as it presents various needs and challenges that connectivity and the blockchain can address. First, you have the constant demand of users for internet in public spaces. People are now more reliant on internet connectivity, and not just to access their social media. Connected devices also connect users to information they need on demand and to services they need. Stacks routers in public places will start with the ad bidding system but will not end there. In the future, they will also allow us to provide IoT services to users — for example, access to intelligent transport systems for commuters and drivers.

Second, businesses need to keep abreast of the changing advertising landscape. Digital and mobile trends mean it’s easier for businesses to release ads, and yet problems remain. Ad fraud is preventing businesses from reaching their target market and also siphoning off ad investment and potential revenue. Our choice of blockchain technology ensures fraud will be eliminated in our ad bidding system. And in terms of ads reaching their target markets, Stacks routers provide location-based ad choices, among other consumer segmentation.

The Stacks Wi-Fi Ad Bidding System is truly promising and that’s why we are excited in its development. We have set up all the components and flows in the system. Read on to become more familiar with the project.

What is the WiFi Ad Bidding System ?

The WiFi Ad Bidding System is an ecosystem built on top of the blockchain where internet users will get free WiFi. Places of business and other public areas will provide WiFi through the StacksRouter. Advertisers will compete with each other and try to place the highest bid to show their advertisements on the WiFi login page. The routers get paid to show the ads and Stacks receives a commission for providing the ecosystem.

What is the technology used by the system?

Our experience and current infrastructure in the areas of ISP, IDC and transmission enable us to create a secure and robust ecosystem for the public WiFi. The innovation for the WiFi Ad Bidding System is our use of the blockchain. Blockchain technology is being used to store the bidding information and to automate the funds transfer as the ADs are being displayed.

The reason we chose blockchain is because it’s a decentralized platform where the power does not reside with a single person or party. Blockchain is also used to secure the transactions and to automate the funds transfers to routers, advertisers and the Stacks system with the help of smart contracts.

We chose the Matic network to be the blockchain on which our system will run because of its fast and extremely low-cost transaction time. It offers tracking accounts and events in real time, allowing the WiFi Ad Bidding system to be updated and funds transferred in real time.

Who and what are involved in this system?

The ecosystem has several components:

Stacks: Stacks represents Stacks City, who provides the ecosystem for advertisers to place AD bids and for routers to get tokens in exchange for showing advertisements.

Router: Router represents the actual routers placed within the network who is providing the internet services to the WiFi users. The Router receives SCT tokens in exchange for showing ADs on its login page when a WiFi user first connects to the network.

Advertiser: Advertiser uses the platform to display his advertisements in an accurate and transparent manner. Multiple advertisers will compete to display their ADs first by placing their highest bids on a router.

Stacks Token: Stacks Token (SCT) is an ERC20-standard-compliant token which is used as the ecosystem’s currency. Tokens are needed to place ad biddings and routers are incentivized by being given Stacks Tokens for displaying ads. The smallest unit of the SCT token is called “citi” and 1 SCT = 10¹⁸ citis.

Bidding: Bidding represents the data structure used to store information related to bidding like totalBudget, perDisplayAdPrice, advertiserId, routerId, advertiserAddress, etc.

Bidding Manager: Bidding Manager is the smart contract providing methods to perform operations like place new bidding, approve bidding, cancel bidding, reject bidding, increment ad view count, and lock tokens. It also restricts the method access to specific actors in the system, for example, only the Stacks owner account can approve any pending bidding, reject a bidding, or increment the ad view count, or only the advertiser account can place new bids in the system for approval.

Bidding Storage: Bidding Storage is the smart contract which acts as storage for bidding-related information. It stores all the information on bids, routers, advertisers and Stack owner accounts. It provides methods to register new advertisers, routers, and Stack owners and to query any existing bidding information to check its status.

Locked Token Holder: A percentage of the total SCT tokens is allocated to the company, team members and advisers, and key token holders. The allocated tokens are locked for a period of time and unlock depending on the set schedule for the token holder. The locked token holder is the time-locked token holder smart contract, which can lock the tokens transferred to it for a given amount of time and, after the lock period, unlocks to allow the beneficiary to claim the tokens in his account. At the time of token creation, the beneficiary address and release time are given to the contract and, to lock the tokens, they need to be transferred to the TimeLockedToken smart contract.

How does the system work?

Deployment

When the smart contracts are deployed on the blockchain, the account from which deployment is done becomes owner of the contract and owner of all the SCT tokens. One address is initialized as Stacks owner, who has special permission to add/remove advertisers, routers, approve/reject bids, and increasing ad view count.

Registration for Advertisers, Routers and Stacks owners

After the deployment, advertisers and routers need to register themselves on the blockchain using the BiddingStorage smart contract. Also, more Stacks owner addresses can be added so as not to rely on a single Stacks owner account to perform administrative actions.

New Biddings by Advertisers

With the system in place, advertisers can start bidding. They need to buy SCT tokens and use them to place new AD bids on any of the routers available. Bidding includes the total budget of bidding in citis, per display ad price in citis, bidding id, router id, advertiser id, and advertiser address. Initially, the bidding will be in pending state while waiting for the approval to go live in the system.

NOTE: The advertiser also needs to allow the BiddingManager contract to transfer SCT tokens from the advertiser account to a bidding wallet address in order to lock the total deposit of bidding.

Stacks Approval/Rejection of Pending Biddings

Once there are pending bids, Stacks will check the pending bids manually and either approve or reject them as per the Bidding AD content.

After the Bidding is approved, it becomes live on the network and the AD will start showing on the WiFi login page as per the total budget of bidding.

If bidding is rejected by Stacks, all bidding tokens are transferred back to the advertiser address.

Incrementing AD view count

PS: Before incrementing the ad view count, the Stacks accounts need to register themselves as bidding stakeholder in order to increment the ad view count successfully.

After the advertiser’s bidding is live and the AD starts showing on the WiFi login page, the AD view count will increase after each AD display.

On the login page, if it’s the WiFi user’s first time, he needs to register and log in to his Portis account and then the increment AD view count transaction is originated from the login page using the user’s Portis account.

The transaction is then relayed to the network using the Stacks account so the transaction fee is deducted from the Stacks account and not the user’s account.

On each increment of the ad view count, tokens are transferred from the bidding contract to the router account as reward for showing the AD on its login page and to the Stacks account as commission.

Token Locking

In order to lock a percentage of the tokens for a specific period of time, an instance of the TokenTimeLock smart contract needs to be created with the beneficiary address and release time, and then the tokens are transferred to the smart contract address.

Once the lock period is over, the tokens can be claimed by calling the release method of the smart contract. Although any address can call the method, the tokens will be transferred to the beneficiary account only.

How does the SCT Token flow throughout the system?

Here’s a diagram that shows how the tokens flow in the system from one address and action to another.

Initially, all the tokens reside in the owner account from which deployment was done.

Tokens are then transferred to different multisig wallets for different purposes within the Stacks system.

One of the wallets is for selling tokens to advertisers so advertisers can buy the tokens and use them to place the bids.

After the advertiser buys the tokens and places the bids, tokens are then transferred from the advertiser address to the Bidding Contract wallet address, where tokens will remain until the AD starts displaying on the WiFi login page.

As the ADs are being displayed, the tokens are transferred from the bidding contract wallet address to the router’s account and to the Stacks wallet as commission.

If bids created by the advertisers are rejected, the tokens are then transferred back to the advertiser’s account from the bidding contract wallet address.

Our ecosystem is fully designed and the platform is now under testing. If you want to learn more about it, read our pitch deck here.

Visit our various online channels: Website | Bitcointalk | Twitter | Telegram | Facebook | Bounty

--

--