TLDR:
Friend.Tech (FT) has taken over the Web3 space’s collective attention, there’s even more trading volume in FT “keys” (ie. their tokens) than in NFTs.
FT keys (also known as shares) give access to token-gated channels of other users on the platform in this still very new and experimental app.
FT uses the Base blockchain to handle ETH and tokens, and makes it super easy to bridge or on-ramp into within the app, so people can get started quickly.
The contract is surprisingly innovative and elegant with only 210 lines in total and no obvious way to “rug” people. Plus its already amassed over $40m+ in ETH!
Price of keys are set algorithmically through a bonding curve in a 4-line function! There’s no liquidity problems since you can buy/sell directly with the contract.
The contract follows no token standards, so keys are neither ERC20s, ERC721s, or any other model we’re used to. Yet they are similar to a new ERC20 per user.
The elegance and simplicity of the contract reminds me of the CryptoPunks. As with the Punks perhaps new standards will form from this model.
We’re deep in a crypto bear market right now and as interest has waned we’ve seen NFT sales volume tank. In fact just last week an article cropped up showing that over 95% of all NFTs have become worthless.
Personally I’m not surprised as I’ve seen how bull and bear markets play out in crypto and even wrote about it earlier this year. In the bull we get an overabundance of speculation while in the bear most of the “junk” gets cleared out.
What has surprised me recently though is the current narrative around “Friend.Tech” a DeSo (decentralised social) platform, that’s already become the talk of the town. So today I wanted to look deeper into the technical web3 side of the platform to clarify just how it really works and what exactly Friend.Tech’s tokens are - is this an innovation or a scam?
Friend.Tech
Friend.Tech (FT) is the latest hype in the Web3 world. It’s taken over a big part of Web3’s collective attention over the past few weeks and everyone’s talking about it.
Trading volumes of Friend.Tech tokens, which they call keys, have been growing steadily since the project was launched over a month ago.
What’s been surprising is just how much FT keys have outperformed NFTs in trading volume, as NFT trading has fallen to levels before the 2021 bull run.
A quick summary of Friend.Tech is that it takes X/Twitter profiles and creates token-gated private channels, so you need buy the person’s token to speak with them. Its a bit like OnlyFans meets crypto but without the 18+ content.
For a deeper understanding I recommend Zeneca’s recent newsletter on FT.
What I want to look more at today though is what these FT tokens are from a technical standpoint.
Keys / Shares
FT calls their tokens “keys”, although it previously called them “shares” as you’ll see later in its smart contract. People can buy and sell keys from the platform but cannot directly trade them with one another.
As a side note, I personally think keys are a bad choice of name since in crypto we use “private keys” to store our assets so this naming can be pretty confusing.
Either way, one of the main reasons FT has been so successful is that every successive purchase of a “key” raises the price of it following what is known as a bonding curve, which you can just picture as an algorithmic curve that determines the price.
This means if you buy a “key” early and others buy it too, then yours will go up in price and you can sell at a profit. But if others sell their keys then yours will drop in price and you’ll be left holding the bag.
If that sounds a bit like a ponzi, then you’re right because it is! And if you haven’t noticed, much of the Web3 space love playing with fire with a good old ponzi-scheme, until it collapses and everyone gets burnt!
Add on the fact that there’s a clear incentive for Web3 influencers to talk about it because whenever someone buys one of their “keys” they take a cut on that sale, and you have the ideal recipe to garner Web3 attention.
There have been previous attempts to build similar DeSo networks like Bitclout and Steemit but honestly this is probably the most interesting one. Regardless of whether these ponzinomics will survive into the long-run, Friend.Tech is definitely an innovative and compelling experiment.
The App
Friend.Tech is very much still an experiment. You need to be invited to join the beta and the desktop/mobile app is clearly still work in progress. When you open the app for the first time it asks you to log-in with your X/Twitter account for it to assign your profile and keys and then you can explore its currently still pretty basic interface.
To handle crypto FT makes use of the Base blockchain, which is Coinbase’s recently released EVM-based L2 blockchain built using Optimism’s OP stack. Its super simple to bridge ETH into and has super low fees.
This means its really easy to get started buying and selling keys on FT. Even for Web3 newbies who don’t own any ETH they can buy ETH directly through the app using a third-party on-ramping service and then buy a key with that ETH.
Interestingly, FT also circumvented the Google Play and App Store by creating a PWA (progressive web app) that can be donwloaded directly from their website to your phone. So they bypass Apple’s somewhat prohibitive rules on in-app purchases.
With all this said we can now finally take a look at the most interesting part, namely what’s actually going on under the hood on the blockchain, and what people are actually trading when they buy and sell these “keys”.
The Contract
We can find the FT smart contract living at the following address on the Base chain:
https://basescan.org/address/0xcf205808ed36593aa40a44f10c7f7c2f67d4a4d4#code
The first thing to note is that the contract has accrued an impressive $40m+ in ETH!
Also the creator of the contract, FT themselves, have amassed $14m+ in ETH:
https://basescan.org/address/0xdd9176eA3E7559D6B68b537eF555D3e89403f742
Considering the contract was only created 47 days ago from when this post was written, whichever way you look at it, this has been an awfully successful beta for FT.
A quick glance at the smart contract itself is also very interesting.
The first and most glaring point is that its actually a relatively simple contract with the entire file being only 210 lines long! And up until line 126 its just a couple of imports and the “FriendtechSharesV1” contract is therefore only really 84 lines long!
I was personally surprised to find just how short and elegant the code really is.
Unruggable
The “FriendtechSharesV1” code looks so simple that at first I was a bit shocked to find no “withdraw” function to pull the money out of the contract. However, by looking further into it I realised that this was a feature not a bug.
There’s in fact only really two functions at play here to interact with the contract, which are buyShares() and sellShares(). These two functions are the only way any money comes in or out.
You can picture that right at the start there was no money in the contract and as people bought and sold shares (note that we’re using the terms keys and shares interchangebly here), the contract slowly accrued more money.
Just as the $40m+ in ETH came into the contract from people buying shares, the only way for that ETH to leave would be if everyone sold off all their shares until there were none left and the contract paid everyone out.
Since buying and selling shares are the only way money comes in and out, and there’s no way in the code for the FT team to “withdraw” all the funds and just jump ship, we could say the the code is in essence “unruggable”.
This is obviously really good and honestly surprising to see.
As shown in the buyShares() function above, the only method by which money leaves the platform is when the code pays out the “sharesSubject” and “protocolFeeDestination” accounts with a % fee of the amount in the transaction.
This happens both in buying and selling shares and currently the fees are set to 5% each.
The only conceptual way FT could still rug everyone is by changing these %’s as they can be tweaked with the setProtocolFeePercent() and setSubjectFeePercent() functions, although at this point with their growing success it seems unlikely.
Price
The price of a given share is also elegantly calculated in the 4-line function getPrice().
Essentially this function encodes a couple of equations that set a share price through a bonding curve, which is nothing more than a mathematical construct that describes the relationship between price and supply of a token. If you’re interested in bonding curves you can learn more about them here.
Its this code that makes the price go up every time a new share is bought and go down whenever its sold, and this equation is simple enough that a spreadsheet has already been created to model all the possible prices of up to 250 shares.
There are 4 supporting functions built on top of getPrice() to give the price in the different scenarios within the buyShares() and sellShares() functions, but the price-setting magic really happens in the function above.
Whether this method and choice of bonding curve will work well in the long-run is something that only time will tell.
However, its an incredibly elegant solution as its only a few lines of code to describe an infinite possiblity of prices. Plus since token price is pre-programmed, rather than handled by the market, there’s always a buyer and a seller and you don’t need to worry about whether there’s enough liquidity when it comes to selling.
This neatly brings us to the next question, what even are the tokens being traded here?
What are these tokens?
The “FriendtechSharesV1” contract doesn’t follow any token standards at all. So shares are not ERC20 tokens, nor are they ERC721 NFTs, or any other token standard out there.
Since they don’t follow standards, you cannot trade them on fungible token exchanges like Uniswap or Sushiswap nor can you trade them on NFT exchanges like Opensea or Blur.
So what are these tokens?
The fact that these tokens don’t follow standards means we can’t map them into our current models. Yet of course these are still assets created with the Ethereum Virtual Machine through Solidity code and being traded regularly like any other token.
Taking a look at the code we see the tokens are stored with the following mappings.
In the sharesSupply mapping each “subject” (ie. user in the app) has a personal supply of shares that grows or shrinks based on the buying and selling of them.
And in the sharesBalance mapping every “subject” also has a list of every account that’s bought some shares in them and how many shares each account owns.
Therefore, you could probably conclude that these are kind of like an infinite number of fungible tokens per user, that are non-fungible between each user. A bit like if we had a new ERC20 created per user with a non-fixed supply.
But as we said before, you cannot trade them with other people directly so they are not like the standard fungible and non-fungible tokens we’re used to either.
This makes the whole FT share system genuinely very interesting and innovative. Its not something that the Web3 space has really seen before, at least not at this scale. And perhaps in time a new standard of its own will even be formed for this type of token!
Conclusion
Friend.Tech is a surprisingly elegant and innovative project in the Web3 space.
With its simple exterior I had originally discarded the project as just another ponzi-scheme in a space rife with them. However, when considering how its already amassed a large user-base, a lot of trading volume and a lot of money, in the depth of a bear market, its certainly something worth paying attention to.
Be aware though, that if you do own FT keys you’re holding neither a fungible token nor an NFT, and so you are putting money into very experimental code without clearly defined standards.
There’s no guarantee that you won’t lose all the money you put in!
Yet having said that, I was impressed with the simplicity and elegance of the Friend.Tech smart contract. Honestly, it even reminded me of the simplicity of the original CryptoPunk’s code, which I covered in the post below.
The CryptoPunks were a precursor to the NFT movement and also very experimental when they originally came out in 2017. They were one of the first great use-cases of NFTs on Ethereum and helped spawn the NFT standards as we know them.
So in the same way it may not be wise to knock Friend.Tech.
I can certainly imagine new token standards being created in the future from the learnings in Friend.Tech and can comfortably conclude this that FT is a real innovation not a scam!