# Social Attestations in Friend.Tech

### Table of Contents

## Social attestastion

In the context of social attestations, attestation refers to the act of affirming or asserting the truth, validity, or authenticity of specific characteristics or qualities of an individual. For example, if person A attests that person B is an expert in a particular field, they are essentially vouching for their expertise based on their knowledge or experience.

## Attestations as backlinks

Social attestation can be modeled as backlinks. In the ad industry, the more backlinks a website has, the more valuable it must be, as multiple websites point to that. In the ad industry, backlinks are crucial to Search Engine Optimization (SEO). Search engines like Google use backlinks as a way to gauge the credibility and relevance of a website. When a website has a high number of quality backlinks, it signals to the search engine that the content is valuable and trustworthy, thus improving its ranking in search results.

Backlinks work on the principle of âreferral trafficâ. When a website links to another, it directs its visitors to the linked website. This referral traffic can significantly boost the visibility and reputation of the linked website.

However, not all backlinks are created equal. The value of a backlink is determined by the authority and relevance of the website it comes from. For instance, a backlink from a well-known and respected website in the same industry carries more weight than a lesser-known website in a different sector.

In essence, backlinks serve as a form of âsocial proofâ that validates the credibility and authority of a website, much like how social attestations validate the claims about an individual in our context.

The same can be said for humans. The more people vouch about someone, the higher their reputation and trustworthiness is.

Everyone will point to Vitalik as an âEthereum founderâ or âEthereum expertâ.

At the same time, backlinks can be weighted by the Gravitas of the origin: If Vitalik says that Odysseas is an âethereum expert,â that is more valuable than Odysseas saying the same thing about Vitalik.

## Formalization

Letâs try to create a model out of this simple premise.

We will model two quantities:

- Gravitas: The reputation a person has. It is general about a person. You can think of this as a
*Node*in a graph. - Claim: An attestation from a specific person to another. It is specific about a domain. You can think of this as an
*Edge*in a graph.

Thus, every person has a *Gravitas* produced by other people making *Claims* about that person.

### Gravitas

Gravitas \(G\) can be modeled as the linear combination of Claims \(C_y\) where \(y \in [1, ..m]\).

\[\begin{equation} G = \sum_{t=1}^{m}C_y \label{eq:gravitas} \tag{1} \end{equation}\]### Claims

Letâs redefine a Claim as a function of two variables:

- the Gravitas of the person who makes the claim
- the weight of the claim itself

We can denote a Claim or attestation about a proposition \(i\) as \(C_i\), where \(C_i\) is a function of the Gravitas \(G_p\) of the person \(p\) making the claim and the weight \(w_i\) of the claim itself.

\[\begin{equation} C_i = f(G_p, w_i) \label{eq:claim:generic} \tag{2} \end{equation}\]Finally, letâs assume that the relationship is a harmonic mean^{1}:

These weights determine the relative importance of Gravitas (\(G_p\)) and the weight of the claim (\(w_i\)). If you want the weight of the claim to be more critical, you could set \(q > p\).

The weight of the claim can be modeled as a stake. A stake signals the certainty of the person making the claim about the claimâs veracity. One could imagine that if the claim is incorrect, the stake is lost, or the stake provides some yield if the claim is correct. Letâs denote the stake as \(s\).

Letâs denote the weight \(w\) for a proposition \(i\) as \(w_i\), which is a function of the stake \(s_i\).

\[\begin{equation} w_i = g(s_i) \label{eq:weight} \tag{4} \end{equation}\]From \(\eqref{eq:claim:specific}, \eqref{eq:gravitas}, \eqref{eq:weight}\) we have:

\[\begin{equation} G = \sum_{\substack{i=1 \\ i \in \mathbb{Z}}}^{m} \frac{p + q}{\frac{p}{G_p} + \frac{q}{g(s_i)}} \label{eq:final} \tag{4} \end{equation}\]### Social Gravitas

We can introduce a scaling factor, termed as *social Gravitas* (\(G_s\)), essentially a function of *unique claims* and *unique claimers*. The concept behind this is that the more unique claims a person has, and the more unique individuals make these claims, the higher the social Gravitas of the person.

Mathematically, we can represent social gravitas (\(G_s\)) as the sum of unique claims (\(uc_i\)) and unique people who claim (\(up_j\)) as follows:

\[G_s= \sum_{i=1}^{n} uc_i + \sum_{j=1}^{m} up_i \label{eq:social_gravitas} \tag{5}\]To turn the social Gravitas into a scaling factor for the Gravitas, we can introduce a new parameter, letâs call it \(\alpha\), which will control the influence of social Gravitas on the final Gravitas. The value of \(\alpha\) can be between 0 and 1. If \(\alpha = 0\), social Gravitas does not affect the final Gravitas, and if \(\alpha = 1\), social Gravitas fully determines the final Gravitas. The influence of social Gravitas on the final Gravitas is proportional to \(\alpha\).

\[\begin{equation} G = (1 - \alpha) \cdot G + \alpha \cdot G_s \quad \text{where } 0 \leq \alpha \leq 1 \tag{6} \label{eq:gravitas_with_social} \end{equation}\]## Bonding Curves

Bonding curves are mathematical models defining a relationship between a tokenâs price and supply. As more tokens are bought, the price increases, and it decreases when tokens are sold. This creates a predictable price-supply relationship.

For instance, a linear bonding curve can be represented as:

\[\begin{equation} currentPrice = m \cdot supply + c \end{equation}\]Here, \(m\) is the slope, and \(c\) is the y-intercept. If \(m = 0.01\) and \(c = 0\), the price of the first token is 0; the 100th token is 1, and so on. This rewards early participants as the token price increases with supply.

The shape of the bonding curve impacts the token economy dynamics and should be chosen based on the networkâs specific goals and characteristics.

## Friend.Tech

Friend.Tech is an old idea made new: convert your friends into liquidity no matter the cost.

It combines OnlyFans with Uniswap. You can issue personal tokens âkeysâ that people can purchase and access a private chat (or broadly get something of value from the token issuer â access, their time, etc.).

The trick is that the tokens are issued using a bonding curve, which rewards people for âdiscoveringâ people that they expect their tokens will be valuable in the future. In essence, you can go âlongâ for a specific person.

The idea is familiar, as it was initially introduced by bitclout^{2}, but for some reason, it never stuck. It seemed too scammy, and bitclout was poorly implemented as an alternative L1.

Friend.Tech chose to be deployed on Base^{3}, the OP stack L2 launched by Coinbase. It is equally cheap as bitclout, but it remains within Ethereum, leveraging network effects and the infamous âEthereum Alignementâ, which is an excellent way to say that people can easily ape into without setting up new tools/wallets.

### Bonding curve

In friend.tech, the bonding curve follows the following formula^{4}:

The buy-and-sell price relationship relates to the fact that higher share purchases increase the number of outstanding shares for a group.

The price follows the following relationship:

The buying price of ETH is given by the equation:

\[\begin{equation} P_{buy} = \frac{n^2}{16000} \label{eq:buy_price} \tag{7} \end{equation}\]where $n$ is the total outstanding supply, and 16000 is the scaling factor or constant selected by Friend. techâs economic model.

The selling price follows a slightly different relationship:

\[\begin{equation} P_{sell} = \frac{(n-1)^2}{16000} \label{eq:sell_price} \tag{8} \end{equation}\]Based on the equations, the difference between the buying and selling prices of shares should increase over time. However, the spread rate, equal to the (buy-sell/ selling price) x 100, should decrease. So when friend.tech grows, the spread rate will reduce, and only people with large accounts â more outstanding shares â will be better positioned to make profits.

There is a nice analysis of the math and more specific PnL equations (factoring in the fees) on Twitter by *@macrocephalopo_d* ^{5}.

## Using friend.tech for Attestations

In Friend.Tech, we have the price of the keys according to the bonding curve and give access to features (e.g, private chat). How can we use that quantity in our social attestations?

Letâs assume that *Alice* wants to make a claim \(C_1\) about *Bob*. She buys a number of keys \(k_1\) and stakes them on the claim.

Thus, the weight for the claim follows:

\[\begin{equation} w_1=P(k_1) \label{eq:weight_with_key} \tag{9} \end{equation}\]where \(P\) is the function that describes either the price at which the keys are sold, or the price at which the keys are bought. For now, we keep it generic over the price of the keys.

Thus, \(\eqref{eq:final}\) becomes:

\[\begin{equation} G = \sum_{\substack{i=1 \\ i \in \mathbb{Z}}}^{m} \frac{p + q}{\frac{p}{G_p} + \frac{q}{P(k_1)}} \label{eq:final_with_key} \tag{10} \end{equation}\]For simplification, we will remove the notion of multiple claims altogether and assume that we can only attest to the whole person, like vouching.

Now, \(\eqref{eq:final_with_key}\) becomes:

\[\begin{equation} G = \frac{p + q}{\frac{p}{G_p} + \frac{q}{P(k_1)}} \label{eq:final_with_key_simplified} \tag{11} \end{equation}\]Now, we have two options to analyse this further:

- We can define some staking functionality and say that for Gravitas to exist, users have to stake
- We define as
*Claim*the action of buying oneâs*keys*.

### Gravitas Calculation Without Staking

Without staking, the Gravitas is the cumulative total of all purchases.

When *Alice* purchases \(k_2\) keys from *Bob*, she implicitly makes a Claim with a weight equivalent to \(P(k_2)\), which adds Gravitas \(G_A^B\) to *Bob*:

and

\[\begin{equation} G_A^B = \frac{p + q}{\frac{p}{G_A} + \frac{q}{P(k_2)}} \label{eq:final_A_to_B} \tag{13} \end{equation}\]Similarly, when someone sells keys, they reduce Gravitas using the same mechanism, but this time, the weight is the price at which the keys are sold.

This relationship can lead to a net negative to Gravitas if the price at which they are sold is higher, which would make sense, as itâs a more powerful signal if someone decides to claim and then retract the claim. It implies that new information was added.

Endorsing someone and withdrawing the endorsement implies they did something significant enough for you to stop supporting them. Thatâs more negative than not endorsing someone in the first place (as you may not know them well enough to endorse them).

From \(\eqref{eq:gravitas_b_toned}\)

\[\begin{equation} G_B'' = G_B' - G_A'^{B} = G_B + G_A^B - G_A'^B \\ \end{equation}\]and replace \(\eqref{eq:final_A_to_B}, \eqref{eq:sell_price}, \eqref{eq:buy_price}\):

\[\begin{equation} \begin{aligned} G_A^B = \frac{p + q}{\frac{p}{G_A} + \frac{q}{P_{buy}(k_2)}} = \frac{p + q}{\frac{p}{G_A} + \frac{q \cdot 16000}{n^2}} \\ G_A'^B = \frac{p + q}{\frac{p}{G_A} + \frac{q}{P_{sell}(k_2)}} =\frac{p + q}{\frac{p}{G_A} + \frac{q \cdot 16000}{(m-1)^2}} \\ \end{aligned} \label{eq:gravitas_change} \tag{14} \end{equation}\]Where \(m, n\) are the keys at the moment of âsellâ and âbuyâ the key.

Thus:

\[\begin{equation} \begin{aligned} G_B'' = G_B + \frac{p + q}{\frac{p}{G_A} + \frac{q \cdot 16000}{n^2}} - \frac{p + q}{\frac{p}{G_A} + \frac{q \cdot 16000}{(m-1)^2}} \end{aligned} \label{eq:final_gravitas} \end{equation}\]This is still quite complex and if we solve it for \(m, n\), it is expanded into a complex quadratic function that is best solved numerically.

Letâs make some simplifications and see if we can arrive somewhere:

- Letâs assume that the user sold the key after some time, at which point the number of keys grew by 10.
- Letâs use the relationship that we know from \(\eqref{eq:claim:specific}\) about \(p, q\).

By substituting \(p + q = 1\) and \(m = n + 10\) into the equation for \(G_B''\), we simplify the equation significantly. This equation now represents the change in Gravitas for user B after user A buys a key and then sells it after the number of keys has increased by 10.

### Gravitas Calculation Incorporating Staking

To further refine our model, we need to address the following questions:

- What is the yield derived from staking, and its origin?
- What is the mathematical formula that will be used for staking?

Staking is a significant concept in this context as it conveys the following information:

I am confident in my choice for \(X\) amount of time

Essentially, by staking, we forfeit our option of selling the key for a specific duration, signaling our confidence in our âvouchâ for a certain period.

In the context of staking, let \(S\) represent the total staked value. This could be calculated as the product of the number of keys staked and the duration of the stake. The period of the stake is crucial as it represents the commitment of the staker to the person they are staking on. The longer the stake, the stronger the signal of confidence.

The staked value \(S\) could be represented as follows:

\[\begin{equation} S = k \cdot d \quad \tag{16} \label{eq:staked_value} \end{equation}\]In this equation, \(k\) represents the number of keys staked and \(d\) represents the duration of the stake. The product of \(k\) and \(d\) gives the total staked value \(S\).

This staked value \(S\) can then be used in the Gravitas equation as a new term that represents the influence of staking:

\[\begin{equation} G = (1 - \alpha) \cdot G + \alpha \cdot G_s + \beta \cdot S \quad \text{where } 0 \leq \alpha, \beta \leq 1 \tag{17} \label{eq:gravitas_with_staking} \end{equation}\]In this equation, \(\beta\) is a new parameter that controls the influence of staking on the final Gravitas. The impact of staking on the final Gravitas is proportional to \(\beta\). If \(\beta = 0\), staking does not affect the final Gravitas, and if \(\beta = 1\), staking fully determines the final Gravitas.

The next question to address is what the staker receives in return. Is there a yield and if yes, where does it originate from?

### Yield

Letâs examine the incentives:

**Without a yield**: The user stakes to boost their support for a person. The Gravitas of the person will rise as people stake the keys they have bought (thus locking them). The incentive here is*out of protocol*.**With a yield**: The user stakes for the above reason**and**there is an*in-protocol*incentive on top of it.

Letâs consider a simple scenario to illustrate the concept:

If staking provides users with a percentage of the fees that the key owner accumulates, the yield could be calculated as a proportion of the total fees collected by the key owner. This proportion could be determined by the ratio of the amount staked by the user to the total amount staked by all users.

Letâs denote:

- \(F\) as the total fees collected by the key owner,
- \(S_u\) as the amount staked by a specific user,
- \(S_t\) as the total amount staked by all users.
- \(S_a\) as the percentage of the total fees that the key owner wants to disperse to staked users

The yield \(Y\) for the user could then be calculated as follows:

\[\begin{equation} Y = \frac{S_u}{S_t} \cdot S_A \cdot F \tag{18} \label{eq:yield} \end{equation}\]### Staking Risks

There are two primary risks associated with staking keys:

**Smart Contract Risk**: This risk pertains to the potential vulnerability of the staking smart contract. In a security breach or hack, users may lose their staked keys.**Impermanent Loss**: This is a term used in the context of Decentralized Finance (DeFi) to describe the financial risk associated with staking. Impermanent loss occurs when the price of a staked token decreases significantly compared to when it was initially staked. As the user cannot sell the token while it is staked, they may incur a loss if the tokenâs price falls more than the accumulated fees from staking.

## Open Questions

### Seeding the System at t=0 When Nobody Has Gravitas

Starting a system where reputation (Gravitas) is essential, but no one initially has any, is a common challenge in reputation-based platforms. A few possible solutions come to mind:

- Bootstrap with a Known Set of Users: We could start by seeding the system with a group of users who are already recognized as reputable in related fields.
- Initial Self-Attestation with Verification: Allow users to self-attest certain qualifications or skills when they sign up, but couple this with a verification mechanism. For instance, users could link their LinkedIn profiles, academic credentials, or other verifiable sources that support their claims.
- Use of an Algorithmic Bootstrapping Method: Develop an algorithm that assigns initial Gravitas scores based on external factors like social media presence, previous work in the field (e.g., GitHub contributions for developers), or endorsements from other platforms.

### Calculating Gravitas with Changing Prices

The dynamic nature of token prices in Friend.Tech, particularly the fluctuating prices due to the bonding curve, adds complexity to the calculation of Gravitas. To manage this, consider the following approaches:

- Time-weighted Average Price (TWAP): Use a TWAP approach to calculate the average price of keys over a specific period. This method smoothens out price fluctuations and provides a more stable value for Gravitas calculations. Snapshot Method: Take periodic snapshots of the key prices and calculate Gravitas based on these snapshots. This method reduces the impact of short-term price volatility.
- Incorporate Price Volatility into the Model: Adjust the Gravitas calculation to account for price volatility. For example, we could modify the Gravitas formula to give less weight to attestations made during periods of high price volatility, as these might not accurately reflect the true value of the attestation.
- Locking in Prices at the Time of Transaction: Record the price of the keys at the time of each transaction (buying, selling, or staking) and use these locked-in prices for calculating Gravitas. This approach ensures that the Gravitas calculation reflects the economic reality at the time of the transaction.

## Assumption Summary and References

Here is a summary of the assumptions made in this model, along with references to the sections where each assumption is discussed:

**Gravitas as a Linear Combination of Claims**: The Gravitas of a person is a linear combination of the claims made about them. This is discussed in the â Gravitas â section and can be seen in equation \(\eqref{eq: Gravitas}\).**Claim Weight Determination**: The weight of a claim is determined by the Gravitas of the person making the claim and the weight of the claim itself. This is explained in the section titled âClaimsâ and can be seen in equation \(\eqref{eq:claim:generic}\).**Harmonic Mean Relationship**: The relationship between the Gravitas of the person making the claim and the weight of the claim is a harmonic mean. This is detailed in the section titled âClaimsâ and can be seen in equation \(\eqref{eq:claim:specific}\).**Claim Weight as Certainty Signal**: The weight of a claim signals the certainty of the person making the claim. This is discussed in the â Claims â section and can be seen in equation \(\eqref{eq:weight}\).**Key Pricing in Friend.Tech**: The price of keys in Friend.Tech is determined by a bonding curve. This is explained in the section titled âBonding Curveâ and can be seen in equations \(\eqref{eq:buy_price}\) and \(\eqref{eq:sell_price}\).**Buying Keys as Making a Claim**: Buying keys in Friend.Tech is equivalent to making a claim about a person. This is discussed in the section titled âUsing friend.tech for Attestationsâ and can be seen in equation \(\eqref{eq:final_with_key_simplified}\).**Selling Keys as Retracting a Claim**: Selling keys in Friend.Tech is equivalent to retracting a claim about a person. This is detailed in the section titled âWithout Stakingâ and can be seen in equation \(\eqref{eq:gravitas_change}\).**Staking Keys Boosts Gravitas**: Staking keys in Friend.Tech boosts the Gravitas of the person the keys are staked on. This is explained in the section titled âWith Stakingâ and can be seen in equation \(\eqref{eq:gravitas_with_staking}\).**Yield from Staking**: The yield from staking keys in Friend.Tech is a proportion of the total fees collected by the key owner, determined by the ratio of the amount staked by the user to the total amount staked by all users. This is discussed in the section titled âYieldâ and can be seen in equation \(\eqref{eq:yield}\).**Staking Risks**: The primary risks associated with staking keys concern the security of the staking smart contracts and Impermanent loss. These risks are detailed in Staking Risks.

## Future Work

This blog post describes how one could model reputation using a social platform like Friend.Tech. In the future, I want to write a reference implementation to calculate the Gravitas based on the formula described above and make a few simulations to discover the appropriate parameters for the use case.

It is also interesting to explore how Sybil resistance could play a part in this model, although Friend Tech solves this issue for us, as it requires a form of KYC via using X(Twitter).

If you would be interested in hacking the implementation, please reach out!