# Introducing: Open Affiliates

By [Public Artifacts](https://paragraph.com/@publicartifacts) · 2023-10-05

---

How web3 can drive community-aligned growth
-------------------------------------------

[_Public Artifacts_](https://publicartifacts.xyz/) _is a social technology studio exploring community dynamics and public goods._

_This project builds upon our previous initiative,_ [_Codebacks_](https://mirror.xyz/publicartifacts.eth/CgjqE86lbdRHsz_kL2WbDZeW6YjL0Z0tL8rldJnKqWc)_, with the aim of using simple attribution methods to create better social dynamics between web3 developers, products, users, and communities._

### **Decentralized Frontends**

There are a number ideologically aligned and practical reasons why decentralized frontends are necessary in web3. Primarily, they reinforce a core promise of blockchains - _resilience_ - against censorship, single points of failure, performance bottlenecks, malicious actors, and even decaying projects and teams.

But frontends are also the experience layer of applications, with the ability to introduce decentralized applications to new audiences and users with experiences customized for them.

And yet, most decentralized frontends are developed out of crisis, not opportunity.

![In 2022, sanctions against Tornado Cash took down its primary frontend, spurring numerous "mirror sites" to support the use of the service. ](https://storage.googleapis.com/papyrus_images/88bef3007afd778d5db168e177a212f59650aaf7a783b54fb0e3c299a8d6e0d4.png)

In 2022, sanctions against Tornado Cash took down its primary frontend, spurring numerous "mirror sites" to support the use of the service.

### **Incentivizing Community Frontends for Distribution & Discovery**

**Open Affiliates** is a mechanism that allows dApps to reward community members who bring in new users. It borrows from now standard web1 growth paradigms of **referral systems** which incentivize users and the new entrants they bring in with benefits, and **affiliate programs** which reward 3rd party publishers for driving a sale, click or registration through their own audiences.

Here's how it works:

*   **dApps launch a rewards pool:** Any dApp, NFT project, marketplace, or DAO can maintain a rewards pool, which can be funded with ETH or any ERC-20 token.
    
*   **Optional referrer parameter**: The incentivized contract function like deposit, mint, etc. would have an optional referrer parameter.
    
*   **Anyone can stake to self-register as a referrer:** Any Ethereum address can register itself as a referrer for a dApp. The stake can be slashed for misuse.
    
*   **Referrers drive traffic from their own frontends:** Referrers host and distribute mirrored or custom interfaces, and build the end user transactions with the referrer parameter set to their registered address.
    
*   **On-chain rewards**: If a referrer is specified on a transaction and is registered, they receive a reward from a dedicated rewards pool.
    

See the [Github repo here for technical implementation](https://github.com/Public-Artifacts/openaffiliates).

Here is a generic example for a DeFi application enabling Open Affiliate deposit referrals:

       function deposit(uint256 amount) external {
            vault.deposit(msg.sender, amount);
        }
    
        function depositWithReferrer(uint256 amount, address referrer) external {
            vault.deposit(msg.sender, amount);
            uint256 reward = calculateReward(amount);
            referralRewardsPool -= reward;
            referrerRewards[referrer] += reward;
        }
    
        function calculateReward(uint256 amount, address referrer) internal view returns (uint256) {
            if (!registeredReferrers[referrer]) {
                return 0;
            }
            // Example: 1% reward
            return amount / 100;
        }
    

The first function shows that deposits can still work as expected, without a referrer.

The second function shows that, if a deposit specifies a referrer, it verifies that referrer is registered, and, if so, moves tokens from the rewards pool to the referrer’s claimable balance.

### **Versatility Across Web3 Applications**

The **Open Affiliates** system is versatile enough to drive new experiences and adoption through various web3 applications. For example:

*   **DeFi:** Incentivize alternate frontends, aggregators like [Idle Finance](https://idle.finance/), and structured products that drive new deposits for underlying protocols.
    
*   **NFTs**: Curators and other tastemaker sites, like [Dave Krugman’s](https://x.com/dave_krugman?s=20) [Allships](https://allships.co/) publication, can earn rewards for listing NFTs for mint on their sites
    
*   **Marketplaces**: Reward users for referring sales or new product listings.
    
*   **DAOs**: Encourage member referrals to grow on-chain communities like [Seed Club](https://www.seedclub.xyz/) and [SheFi](https://www.shefi.org/)
    
*   **Decentralized Social and Consumer Apps**: Reward alternate registration sites that bring new members to your platform.
    

### **Addressing Potential Abuse**

One challenge with such systems is the potential for abuse, especially Sybil attacks where one entity can act as both referrer and end user. dApps that reward temporary or reversible actions (like deposits) should be aware of potential abuse. Future implementations could incorporate lock periods, periodic snapshots, and other safeguards that have been developed to prevent rewards farming abuse. However, for permanent actions like mints and purchases, this shouldn’t be an issue.

### **Community-Aligned Growth**

**Open Affiliates** offers a powerful tool for dApps looking to incentivize community-aligned, and led, growth. By rewarding those who bring in new users, we can drive the decentralization and proliferation of web3 apps and experiences.

If you’re interested in testing an implementation, or in exploring these kinds of community dynamics, please [reach us in our DM’s.](https://twitter.com/publicartifacts)

[Subscribe](null)

---

*Originally published on [Public Artifacts](https://paragraph.com/@publicartifacts/introducing-open-affiliates)*
