ERC-Ad is a standard for low-latency, audience segmented, cryptographically verifiable digital asset engagement. ERC-Ad is how digital assets can unlock novel use cases and monetize the value sitting atop the decentralized internet.
ERC-721
ERC-Ad is built upon the capabilities of the ERC-721 token. It inherits its tokenized media capabilities and extends them visually with an audience targeted overlay. ERC-Ad works with any and all media.
To serve an ad, the ERC-Ad token overrides the tokenURI of the ERC-721 media, and is able to display alternative forms and functionality on top of this media.
The ERC-Ad token maintains merkle trees for both the audience segment, as well as the signers of the ad within the audience segment. This low-latency architecture can maintain gigabytes of viewership data within a verifiable 32-byte string.
Functionality
ERC-Ad extends the ERC-721 token with the following functionality.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IERCAd {
struct Ad {
string adURI;
string dataURI; // ipfs URI to views data
bytes32 signatureRoot; // merkleRoot of signers
bytes32 audienceRoot; // merkleRoot of target audience
}
function setAd(
string memory adURI,
string memory dataURI,
bytes32 signatureRoot,
bytes32 audienceRoot
) external;
function signAd(
uint256 id,
bytes32[] calldata proof
) external;
function displayAd(
uint256 id
) external view returns (Ad memory);
function hasSignedAd(
uint256 id,
bytes32[] calldata proof
) external view returns (bool);
function isInAudience(
uint256 id,
bytes32[] calldata proof
) external view returns (bool);
}
ERC-Ad Audience
ERC-Ad defines an audience as a collection of addresses. These addresses are packed into a merkle tree and surfaced within the token. The ERC-Ad token restricts signatures to senders within the audience. This opens a wide arrangement of use cases for the implementor of the standard.
Signatures
Signatures are kept and appended to the ERC-Ad token as wallets view & sign the ad. The signatures are stored in a merkle root on the metadata of the token, allowing proof that an address was in the audience and has signed the ad.
Cross-Chain
A core tenant of the Meh network is a low-latency network segmented by cross-chain wealth. We believe this is a powerful mechanism when coupled with cryptographic proof an address has engaged an ad.
We are working with several partners to provide a low-latency cross-chain ad infrastructure on the decentralized internet and ERC-Ad is another step towards this goal. We want this network to combine onchain wealth with real-world assets onboarding to private chains.
d/commerce
There are hundreds of use cases for tokens implementing ERC-Ad. We will demonstrate a single use case for the upcoming launch of meh.store. In this example, any address who signs an ad is paid 50,000 in Meh and is also added to a mapping to receive a 20% discount. This discount will be read from the meh.store contract and applied on checkout. We plan to launch it soon and have full ad-integration at the launch of our decentralized store.
Final Thoughts
As decentralized advertisers, any asset owner can build ads for segmented audiences, upload the audience to the token, then attract this audience to sign the ad with the value we are returning. This use case is a bit like a honey-pot, but that’s the point entirely. It can be anything you want it to be.
Since an ERC-Ad is an NFT, it can be sold, transferred, burned, and everything else you can do with an NFT. It can receive value in Eth or any other ERC-20 tokens and only the owner of the token can extract. You can program it to require payment to sign. You can deposit tokens into it and use cross-chain pricing to unlock only if certain conditions have been met.
The Meh team intends to submit this as an EIP draft. However, we are not really the box checking type, so if anyone is interested and has this skill, please contact us on twitter. We also plan to use this tech for a variety of bizarre use cases, so stay tuned.