# What is BitClout?

**BitClout is a new type of social network that mixes speculation and social media, and it’s built from the ground up as its own custom blockchain.** Its architecture is similar to Bitcoin, only it can support complex social network data like posts, profiles, follows, speculation features, and much more at significantly higher throughput and scale. Like Bitcoin, BitClout is a fully open-source project and there is no company behind it-- it’s just coins and code.

## Buying BitClout

The BitClout blockchain has its own native cryptocurrency, called BitClout, that you can use to do all kinds of things on the platform, including buy a new type of asset called [“creator coins,” discussed below.](/#what-are-creator-coins)

Anyone can buy the BitClout cryptocurrency with Bitcoin in minutes through the app’s built-in decentralized “atomic swap” mechanism, available on [the “Buy BitClout” page](https://bitclout.com/buy-bitclout). The supply of BitClout is capped at [approximately 10.8 million](https://bitclout.com/posts/7bf4cfb5a9328c0f42c74454479ce4f889938157ae8208ae9d8120bf5b0f3ffc), roughly half that of Bitcoin, making it naturally scarce.

## What are Creator Coins?

### Everyone Has a Coin

Every profile on the platform gets its own coin that anybody can buy and sell. We call these coins “creator coins,” and you can have your own coin too simply by creating a profile. The price of each coin goes up when people buy and goes down when people sell.

### You Can Buy Your Favorite Person’s Coin

To buy someone’s coin, you simply navigate to their profile and hit “Buy.” You can find someone’s profile either by searching for it or by visiting the creator coin leaderboard (shown below). Profiles for the top 15,000 influencers from Twitter have been pre-loaded into the platform, which means you can buy and sell their coins even though they're not on the platform yet. These “reserved” profiles have a “clock” icon next to their names, indicating the owner of the profile has not joined yet.

![](/files/-MeT7Mgp70hbXMP_aDIR)

### Tweet to Claim Your Profile

The owner of a reserved profile can claim their profile by navigating to their profile and hitting a button to Tweet their BitClout public key (shown below). When they do this, they gain full access to the account, as well as a percentage of the creator coins associated with their profile (see [Founder Rewards](/#founder-rewards)). Only the owner of the Twitter account associated with a reserved profile can claim it.

![](/files/-MYNimCRwwuDJZunCjO9)

### What Are Creator Coins Useful For?

Creator coins are a new type of asset class that is tied to the reputation of an individual, rather than to a company or commodity. They are truly the first tool we have as a society to trade “social clout” as an asset. If people understand this, then the value of someone’s coin should be correlated to that person’s standing in society. For example, if Elon Musk succeeds in landing the first person on Mars, his coin price should theoretically go up. And if, in contrast, he makes a racial slur during a press conference, his coin price should theoretically go down. Thus, people who believe in someone’s potential can buy their coin and succeed with them financially when that person realizes their potential. And traders can make money buying and selling the ups and downs.

The above being said, there are many other exciting opportunities for creator coins that we hope will be integrated in the very near future:

#### **The Stakeholder Meeting**

A creator can make it so that only people who own a certain amount of their coin can participate in the comments section of their posts. This forces anyone who wants to have a voice in that creator’s content to first align themselves with the creator by buying their coin. The alignment not only reduces spam significantly, but it could bias conversations to be significantly more positive than on existing platforms. It would also create a lot of demand for one’s coin-- can you imagine if Elon Musk or Chamath did an AMA with a minimum threshold for buying their coin in order to participate? Or if they answered questions in order of coin holdings?

#### Premium Messages

Most creators get a torrent of spam in their message inbox on social media. With BitClout they could make it so that only people who own a certain amount of their coin can message them, or they could simply rank and prioritize messages from the largest holders of their coin. Alternatively, they can make it so that a certain amount of their coin must be paid to them directly in order for the message to actually enter their inbox. All of this would increase demand for their coin while helping to minimize spam for the creator.

#### Sponsored Posts

Creators can have an “inbox” where anyone can “bid” to have them repost (aka “retweet”) a particular post. If you want Kim Kardashian to retweet your fashion brand, you can submit an entry into her inbox, and if she retweets it then she keeps your money. The bids can all be made using the creator’s own coin, thus significantly increasing the demand for the coin.

#### Premium Content

People who own a certain amount of a creator’s coin get access to special content. Or, alternatively, people must pay a monthly subscription in the form of the creator’s coin in order to get premium content.

#### Distributions and Engagement

Creators can also use their coins to distribute scarce resources to the largest holders of their coins. For example, imagine if a famous celebrity offered to have lunch with whoever held the most of their coin at a particular date. Or imagine if they were going to offer 1,000 signed posters to their 1,000 largest holders. This is just the beginning of how creators can engage with their fans using their coins, and all such ideas could increase demand for their coin significantly.

#### Money Likes

Likes can be re-imagined as purchases of the creator’s coin. So it costs money to like something, but you get that person’s coin when you do so (effectively as a shortcut to buying their coin that’s associated directly with their content). Such a feature could serve as a stronger signal on what content is high quality as well.

#### Emergent Phenomena

What can happen when you give people the ability to speculate on a person’s reputation? We can’t know for sure, but one of the features that has emerged is what we call “buy and retweet.” Ordinarily, retweeting someone gives you nothing. If that person becomes a superstar because you boosted them, you’ll be lucky if they even remember your name in a few years. In contrast, with BitClout you can buy someone’s coin and then retweet them, which makes it so that you’re not only along for the ride financially if they blow up, but you also get bragging rights. Imagine the difference between being able to say “I retweeted her early on” vs being able to say “I bought her coin when it was $0.50 and now it’s $500-- and by the way I’ve done this hundreds of times, and I can prove it because my track record is on the blockchain.” The latter is clearly a very different game. Moreover, it’s not just a famous person’s game. If you know someone with a lot of clout, or if you know someone who knows someone, you can buy a coin and send it to someone else so that they can buy and retweet them. And thus the incentives go many layers deep. The interesting thing about this mechanic is that it wasn’t even something consciously designed into the product. It exists as an “emergent” phenomenon off of the core creator coin mechanic. What other dynamics could exist that we haven’t yet thought of?

### The Creator Coin Supply Curve

Creator coins are naturally scarce, with generally fewer than 100 to 1,500 coins in existence for each profile. This is because as more people buy a profile’s creator coin, the price of the coin goes up automatically at a faster and faster rate. This means that, eventually, it would take billions of dollars to mint even one more coin.

The formula or “curve” for determining the price of a creator’s coin is as follows. Note that creator coins are normally bought and sold with the BitClout cryptocurrency, but we provide a dollar version of the formula for easy calculating:

$$
price\_in\_bitclout = .003 \times creator\_coins\_in\_circulation^2
\\
price\_in\_usd = .003 \times creator\_coins\_in\_circulation^2 \times bitclout\_price\_in\_usd
$$

When you create a profile, there are initially zero coins in existence and thus the price is zero. If you want to buy coins from the profile, it will happily mint them out of thin air and sell them to you according to the price curve above, making it more and more expensive as more coins are purchased. The money you use to buy the coins gets “locked” in the profile in exchange for the coins. On the flipside, if you want to sell coins, the profile will happily buy them from you according to the curve using the money locked from previous buys. And so buying **creates** coins while pushing the price **up** and **locking** money into the profile, while selling **destroys** coins while pushing the price **down** and **unlocking** money from the profile. This is often referred to as an “automated market-maker,” and it’s the same concept that powers protocols like Uniswap and Bancor.

Below is a graph of what the creator coin price curve looks like as a function of how many creator coins are in circulation for a given profile. We also include a table that shows some of these values. Both of these assume a BitClout price of $16. Note also that “integrating” the price curve yields the amount of money “locked” in a profile, which is equal to the “net” amount of money that has flowed into that particular creator coin (included as the third column of the table). If you’d like to play with the numbers yourself, you can do so using [this sheet](https://docs.google.com/spreadsheets/d/1zBEQBBoS12ZhFpPbB13-GTZ8keDVlstRG3l2If78pWM/edit?usp=sharing) (make a copy to edit it). You can also learn more about bonding curves [here](https://yos.io/2018/11/10/bonding-curves).

| **Creator Coins in Circulation** | **Creator Coin Price (USD)** | **USD Locked in Profile** |
| -------------------------------- | ---------------------------- | ------------------------- |
| 5                                | $1.20                        | $2                        |
| 10                               | $4.80                        | $16                       |
| 20                               | $19.20                       | $128                      |
| 40                               | $76.80                       | $1,024                    |
| 80                               | $307.20                      | $8,192                    |
| 160                              | $1,228.80                    | $65,536                   |
| 320                              | $4,915.20                    | $524,288                  |
| 640                              | $19,660.80                   | $4,194,304                |
| 1280                             | $78,643.20                   | $33,554,432               |

![](/files/-MYNsXAtbAFHGGfoZKEk)

### Founder Rewards

Every profile allows the creator to keep a certain percentage of the coins that are created as a “founder reward.” For example, if someone sets their founder reward percentage to 10% and then someone buys 100 BitClout of their coin, then 10 BitClout would be used to buy the creator’s coin, and those coins would go to the creator’s wallet rather than the purchaser’s.

The above being said, we think the better way for creators to own a piece of the upside of their coin is simply to buy their coin up-front when they create their profile, and then set their founder reward percentage to zero. This works because the coins are cheapest at the beginning of the curve, and it has the upshot of reducing friction on subsequent purchases of their coin. Nevertheless, the founder reward percentage being 10% is a “sane default” that guarantees creators will maintain a certain percentage of their coin even if they do nothing.

## The Power of Decentralization

Just like Bitcoin, anyone on the internet can run a BitClout “node” that serves the BitClout content, and every node on the network stores a full copy of all the data. This means that anybody can build apps on top of the BitClout data without the risk of being de-platformed, and they can even create their own feed algorithm. When you visit bitclout.com, you’re using our node, but there are already dozens of nodes on the network, all run by people like you. In the long run there will likely be hundreds or thousands of other nodes you could visit to get access to the same content, each with their own moderation policy. It also means that your login on bitclout.com can be used on any domain that runs a BitClout node. In the same way that you can move Bitcoin from one wallet to another, BitClout makes it so that you can move your “clout” in the form of your followers, posts, creator coin balances, etc anywhere as well. Thus, in some sense, BitClout is decentralizing social media in much the same way as Bitcoin is decentralizing the financial system.


# The Vision

## The Inspiration for BitClout

Today, we think there are several problems with social media:

* **There has been relatively little innovation with regard to how creators monetize.** Most creators earn much less than they should on existing platforms, if they earn anything at all.
* **A handful of companies effectively control public discourse.** Their decisions on what we see and don't see are driven predominantly by what maximizes ad revenue, rather than something more aligned with public good.
* **The dominant companies have cut off third-party developers.** The incumbents have closed off external access to their data, and any novel product developed by an upstart is quickly cloned and bolted onto the incumbents' data moats. We think this has significantly stifled product innovation and competition in social media.

The inspiration for BitClout hinges on one key insight: **If you can properly mix monetary speculation with social media, you not only end up with a novel product that creates innovative ways for creators to monetize, but you also end up with a totally new business model that solves these problems, and that isn't based on ads.**

To achieve this, BitClout takes inspiration from Bitcoin and Ethereum. These platforms took an ecosystem that was fundamentally closed, namely the traditional financial system, and showed that creating a more open alternative that anyone can build on top of could significantly increase competition and innovation. Bitcoin and Ethereum don't have data moats to protect. In fact, the more open they are and the more people that build on top of them, the more value accrues to Bitcoin and Ethereum holders. These projects showed, for the first time, that dominant platforms could be built around a community with open data rather than a company that benefits shareholders at the expense of everyone else. **We thought: What if the same model that is decentralizing the financial system could be applied to decentralize social media?**

## What BitClout Is Today

Today, we think BitClout is fundamentally two things:

* **A new kind of social network.** If you've used BitClout, you know it's like Twitter but with a new kind of monetization tool for creators called "creator coins." With BitClout, every creator gets a coin that anyone on the platform can buy and sell, which unlocks many innovative ways for creators to monetize, and allows them to create deeper relationships with their followers. Creator coins are only the beginning, though, and you can learn more about the product side of BitClout [here](https://bitclout.com/one_pager.pdf).
* **A new kind of blockchain.** We decided to build BitClout from the ground up as its own custom blockchain. It has an architecture similar to Bitcoin, but re-imagined to support a social network. BitClout is not a company, it doesn't have a board, and there is no CEO-- it is just code that runs on nodes across the internet just like Bitcoin. Every profile, post, follow, etc... is stored on a public blockchain that everyone in the world has access to, making it a totally open platform that has the potential to solve the problems that social media has today.

## The Ultimate Vision

Today, a post submitted to Facebook or Twitter belongs to these corporations, rather than the creator who posted it. And the monetization goes predominantly to these corporations as a result.

In contrast, BitClout stores all of its data on a public blockchain, which means that anyone in the world can run a "node" that exposes their own curated feed. Today, bitclout.com operates one such node and its feed highlights crypto content. But there is no reason why other "verticalized" players can't enter the market to create feeds that they're uniquely suited toward curating. For example, imagine if ESPN ran a node that curated a feed of the best sports content. Or if Politico ran a node that curated a feed of the best political content. Additionally, since BitClout is fully open-source, these players could even customize their UI and build custom algorithms to rank the influencers and posts in a way that serves their specific target customer. **We think this will quickly move us from a world in which a handful of juggernauts control the dominant feeds to one in which consumers will have thousands of feeds to choose from, each with its own specific focus.**

**On top of that, storing all of the data on a public blockchain makes it so that, with one engineer, anyone can build a social media experience that's competitive with the existing incumbents.** It cannot be overstated the extent to which this lowers the barrier to entry for creating new social media products. It becomes possible for existing publishers to trivially spin up social apps and experiences as direct adjacencies to their core business, and allows upstarts to innovate on a relatively even footing with megacorps for the first time. **Compare this to today where building a competitive social app generally requires building a billion-user data moat first.**

The best part is that anyone who runs a node to curate their own feed also contributes data back to the public pool of profiles, posts, follows, etc... that's stored on the public blockchain. A post or a like on ESPN's node can be surfaced on Politico's feed. A post made in China can be surfaced on a feed running on a node in America and vice versa. And with every node that runs, more content gets contributed back to the global data pool stored on the blockchain, making every other node on the network more powerful and more engaging to users. In some sense, BitClout can solve a collective action problem among smaller publishers: Instead of being forced to contribute to a privately-owned data pool controlled by a megacorp who's not aligned with them, smaller publishers can now contribute to a public data pool that nobody controls and that they'll never be dis-intermediated from. **Thus we can move from a world in which data is a heavily-guarded, privately-owned resource to one in which it is more like a globally-accessible utility that anyone can build on.**

* Importantly, there is a strong incentive for publishers to contribute data back to the blockchain because not doing so would deter the top creators from wanting to publish on them. After all, why would you publish on a closed platform that exclusively owns your data when you could publish to the blockchain and have your post instantly available to every node/feed that's running on the internet?

We think all of the above can give the creators unprecedented reach, and a more direct relationship with their followers than has been afforded to them with existing platforms. **But reach is only one side of the coin-- the other side is monetization.**

Creator coins are already changing the game in terms of how creators monetize on the internet, but they're only the beginning. **Because BitClout is money-native and open-source, anyone in the world can start to experiment with new ways for creators to monetize.** For example, imagine a major creator wants to start offering premium content in exchange for a monthly subscription. All it takes is for one person on the internet to build this feature, and the entire BitClout user-base gets access to it instantly. The same goes for other features like an inbox where creators can be paid to Reclout posts, or paid to answer messages from their followers. And this goes for other things like detecting harmful content or weeding out spam, where the best machine learning researchers in the world can build solutions, with access to the full firehose of data, without asking for permission, no matter where they are. BitClout is not a company, it's a protocol that the entire world can build on collaboratively, which we believe will ultimately create even more ways to unlock creators' true potential, and bring competition and innovation back to social media.

Moreover, because BitClout is money-native, new signals emerge that can be used to rank content more effectively. For example, the first experiment the BitClout devs launched was ranking comments by the coin price of the commenter. Amazingly, this extremely simple ranking mechanism has already produced results that we think are competitive with centralized platforms. Ranking messages by coin price will help significantly reduce spam for influencers as well in a way that's truly unique to BitClout, and this is still just the beginning. **Imagine what else will be built off of the "Clout Signal" once the entire world starts contributing to BitClout.**

**Finally, we think it's important to mention that we designed BitClout from the ground up so that the incentives of the system keep it decentralized, even in the long run.** Creators have a strong incentive to post directly to the blockchain, rather than to a centralized entity that withholds their content from the blockchain. And there's virtually no possibility for developers lose access to data or API's because all the data is on the blockchain, and they already *have* all the data when they run a node. **Compare this to traditional social media companies, which start open to build a network effect and then shut off access after they've built a winning data moat.** Moreover, you're not decentralized if you have a company and a CEO that runs the show, and this is a large reason why the original devs operate anonymously. We don't want you to rely on our judgement; we want you to start making decisions about where the platform should go as a community. With BitClout, there is no corporate entity that will prioritize shareholder interests over those of the community, there is just the community-- and everybody is aligned together by the fact that we all own BitClout and Creator Coins.

With your help, we hope to build the BitClout blockchain into an enduring positive force for humanity that can bring competition and innovation back to the internet. The internet started as a fundamentally decentralized thing, but we’re at a point in history where things have concentrated and where innovating is harder than it used to be. After much thought over the past several years, we are convinced that the pendulum will swing back toward decentralization, perhaps permanently, and we all have an opportunity to be a part of that. A new generation of applications that the entire world can build collaboratively, unlocking the full potential of human ingenuity.

[@diamondhands](https://bitclout.com/u/diamondhands)


# BitClout NFT's

Today, we are proud to announce that NFT's are coming to the BitClout platform! We are putting the finishing touches on everything now. In the meantime, this post will tell you everything you need to know about the upcoming launch, and its implications on the future of crypto, social media, and the creator economy.

![](/files/-Mey-e5dPkpfrDSWm_ki)

## What are NFTs?

Non-Fungible Tokens (NFTs) are digital assets that can be bought and sold, typically representing a piece of digital content. For example, an artist can publish a digital image as an NFT, and put it up for sale to the highest bidder. When they do this, the history of who owns the image can be tracked on the blockchain as a way of showing the art piece's provenance. And even though anyone in the world can typically see the image, there is only one person who provably owns it, just as if the piece were a painting hanging in a museum.

The easiest way to really understand NFTs, though, is to actually look at some examples. Below we list examples of popular NFT concepts, as well as popular NFT platforms, all of which served as the inspiration for the BitClout NFTs product. **Importantly, because BitClout is an inherently social platform, we anticipate the use-cases for NFTs will extend far beyond just digital content, and we discuss this in detail in the next section.**

Examples of popular NFT concepts:

* [Beeple's collage](https://www.theverge.com/2021/3/11/22325054/beeple-christies-nft-sale-cost-everydays-69-million)
* [CryptoPunks](https://www.larvalabs.com/cryptopunks)
* [Bored Apes](https://boredapeyachtclub.com/)
* [CryptoKitties](https://www.cryptokitties.co/)
* [NBA Topshots](https://nbatopshot.com/)

Popular NFT marketplaces:

* [OpenSea](https://opensea.io/)
* [Nifty Gateway](https://superrare.co/)
* [Rarible](https://rarible.com/)
* [SuperRare](https://superrare.co/)
* [Zora](https://zora.co/)
* [Foundation](https://foundation.app/)
* [Valuables by Cent](https://github.com/bitclout/docs/tree/c582907ad17a084bb08977fdb39b6adbb0623054/v.cent.co)

## Why NFTs on BitClout?

With BitClout, we've always been focused on creating innovative and engaging ways for creators to monetize. We started with creator coins, which allow you to invest in people you care about. Then we added diamonds, which allow you to give tips that show up as badges on the receiver's profile.

**NFTs are our third major breakthrough, and they tie everything together.** Before we decided to work on NFTs, we studied every major NFT platform to determine what was working in the space, and how we could make NFTs on BitClout really shine in a unique way. We came away very excited by the following possibilities...

### 1) Mixing NFTs and Social Media

When someone buys a piece of art or a collectible item, they do so in part because it brings them personal joy, but in part because they want to show it off. A major superpower BitClout has is that every feature that's added to it has an inherent social component built-in, and NFTs are no exception.

In the case of BitClout NFTs, we have an opportunity to show off a user's NFT collection on their profile, and to allow users to engage around their NFTs via comments, likes, diamonds, and more. Suddenly, the act of buying an NFT shifts from a purely personal and/or economic motive to an inherently social one. In addition, because BitClout has a native concept of identity in the form of a user's profile, the reputation of the issuer is tied into the NFT in a much more meaningful way, especially for celebrities and superstars with pre-existing brands. This not only increases the value of BitClout NFTs, but we think it will also lead to all kinds of interesting dynamics that mix collecting, flexing, and social.

Below are just some examples of the possibilities...

#### **New NFT Use Cases**

* **Collectible ticket stubs.** If you were to sell tickets to a concert in the form of BitClout NFTs, then every attendee would automatically get a virtual ticket stub on their profile commemorating the event that their friends would get to see (not to mention the extra promo you'll get from your coin-holders!). Could you imagine if [@3LAU](https://bitclout.com/u/3LAU) sold his tickets as BitClout NFTs? This mechanic could also be used to sell tickets to exclusive events like the premier of a movie or an exclusive gala.
* **Physical memorabilia: The digital collector's room**. Imagine selling a physical piece of memorabilia, like a prop from a movie set, with an NFT attached, issued by the original seller, that the

  buyer gets to flex on their profile. This turns a user's profile into an inventory of their collector's room, where you can see all of the cool things they own, both in the digital and physical world, with

  NFTs serving as certificates of authenticity issued and signed directly by the original seller. Could you imagine if someone like [@GeorgeTakei](https://bitclout.com/u/georgetakei) from Star Trek cleaned out his closet one day using BitClout NFTs?
* **Exclusive experiences.** Selling experiences as NFTs makes unique sense on BitClout. For example, creators with large followings can offer to have dinner or to host a Q\&A with a handful of their biggest fans by minting and selling a "one of 10" NFT. With BitClout, because NFTs are inherently social, the creator can engage their followers by asking them to comment explaining why they want to join before they place a bid. The creator then has full control over determining the winners, and those winners not only get to meet the creator, but they also get to sport the fact that they did on their

  profiles forever. Maybe [@wolfofwallst](https://bitclout.com/u/wolfofwallst) could give Warren Buffet's charity lunch some competition!
* **Exclusive unlockable digital content.** BitClout NFTs have an "unlockable" portion that only the winner of the NFT gets to see. This creates interesting use-cases around selling hyper-exclusive digital goods. For example, an artist can drop an album a week early as an unlockable 1/10,000 NFT such that only her true fans who win the NFT are able to listen to it ahead of time. This would result in extra cashflow for the artist while still allowing them to capture the same streaming revenues a week later. Could you imagine getting early access to [@thechainsmokers](https://bitclout.com/u/thechainsmokers)' next album, and getting an NFT along with it?
* **Exclusive chat groups.** Creators can offer exclusive chat groups using BitClout NFTs to gate

  access. For example, a creator can sell a 1/100 NFT such that any current owner of the NFT is able

  to participate in an exclusive Telegram group, weekly Zoom call, etc... We already saw this happening with creators like [@craig](https://bitclout.com/u/craig), but it also makes sense for sports insiders like [@adamschefter](https://bitclout.com/u/adamschefter).
* **Interactive content.** For content creators, BitClout NFTs can be used as a way to solicit feedback from fans, or to guide the direction of content. For example, the creator of a podcast can sell an NFT where the winner gets to decide what their next episode is going to be about. The creator can solicit comments from users before they place their bids, and they have ultimate control over whom they choose as the winner. Alternatively, music artists can offer to put an NFT winner's name in a song or include them in a music video, and the winner would have the NFT on their profile to commemorate the experience. The creator of a movie or short film could sell producer credits in the final cut as NFTs. Could you imagine if the winner of a BitClout NFT could decide the topic for [@shaanvp](https://bitclout.com/u/shaanvp)'s next show, or win a shoutout at the end of a [@jakepaul](https://bitclout.com/u/jakepaul) or [@loganpaul](https://bitclout.com/u/loganpaul) fight? How about a Clubhouse AMA with [@alexisohanian](https://bitclout.com/u/alexisohanian), where the winners of a "one of 10" NFT get to come on-stage first? Or maybe we can finally get [@BennyBlanco](https://bitclout.com/u/BennyBlanco) to finally bring us that BitClout Boys single we've all been waiting for, as gloriously sought-after NFT.
* **Counterfeit-proof Rolexes, Chanel handbags, etc...** Major brands have a big problem with

  counterfeiting: A real Rolex is worth much more than a knockoff, but knockoffs can often be

  so good that it's difficult to tell them apart. Now, imagine a solution based on BitClout NFTs

  whereby a luxury brand creates an official BitClout profile, and offers an NFT associated with

  every single sale of their products. Now, a user not only gets digital, unforgeable proof that

  they own a real item, but they also simultaneously get to show off their purchase on their profile that all of their friends can see. Then, if they ever resell their Rolex, they can transfer the NFT along with it, allowing it to serve as a certificate of authenticity issued and digitally-signed directly by the brand, and that tracks the provenance of the item for its entire lifetime.
* **Digital trading cards.** Any sufficiently-well-known creator can create digital trading cards of themselves simply by issuing a "one of N" NFT. All they need to do is create a unique piece of artwork, like a [cryptopunk](https://www.larvalabs.com/cryptopunks) drawing of themselves, and their biggest fans can sport it on their profiles. Notably, each BitClout NFT has a serial number, so each one will be special, even within the same issue. [@ab84](https://bitclout.com/u/ab84), could you be the first BitClout NFT trading card!
* **Fine art.** Major artists have shown that NFTs are going to be a big part of the future of fine art. They not only allow anyone to enjoy the artist's work, but they also do a much better job of tracking the ownership of a piece, which means the provenance can't be forged. The fact that BitClout also incorporates the artist's identity, via their profile, into the minting of an NFT should, we hope, further increase the value and utility of NFTs issued by artists. Artists on BitClout have already been innovating extremely fast, and we're so excited to take things to the next level with BitClout NFTs. Maybe we can even get [@beeple](https://bitclout.com/u/beeple) to finally claim his profile!
* **The future of Charity.** Charities can create profiles on BitClout, just like ordinary people. When they do this, anyone can elect to send them BitClout as part of the sale of their NFT. For example, someone could auction off a dinner with themselves, but specify that all the proceeds will go to The Red Cross. They would then be able to digitally prove that the funds went to that charity. Alternatively, a charity can participate in the fun directly by issuing NFTs of their own. For example, a charity could issue NFTs where each one represents a particular acre of trees that will be planted. This allows the owner to show off their contribution to any cause they care deeply about, which could significantly increase the amounts people are willing to give. It's a bit surprising that social media and charity aren't more closely linked today-- but we believe BitClout can finally change that, and make giving easier and more fun than ever before.
* **Owning a piece of history.** On BitClout, any post that a user makes can also be minted

  as an NFT and sold. The user who "owns" the resulting NFT can be seen as owning a piece of

  history. For example, if a sitting US president theoretically joined BitClout in the future and

  used it to make a monumental announcement, like the end of US COVID lockdowns, someone could

  own that very special post, and all proceeds could be donated to a charity of the president's

  choice. We'll also settle for another shirtless pic of [@chamath](https://bitclout.com/u/chamath), though, just to be clear.

The above list is just the beginning; it's just what we've come up with so far. We can't wait to see what the community produces once BitClout NFTs are actually out in the world.

In the past, NFTs and social media have been separate: You mint an NFT on some platform, and then post about it on social media. Now they can come together, as they were always meant to be, increasing engagement, reach, value, and monetization for creators.

### 2) NFT Cashflows to Coin-Holders

Creator coins are a major BitClout superpower that we are taking to the next level with the launch of NFTs. On BitClout, a percentage of the sale of each NFT can be sent back to a creator's coin-holders as a cashflow (including on secondary sales). With this key feature, BitClout NFTs "close the loop" between a creator's activities on BitClout and the value of their coin.

**Suddenly, creator coins are no longer objects of pure speculation; rather, they are directly linked to a creator's activity on the platform. This means that, for the first time, followers can participate in a creator's growth rather than watching from the sidelines as they rise to stardom.** This has never been possible before, and it changes the relationship between a creator and their fans, from one in which fans pay for their work, to one in which they invest in the creator, and grow together.

Moreover, tying cashflows to creator coins makes it so that any creator who wants to market a new piece of content has a whole army of coin-holders that are invested in their success, and will help them spread the word. Distribution is no longer solely the creator's job, and they don't need to sign their life away to a corporation in order to get it. Your fans are your investors and your distributors at the same time because they're economically aligned with you in a way that wasn't possible before BitClout.

Finally, and perhaps most interestingly, these cashflows do not ultimately inhere to the creator themselves; rather, in the same way a Picasso painting continues to fetch a high price after its original primary sale, a creator's NFTs on BitClout can continue to trade and produce cashflows for creator coins long after the creator is gone. **Thus, in some sense, tying cashflows to creator coins makes owning them analogous to owning a percentage of every sale of every piece of work the creator has or will ever produce on BitClout. Could you imagine if Picasso had a creator coin linked to all of his works?**

## How BitClout NFTs Work (With Visuals)

The easiest way to see how BitClout NFTs will work is to check out [this deck](https://docs.google.com/presentation/d/1iklCqm85gjnqv_CyTG7-vXMBmSG1yhtBE_-oexUGZ0A/edit#slide=id.ge30f8df505_0_0).

Very simply, the steps to minting and selling a BitClout NFT are as follows:

* Create a post, which consists of a snippet of text and an embedded image or video. All

  NFTs on BitClout start as posts, and you can turn any pre-existing post into an NFT.
* Hit "Mint NFT" and select from the options:
  * You can mint either a "one of a kind" or "one of N" NFT. In the latter case, there will be multiple winners of the same piece of content.
  * The creator can set a creator royalty and a coin-holder royalty. This is a percentage of the sale that will go to the creator and to the creator's coin-holders as a cashflow. This cashflow hits on every **secondary sale** of the NFT as well. The BitClout platform does not take a fee. Note we are working on allowing arbitrary public keys to be specified as a means of programmatically  distributing proceeds to other accounts, such as charity accounts.
  * Optionally, the creator can set a piece of unlockable content that only the winner of the NFT will get access to. This feature enables hyper-exclusive experiences to be built on BitClout NFTs, like one of a kind songs that only the winner can listen to.
* Once an NFT is minted, users can bid on the NFT. They must have enough in their wallet to cover the bid, but nothing is withdrawn from their wallet until the auction is closed by the creator. This allows users to bid on as many things as they like.
* Whenever the creator is ready, they can close the auction by selecting a winner, or winners in the case of a "one of N" NFT. Importantly, the creator has full control over who gets to own their work; they don't have to give it to the highest bidder.
* Once the auction is over, the winner(s) get to show off the NFT on their profile. It shows up in their NFTs tab, and it can be pinned to their main page.

We didn't want to over-complicate things, and we believe this simple set of features enables all of the interesting use-cases described previously.

Finally, as a means of concentrating liquidity around certain NFTs, we have designed a system that allows node operators to schedule "showcases." Showcases work as follows:

* A node operator selects a collection of NFTs that they want to showcase.
* The node operator schedules these NFTs to "drop" at a certain time.
* At the scheduled time, the new NFTs are showcased on the Home page in their own tab.

Using this system, a node operator can curate a collection of NFTs every week, or even more frequently, and engage the community around them. **This, in some sense, allows node operators to serve as the curators of their own digital galleries, with each drop introducing a new exhibition.**

## NFT Showcase: A Community Contest

The NFT Showcase is a curated feed on BitClout.com where NFTs from different NFT artists are showcased.

It's possible to apply for your work to be featured in the NFT Showcase. It's easy as 1-2-3:

* Mint an NFT and Reclout with #CLOUTNFT
* Cross-post to Twitter or Instagram (recommend @oneclout(<https://bitclout.com/u/oneclout>) for cross-posting)

And if you don't make it into this drop, don't worry! Any NFT you mint always gets shown to all of your followers, it's visible on your profile, and it can even make the global feed. Every now an then we are doing a new drop of NFTs on BitClout.com so that new artists are continuously featured, and we hope to make this even more frequent in the future. Lastly, don't forget that new nodes are spinning up every day that offer superior experiences to BitClout.com, and your NFTs will automatically be available in all of these new nodes as well.

## Third-Party Apps

The best part about BitClout NFTs is that they are totally and 100% open, just like everything else on BitClout. This means that not only can third-party devs build custom experiences around NFTs, but they can also integrate NFTs seamlessly into their existing products. **It also leaves the door wide open for established NFT platforms like OpenSea, Rarible, and others to integrate BitClout NFTs as an added source of inventory.**

## A Note on Naming

We discussed and deliberated for a long time about whether we should call this new product "BitClout NFTs" or something else. The main issue is that very few people understand what the term "NFT" means, and even people in crypto struggle with it. Not only that, but it could come off as "nerdy," and alienate a mainstream audience. As such, we considered names like "Gems" or "Crystals," but these names had the drawback that **nobody** would understand them out of the gate.

With all of the above in mind, the term "NFT" seemed like the best choice mainly because it hooks into a hot topic that a lot of people across multiple industries are interested in, and want to learn more about. It is also a category that is drawing investment from major players such as Sotheby's and Christie's, and so even though it's a little-understood concept today, it is trending toward becoming a household term in much the same way terms like "the internet" or "website" were in the early dot-com era.

Lastly, the best part about BitClout is that anyone can improve the branding by launching a third-party app!


# BitClout FAQ

## **1.** Overview

### **What is BitClout?**

The BitClout project is a decentralized, blockchain-based, [open source](https://github.com/bitclout/core#about-this-repo) social network. It is not a competitor to Bitcoin or Ethereum, but to existing closed social networks like Twitter and Facebook. And to understand why we built it, it helps to understand the history of these social networks.

Back in 2009, Paul Graham wrote about [Twitter as an open protocol](http://www.paulgraham.com/twitter.html) that was run by a private company that had been “slow to monetize” and hadn’t “tried to control it too much”. Due to this openness, people built many applications on the Twitter API, including applications like [Tweetdeck](https://en.wikipedia.org/wiki/TweetDeck) that replicated the full functionality of Twitter. Then Twitter very much asserted itself as a private company, shutting off API access to countless developers ([1](https://readwrite.com/2011/02/11/twitter_kills_the_api_whitelist_what_it_means_for/), [2](https://techcrunch.com/2011/05/18/twitter-revokes-automatic-3rd-party-dm-access-gives-users-more-details-on-app-permissions/), [3](https://www.theverge.com/2012/7/9/3135406/twitter-api-open-closed-facebook-walled-garden), [4](https://www.theverge.com/2012/8/20/3250218/developers-react-twitter-api-rules), [5](https://www.networkworld.com/article/2200143/twitter-whacks-ubertwitter-company-so-hard-it-s-changing-app-s-name-to-ubersocial.html), [6](https://readwrite.com/2011/02/22/twitter_puts_the_smack_down_on_another_popular_app), [7](https://mashable.com/archive/twitter-killing-tweetdeck), [8](https://venturebeat.com/2015/10/22/10-reasons-why-twitter-ceo-jack-dorsey-apologized-to-developers/), [9](https://thenextweb.com/news/developers-bracing-themselves-for-twitter-api-retrictions-call-todays-post-ominous), [10](https://www.infoworld.com/article/2908869/twitters-firehose-shut-off-is-the-newest-hazard-of-the-api-economy.html)), deplatforming direct competitors like [Meerkat](https://techcrunch.com/2015/05/06/meerkat-founder-on-getting-the-kill-call-from-twitter/), and generally becoming a Facebook-like [walled garden](https://www.theverge.com/2012/7/9/3135406/twitter-api-open-closed-facebook-walled-garden). This is now far enough in the past that 20-something developers often don’t even know about this history.

Twitter didn’t cut off API access because it was “evil”. Fundamentally, the reason this happened is because (a) Twitter was a private company that needed to provide returns to its employees/investors and (b) Twitter could not monetize via its API as well as it could via ads run on Twitter.com itself. The incentives of Twitter-the-company, Twitter-the-platform, Twitter developers, and Twitter users were not economically aligned. And so the background issues that Paul Graham had presciently noted — namely that Twitter was a private company that hadn’t tried to monetize or assert control over its API — came to the foreground.\
\
But what if we could build an open source social protocol, based on a blockchain, that aligned all parties behind a different form of innate monetization, and that delegated control back to its users, nodes, and developers? That’s what we’re trying to do with BitClout.

### **What is the difference between BitClout, Bitclout.com, the BitClout Blockchain, the CLOUT cryptocurrency, and individual creator coins?**

The BitClout project has several parts.

* The BitClout Blockchain, the decentralized backend of the whole system.
* Bitclout.com, the first client to that blockchain.
* The CLOUT cryptocurrency, which is the native digital asset of the platform.
* The individual creator coins, which are personal tokens that are automatically set up for each BitClout profile. Each creator can add value to their creator coins, and they are a way for users to back their favorite creators.

Let’s give detail on each of these.

#### The BitClout Blockchain

BitClout’s backend is structured as a blockchain. It is already [open source](https://github.com/bitclout/core#example-1-a-bitclout-website-aka-bitcloutcom) and more decentralized than closed social networks like Twitter.&#x20;

To prove this, note that right now you can [run a node](https://docs.bitclout.com/devs/running-a-node) and download the entire BitClout blockchain. Any engineer can then run [simple commands](https://github.com/andrewarrow/cloutcli#quick-start-demo) to print out the entire history of all BitClout messages, visualize the full social graph, search all clouts, send mass DMs to users, and in general gain full access to the entire BitClout backend as you would with any other public blockchain. These actions would be impossible on twitter.com without [corporate permission](https://developer.twitter.com/en/docs/twitter-api/enterprise/historical-powertrack-api/overview) from Twitter.

For this reason we think BitClout as a whole is *already* significantly more decentralized than Twitter or Facebook. That said, there are still parts of the BitClout project that are centralized or semi-centralized, like [identity.bitclout.com](https://docs.bitclout.com/devs/identity-api) and [images.bitclout.com](https://bitclout.com/posts/db5f007e1c6a3b018bba98362fe5f8488f29f51676aa90ebf0bc2b702aec0f26), which we plan to phase out over time. You can read more about the technical roadmap for progressive decentralization below.

The main difference between BitClout and most previous public blockchains is that BitClout focuses on *social* rather than financial transactions, like [updating a profile](https://github.com/bitclout/core/blob/main/lib/network.go#L211) or [buying a creator coin](https://github.com/bitclout/core/blob/27426de8fd6dfb5d0d0e98a2f6b82773d92a6288/lib/network.go#L215). Just to make that clear, here’s a [screenshot](https://www.bitcloutpulse.com/explorer/blocks/00000000000099a0306c0bd5b8bbb5eb6e2e716be4a929e20157d2af18189661) of a recent BitClout block from a third party block explorer called bitcloutpulse.com. Note that you can see individual social transaction types, such as `BLOCK_REWARD`, `SUBMIT_POST`, `FOLLOW`, `LIKE`, and so on.<br>

![](/files/-Mdajd3NhwzeZFIBoORb)

#### The Bitclout.com Frontend

The first frontend UI to the BitClout Blockchain is at bitclout.com. Like the BitClout Blockchain, this is also [open source](https://github.com/bitclout/frontend) and anyone can download and modify it.

And people have. While [Bitclout.com](http://bitclout.com) was the first major node on the BitClout network, and maintains a significant portion of the traffic at the time of this writing, other major nodes have matured recently. Some of them include:

* [bitcloutpulse.com](http://bitcloutpulse.com), which provides analytics tools for the BitClout blockchain
* [Flick](https://www.flickapp.com/bitclout), which serves the dominant iOS and Android apps for BitClout
* [Blockchain.com](http://exchange.blockchain.com), which lists the CLOUT cryptocurrency for trading
* And the many apps building on top of BitClout, listed at [bithunt.com](http://bithunt.com), many of which run their own full nodes

Notably, everything that is not bitclout.com is operated as its own independent entity, and in the roughly three months since the launch of the BitClout project, several of these entities have already raised capital from blue-chip VC firms. For example, Flick was founded by [Nigel Eccles](https://www.youtube.com/watch?v=QM1Bz_eB2Ec), who was formerly the founder of FanDuel, a billion-dollar sports betting company.

These nodes are to the BitClout blockchain what entities like Etherscan and Coinbase are to the Ethereum blockchain. Just like block explorers or exchanges, they allow you to view and interact with the BitClout blockchain. BitClout interactions tend to be social rather than mainly financial, of course.

#### The CLOUT cryptocurrency

As a blockchain, BitClout has its own native cryptocurrency called CLOUT. CLOUT can be purchased and sold at [exchange.blockchain.com](https://medium.com/blockchain/trade-clout-on-the-blockchain-com-exchange-3ee1a2b2aca4), and on any major node using dollars or BTC. This purchase comes out of a pool of CLOUT maintained by each individual node operator.

What can CLOUT be used for?

* *Creator Coins*. CLOUT is also used to buy Creator Coins (see below), which are assets native to the BitClout blockchain.
* *Fees*. Every transaction on the BitClout blockchain requires some small amount of CLOUT to cover transaction fees.&#x20;
* *Other Applications*. BitClout developers can build applications that require users to hold a certain amount of CLOUT to get in, that permit people to do multi-signature transactions with their CLOUT private keys, that enable people to use CLOUT to run crowdfunders on platform, and more.

In general, every application written on the BitClout blockchain can make use of CLOUT. Think about what you’d do with Twitter or Facebook if every user had a balance.

#### Creator Coins

In addition to CLOUT, the overall currency of the platform, each individual user on BitClout has their own creator coin. Creator coins are described more fully in [this explainer](https://docs.bitclout.com/#what-are-creator-coins), but in brief they allow users to support their favorite creators by buying their coin, a little like a combination of AngelList and Patreon. Creator coins can be thought of as the simplest way to issue a token for an individual, and individual creators can add value to their creator coins in many ways. For example:

* [Bitcloutmembers](https://bitclout.com/u/cloutmembers) is Substack for BitClout. You need to hold a certain amount of a creator coin before you can see the creator’s premium posts.
* [Hyped](https://bitclout.com/u/hyped) is Eventbrite for BitClout. You need to hold a certain amount of creator coins to enter the creator’s live event.
* [Paywithbitclout](https://bitclout.com/u/paywithbitclout) is Gumroad for BitClout. You use creator coins or CLOUT to buy digital goods.

The reason we have creator coins in addition to CLOUT is that creators can add creator-specific utility to their individual coins. As with CLOUT, creator coins are stored on the BitClout Blockchain.

### **What is BitClout’s Twitter account?**

bitclout.com's only official Twitter account is @bitclout ([twitter.com/bitclout](https://twitter.com/bitclout)). We posted proof of this on the BitClout blockchain [here](https://bitclout.com/posts/d61106b2b0f4fabe621909dbd297b9d7d659c49ba9c76ec2400eca97321033ae).

### **What is BitClout’s GitHub account?**

All of the code for the BitClout reference implementation, as well as tools and other libraries, can be found in the BitClout GitHub project at [github.com/bitclout](https://github.com/bitclout). The key repositories are:

* [github.com/bitclout/core](https://github.com/bitclout/core)
* [github.com/bitclout/backend](https://github.com/bitclout/backend)
* [github.com/bitclout/frontend](https://github.com/bitclout/frontend)
* [github.com/bitclout/identity](https://github.com/bitclout/identity)

If you're an engineer, read the [developer docs](https://docs.bitclout.com/code/dev-setup) for how to clone these repositories, synchronize the BitClout blockchain locally, and stand up your own instance of a BitClout node.

## **2. Bitclout.com Profiles, Seed Phrases, Identity, and Messaging**

### What is a bitclout.com profile?

To first order, a bitclout.com profile is similar to a Twitter profile. You can see one here: [bitclout.com/u/diamondhands](https://bitclout.com/u/diamondhands) and read more about profiles [here](https://docs.bitclout.com/#tweet-to-claim-your-profile).

But there are some key differences between bitclout.com profiles and Twitter profiles. Among them:

1. Recall that bitclout.com is just one client to the BitClout blockchain. Other clients include [bitcloutpulse.com](https://bitcloutpulse.com), [flickapp.com](https://www.flickapp.com/bitclout), and many others listed at [bithunt.com](https://bithunt.com). So a profile can be removed from bitclout.com while the underlying user data is *still present* on the BitClout blockchain. By contrast, when Twitter [suspends](https://help.twitter.com/en/managing-your-account/suspended-twitter-accounts) a user, that user has no way of gaining access to their messages, followers, or other user data without Twitter's consent.
2. In particular, because the underlying user data for any bitclout.com profile (including access to funds) is present on the BitClout blockchain, a user whose profile is removed from bitclout.com retains access to their funds through their seed phrase (see below).
3. Moreover, the developers who run individual BitClout clients like bitcloutpulse.com and flickapp.com can decide whether to show or hide any given profile at any given time, independent of bitclout.com's decision.

Put another way, a Twitter profile like twitter.com/bitclout is a view of data that is stored in the closed Twitter database. But a bitclout.com profile is a URL like bitclout.com/u/diamondhands which is a view of data that is stored on the [*public*](https://bitcloutpulse.com/explorer) BitClout blockchain. Anyone else can code a different view, and hide or show different users.

### What is a BitClout seed phrase?

Your BitClout seed phrase is a series of 12 words that is the password to your entire account. It's not just the password to your bitclout.com profile, but to the funds and the data stored on the BitClout blockchain. Your seed phrase can never be changed and sharing your seed phrase with anyone could result in a loss of funds. Read more [here](https://docs.bitclout.com/faq/privacy-and-security).

### How do I create a bitclout.com profile and seed phrase?

For 99% of users, you can simply follow the signup flow on [bitclout.com](https://bitclout.com). However, if you are one of the \~15,000 users with reserved profiles, read on.

### What is a reserved profile and how does it work?

In March of 2021, the BitClout core dev team reserved bitclout.com profiles for thousands of people, mainly to prevent squatting and impersonation of those handles. These were just ordinary profiles created by the dev team in the same way ordinary users create profiles (namely by broadcasting transactions to the BitClout blockchain).

Then, as an added benefit to the people for whom they reserved these profiles, the dev team also funded these profiles with BitClout to give them some of their own coin.

The dev team then made it possible for anyone on Twitter to claim their profile by Tweeting out their public key. This conveniently solved an authentication issue, where you need to be sure that the person who’s reaching out to claim the profile is really the person they say they are.

Once a profile is claimed, the dev team transfers the profile to the public key contained in the Tweet. The dev team created these profiles, and so they then transfer these profiles — including control over the reserved creator coin assets — to the party claiming the profile using the [SWAP\_IDENTITY](https://github.com/bitclout/core/blob/2252c71379d9e7d0872c7e4844413134b5d7393c/lib/network.go#L216) transaction type on the blockchain.

### How do I claim my profile at bitclout.com, if it was reserved?

Simply create an account on [bitclout.com](https://bitclout.com), navigate to your reserved profile, and hit the button to claim your profile. This will draft a Tweet with your public key in it that support can use to transfer your profile to you.

![](/files/-Mdajiqp1BwaYxUXbE9g)

### How do I remove my profile from bitclout.com, if it was reserved?

Simply DM @bitclout on Twitter from the account with the same handle as the reserved account. This is required in order to verify that you own the Twitter account associated with the reserved profile.

Importantly, removing your account from bitclout.com does not remove it from the underlying BitClout blockchain. This means your profile may still show up on other nodes, such as [bitcloutsignal.com](https://bitcloutsignal.com) or [prosperclout.com](https://prosperclout.com). They may decide to follow bitclout.com or make their own moderation decisions.

An account can be removed from bitclout.com either by request or by the admin of the bitclout.com node. Only the owner of the account can request removal; accounts cannot be removed by anyone other than the owner or the admin of the bitclout.com node.

### How do I un-remove my profile from bitclout.com?

Importantly, profiles cannot be removed from the blockchain, and so this question refers solely to hiding profiles on bitclout.com.

If the account was removed from bitclout.com by the owner, the owner can email <node.admin@protonmail.com> to request it be unhidden on bitclout.com. They may be asked to provide proof that they control the private keys of the account.

The bitclout.com node admin also has the discretion to hide profiles. In such cases, the profile cannot be unhidden by the owner. This does not affect how other nodes like BitClout Pulse, ProsperClout, BitClout Signal, or Flick show the profile.

### Can reserved profiles be removed prior to being claimed?

Yes. As described in [this answer](/faq/bitclout-faq#what-is-a-reserved-profile-and-how-does-it-work), reserved profiles are controlled by the BitClout core developers until they are transferred over to the corresponding Twitter users who claim them. This means that the core developers can choose to remove reserved profiles if this is in the best interests of the community. If this happens, users can still message @bitclout to claim their handles, but they will not receive the pre-purchased coins that the core developers allocated to their names. Anyone who holds coins in this profile can still access this profile in their wallet and sell their coins.

In the past, reserved profiles have been removed when it appears as though the person claiming them is going to either immediately sell the pre-purchased coins that the core developers allocated to them, or "rug-pull" on their holders. This is because rug-pulls are not only harmful to the holders of the reserved user’s coins, but also because they promote a short-term mindset that is harmful to the community more generally.

### What is the BitClout seed phrase and is it the same as the BitClout private keys?

Seed phrases were used as a mechanism to log users in prior to the introduction of the “Login with Google” flow. A seed phrase is used to deterministically generate one’s private key, and neither the seed phrase nor the user’s private key ever leave the browser.

### If I signed up with a seed phrase only, how do I switch to login with Google with 2FA?

Currently, we don't have a migration path for people who logged in with a seed phrase and want to "import" that seed phrase into their Google account. We hope to have a fix for this soon so that everyone who wants to use Google to login can import their seed phrase and have the benefit of 2FA and secure storage of their seed phrase. The dev community is working aggressively on improving BitClout Identity to add this, especially the Flick team, which creates the top BitClout mobile apps.

### Can Bitclout.com access my private keys, if I’m a normal user?

No. A user who signs up at bitclout.com fully controls their profiles with their private keys. When a user signs up with a seed phrase, their private keys *never* leave the browser.

When a user signs in with Google, the user's private keys are backed up to an isolated part of that user's Google Drive that nobody can access other than that user.

For more information on how BitClout private key storage works, see [here](https://docs.bitclout.com/faq/privacy-and-security).

Note: Although a user's private keys never touch bitclout.com's servers, it is important to mention that profiles and creator coins (not $CLOUT) can be recovered by certain ParamUpdater public keys using a [SWAP\_IDENTITY](https://github.com/bitclout/core/blob/2252c71379d9e7d0872c7e4844413134b5d7393c/lib/network.go#L216) transaction type that the core dev team intends to remove after an initial bootstrapping phase. This transaction type has only been used to transfer profiles and recover profiles for high-profile accounts that lost their seed phrase prior to the "Login with Google" update.

### Can Bitclout.com access my private keys, if I’m a reserved user?

The private keys for reserved profiles are controlled by the core developers until the profiles are transferred over to the users who claim them. After this transfer is complete, the user fully controls these profiles with their private keys, which never leave their browser.

Note: Although a user's private keys never touch bitclout.com's servers, it is important to mention that profiles and creator coins (not $CLOUT) can be recovered by certain ParamUpdater public keys using a [SWAP\_IDENTITY](https://github.com/bitclout/core/blob/2252c71379d9e7d0872c7e4844413134b5d7393c/lib/network.go#L216) transaction type that the core dev team intends to remove after an initial bootstrapping phase. This transaction type has only been used to transfer profiles and recover profiles for high-profile accounts that lost their seed phrase prior to the "Login with Google" update.

### Can developers using identity.bitclout.com access my private keys?

No. identity.bitclout.com only exists as a means of isolating key material to an iFrame in the user’s browser. This isolation not only makes bitclout.com more secure, but it also provides a means for third-party developers to leverage accounts created on other nodes by including identity.bitclout.com as a dependency. Notably, anyone can spin up a clone of identity.bitclout.com since it is [fully open-source](https://github.com/bitclout/identity), and we expect this to be an opportunity for exchanges to custody users’ identities in the future. For more information about BitClout’s identity API, see [here](https://docs.bitclout.com/devs/identity-api).

### Can anyone create an account on the BitClout blockchain without going through Bitclout.com?

Yes, absolutely. Apps such as bitcloutpulse.com and Flick already allow this. Users can also create accounts programmatically by broadcasting the proper transactions to the blockchain. This [toolslib](https://github.com/bitclout/backend/tree/main/scripts/tools/toolslib) directory is useful for that.

### Can random BitClout Blockchain users access my private keys?

No. Nobody other than the user themselves can access their private keys.

When a user signs up with a seed phrase, their private keys *never* leave the browser.

When a user signs in with Google, the user's private keys are backed up to an isolated part of that user's Google Drive that nobody can access other than that user.

### Where should I store my private keys?

If you use the “Login with Google” signup flow, then no storage is needed. Your private keys are stored in an isolated part of your Google Drive by default that only you can access.

If you are using raw seed phrases to login, see [this doc](https://docs.bitclout.com/faq/privacy-and-security) for information on how to manage them securely.

### When should I enter my seed phrase?&#x20;

**You should never enter your seed phrase on any site other than the one that generated it (typically identity.bitclout.com).**

[BitClout Identity](https://docs.bitclout.com/devs/identity-api) makes it so that seed phrases never need to be entered directly into third-party apps. There are still some legacy apps that request your seed phrase, but these should be avoided.

### How private are on-chain DMs, and what is the roadmap to making them more private?

Message text is end-to-end encrypted with your private key, which never leaves your device.

[**🚨**](https://emojipedia.org/police-car-light/) However, similar to how the Bitcoin blockchain publicly stores **who you’ve sent money to** **and when**, the BitClout blockchain publicly stores **who you’ve messaged and when**. [**🚨**](https://emojipedia.org/police-car-light/)

We are working on a fix to this, but the engineering is nontrivial. In the meantime, if you want total DM privacy, we recommend putting your Telegram username in your bio to have people contact you there.

## **3. BitClout Blockchain, Decentralization, Open Source, and Scaling**

### Is Bitclout.com open-source?

Yes, 100% of the code that powers bitclout.com is public [here](https://github.com/bitclout). And we mean 100%. This includes all the code required to [run a node](https://docs.bitclout.com/devs/running-a-node) and to [run the frontend](https://github.com/bitclout/frontend).

Moreover, all of the BitClout data is stored publicly on the blockchain, such that anyone who runs and syncs a node can instantly build on the full firehose of data (there are multiple popular third-party block explorers such as [explorer.cloutangel.com](https://explorer.cloutangel.com) and [bitcloutpulse.com](https://www.bitcloutpulse.com/explorer)). This property in particular has the potential to turn social media from a walled garden controlled by a handful of companies to a utility that anyone in the world can build and innovate on.

### **Is the BitClout Blockchain open-source?**

Yes, the code that powers the BitClout blockchain is mainly the core repo [here](https://github.com/bitclout/core).

### **What is the difference between Bitclout.com and the BitClout Blockchain?**

Bitclout.com is a BitClout node, which means it downloads all transactions from its peers and writes transactions to the blockchain.

The BitClout blockchain is the set of all transactions that have occurred on the BitClout network, which is a superset of the transactions that happened on bitclout.com, which is just one node on the network.

### **What parts of BitClout are centralized at bitclout.com and what parts are decentralized on the BitClout Blockchain, and what parts of the BitClout Blockchain are still semi-centralized?**

All code is public, and nearly all data utilized by bitclout.com is publicly stored on the blockchain.com. There are some exceptions, however, for good reasons:

* **Removals.** Which profiles have been removed from bitclout.com is not stored on the chain. This is intentional in order to prevent bitclout.com from having the power to unilaterally deplatform someone from the BitClout network. It means that decisions about what profiles should and shouldn’t be exposed from the blockchain are made at the node level, creating a significantly more decentralized approach to moderation than the status quo for social media provides today.
* **Verifications.** Verified checkmarks are not stored on the blockchain. This is for the same reason that removed profiles aren’t. Instead, the core dev team has plans to introduce an “association” primitive that will allow profiles to associate with one another, effectively creating a more decentralized version of the blue checkmark. For example, your profile can list associations with universities or workplaces that have been cryptographically signed.
* **Emails and phones.** Emails and phone numbers are not stored on-chain for privacy reasons currently. However, we are working on storing them in an encrypted fashion to support features like sharing one’s email or phone number with other users on other nodes.
* **Images and videos.** Although the BitClout blockchain stores all text posts directly, images and videos are stored in a centralized fashion at images.bitclout.com such that only links to the images are actually stored on the blockchain. This is because images and videos are still too large to efficiently store on blockchains currently, though technologies like IPFS and Arweave are promising.
* **Identity iFrame (for now).** Identity.bitclout.com is currently the dominant domain used to serve a BitClout Identity app. However, we expect this to decentralize more as exchanges enter the Identity game.
* In consensus, there are two transaction types that are temporarily only executable by certain [ParamUpdater public keys](https://github.com/bitclout/core/blob/5ce03b9318b6b447f895cc9db7d61de54736c1a6/lib/constants.go#L449). They are [UpdateGlobalParams](https://github.com/bitclout/core/blob/5ce03b9318b6b447f895cc9db7d61de54736c1a6/lib/network.go#L217) (for fees) and [SwapIdentity](https://github.com/bitclout/core/blob/5ce03b9318b6b447f895cc9db7d61de54736c1a6/lib/network.go#L216) (for reserved profiles).
  * UpdateGlobalParams is a tool that can be used to set a global transaction "fee rate." This is useful for when the network is getting spam attacked, as it allows [a global fee rate](https://github.com/bitclout/core/blob/5ce03b9318b6b447f895cc9db7d61de54736c1a6/lib/block_view.go#L287) to be increased fairly quickly (in contrast to other chains where node operators must individually adjust their fees, leading to consensus issues). It also allows for the adjustment of [CreateProfileFeeNanos](https://github.com/bitclout/core/blob/5ce03b9318b6b447f895cc9db7d61de54736c1a6/lib/block_view.go#L284), which is the fee required in order to create a profile on the BitClout blockchain. The core devs hope to make both of these parameters override-able in the near future.
  * SwapIdentity is used to transfer reserved profiles from the core devs to the users who are claiming them. It is also useful in restoring someone's account if they lost their private key. It transfers creator coin holdings but, importantly, **it does not affect BitClout balances --&#x20;*****nothing can change BitClout balances without a user's signature*****.** Soon, this will be usable by anyone, not just the ParamUpdater public key holders, to implement things like third party marketplaces for usernames. Once this happens, the ParamUpdater public keys will no longer have the ability to transfer arbitrary profiles.

### **How decentralized is the BitClout Blockchain, and what is the roadmap for further decentralization?**

Today, the BitClout blockchain is fully replicated across dozens of independent nodes all over the world. [Anyone can run a node](https://docs.bitclout.com/devs/running-a-node) and join the network, and because it is currently based on proof of work, anyone can mine blocks as well. This has already resulted in [hundreds of apps](http://bithunt.com) being built on the BitClout blockchain, including:

* [Flick](https://www.flickapp.com/bitclout) is an amazing BitClout iOS and Android app that was created by @nigeleccles, who co-founded FanDuel previously. They and others like [Cloutfeed](https://bitclout.com/u/cloutfeed) and [Cloutie](https://bitclout.com/u/CloutieApp) did such a good job that core devs will never build an app. Third-party apps are first-party apps on BitClout.
* [BitClout Pulse](http://bitcloutpulse.com) is an awesome "Bloomberg Terminal" for BitClout. [BitClout Signal](https://bitcloutsignal.com) is amazing for transaction history and analytics as well. They both built timeseries tech that the core devs couldn't, and they blow the reference implementation’s indexes out of the water.
* Our favorite block explorer is NOT the one we built, it's [explorer.cloutangel.com](http://explorer.cloutangel.com). Just compare it to our block explorer at [explorer.bitclout.com](https://explorer.bitclout.com). Head to head, ours is a joke. CloutAngel is better in literally every way.
* And then of course there's [Moonbounce](https://getmoonbounce.com/), which is creating amazing engagement tools for creators on BitClout that will unlock new behaviors and interactions between creators and their followers.

Additionally, although we don’t track the number of nodes currently running, it is important to mention that the node Docker images have been downloaded over 10,000 times, and we have seen hundreds of nodes on the network at any given time.

BitClout’s model differs from pure proof of work, however, in that it allows node operators to specify a set of [trusted block producers](https://github.com/bitclout/core/blob/27426de8fd6dfb5d0d0e98a2f6b82773d92a6288/cmd/run.go#L165). When a node sets a set of trusted block producers, it will only accept blocks if they have been signed by at least one of the block producers in the set. So, for example, all the major exchanges could include each others’ public keys as trusted block producers. If they did this, then the network would be more centralized, but it would also be more robust to censorship by miners.

In the short term, this mechanism is useful in preventing 51% attacks while BitClout is in such an early stage. When bootstrapping a proof of work network, there is a problem whereby early in the network’s development, the hash power is not high enough for it to be secure against 51% attacks. Thus, proof of work networks generally suffer from a chicken and egg problem: They can’t get enough hash power to defend against 51% attacks. When, instead, blocks require both miners and block producers to agree on each block, the system is safe as long as at least one of the two groups is behaving. And if either group starts misbehaving, then the other group can fork it out. For this reason, the core developers don’t operate any mining hardware; it is fully community-run, and the hash power can be tracked on [bitpool.me](http://bitpool.me) (which is also completely unaffiliated with the core devs).

Importantly, in the long run, which is likely a matter of months, BitClout intends to move to a full proof of stake system, whereby the need for the trusted block producer model will be eliminated.

### **Can BitClout scale?**

The technical project of scaling centralized social networks occurred about 10-15 years ago, during the mid/late 2000s, when social networks rose from \~0 to 1B users. It’s now been about 10 years since that hypergrowth phase. With the lessons learned, we think it may now be feasible to scale a decentralized social network.

In the following discussion, an important point is that BitClout gives strong incentives for people and companies to run full BitClout nodes with significant hardware resources, because they can run custom frontends on top of the nodes (essentially their own versions of bitclout.com) and monetize them through fees and added features.

We have four phases currently planned for scaling BitClout.

* Phase 1: Bigger blocks.
* Phase 2: Warp sync.
* Phase 3: Sharding.
* Phase 4: Advanced Cryptography.

The math below walks through BitClout's scalability at each stage:

1. Bigger blocks
   * The average BitClout blockchain post size is **218 bytes**.
   * There are 10 other [transaction types](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L239) besides `POST`, such as `LIKE` and `FOLLOW`. In a recent block, posts were about **1/3** of the total block size.\
     \ <img src="https://lh4.googleusercontent.com/YSLyEVtV0Ynx--mta7IP3QS5aVrZiq7MBVmIc9h9bZwbCrLXXTIIDzO2Gm9RYOjaqQONhOju-F7RvaTIVO6vWJ5AMASXIYHMI4z9sjK3acpoXOmhRHX99-35qS4I54KBl2C3zjnH" alt="" data-size="original">
   * The BitClout blockchain currently produces up to 2MB blocks every 5 minutes, as you can see from [bitcloutpulse.com/explorer](https://bitcloutpulse.com/explorer).
   * So it can scale to \~30 transactions per second, **which is \~10 posts per second** (= 2e6 bytes/block / (218 bytes/post \* 60 seconds/minute \* 5 minutes/block) \* 1 post / 3 transactions).
   * If we increase the block size to 16MB blocks every five minutes, we can roughly extrapolate that it scales to \~240 transactions per second = **\~80 posts per second**.
   * For comparison, Twitter has approximately [6000 posts/second](https://www.dsayce.com/social-media/tweets-day/#:~:text=Every%20second%2C%20on%20average%2C%20around%206%2C000%20tweets%20are%20tweeted%20on,August%202014%20with%20661%20million.) on average with 300M users.
   * So, at 80 posts per second, we should be able to roughly accommodate about 80/6000 = 1.33% of 300M users, or **4M users**.
   * That’s where we can get with a basic block size increase alone. But we have a few other cards to play.
2. Warp sync
   * With an Ethereum-like [warp or snap sync](https://blog.ethereum.org/2021/03/03/geth-v1-10-0/), we loosen a key constraint, which is the need for all nodes to always validate the entire history of transactions. (You can still run an archival node, but this won’t be necessary for normal operations.)
     * As a concrete example, if all you're downloading is the current creator coin balances for each user, then all that user's trades are effectively compressed into a few integers because you don't care about the history (only the end state).
   * Instead, we move to a model where nodes by default first sync and validate a snapshot of the current blockchain state and then sync only a few week's worth of blocks on top of that.
   * Generally, the bottleneck to blockchain performance is validation speed. With BitClout, we've run tests that indicate a node running on an Intel Xeon E-2276M can validate transactions at the rate of **\~12MB/s = 1.04TB/day = \~55,000 txns per second**.
   * So, if we start by just downloading the state with minimal validation, how big can it be? To download 10TB at 10gbps = 10e12/10e9\*8/60/60 takes about \~2.2h. To download 100TB at 10gbps = 10e12/10e9\*8/60/60 is about **\~22.2h to download the state**.&#x20;
   * With warp sync, the block size can be increased beyond 16MB because the number of blocks required to get a node up-to-date can be reduced to only one week's worth of blocks rather than the entire history of blocks from the beginning of time.
   * Let’s suppose then that using warp sync we increase the block size further to 120MB blocks. How many transactions per second (TPS) would 120MB blocks every 5 minutes facilitate? If we assume 218 bytes per transaction (which is what the value is per post), then (120e6 bytes / (5 minutes \* 60 seconds/min)) / (218 bytes/txn) =  **\~1,800 transactions per second**.
   * How much bandwidth would it take to synchronize one week of 120MB blocks appearing every 5 minutes, and how long would it take in wall clock time?
     * Bandwidth would be roughly (120e6 bytes/block \* 1 block/5 minutes \* 60 minutes/hour \* 24 hours/day \* 7 days/week) / 1e9 bytes/GB = 238GB/ week
     * At the aforementioned validation speed of 12MB/s on an Intel Xeon E-2276M, it would take approximately 238e9 bytes/week / (12e6 validated bytes / second \* 60 seconds/minute \* 60 minutes/hour) = **5.5-6 hours to download and validate one week of 120MB blocks** at a validation speed of 12MB/s on good hardware. &#x20;
   * Under these assumptions, This means that the warp upgrade can allow us to sync a node in \~5.5h while maintaining 1,800 transactions per second (TPS) long-term.
     * 1,811 tps vs Twitter with 6,000 posts per second and 300M users (assume only posts, no likes)
     * Users = 300M \* 1,811 / 6000 / 3 txns per post = **\~30M users.**
3. Sharding
   * All transactions can then be write-sharded to make syncing a node parallelizable, thus providing potentially another order of magnitude speedup. For example, we could do a very simple optimization, which is to shard all posts into their own sub-chain, and then shard other transactions across two of their own subchains.
   * This would result in a node being capable of syncing 3x faster, meaning that we could support **\~90M users without an increase in sync time**.
   * Ultimately, all transactions can be sharded into sub-chains by user ID, which would allow for virtually unlimited parallelization. For example, with ten shards, we achieve another 3.3x multiplier on the TPS without an increase in sync time, thus achieving **\~300M users**.
   * This number can be scaled further by increasing the number of shards.
4. Advanced cryptography
   * This is highly speculative, but current research into zk-SNARKs is showing positive results, indicating that we could one day be able to use these primitives to scale without requiring nodes to sync the full state from one another.

### **Is there obfuscated code in the BitClout blockchain miner?**

No. The BitClout reference implementation contains a fully open-source CPU miner with good comments [here](https://github.com/bitclout/core/blob/main/lib/miner.go).&#x20;

Some independent developers offered obfuscated binaries tailored to GPU mining, offering faster hash rates using proprietary software, but the BitClout core developers were not involved in this (and we take no issue with this since it allows third-party developers to make money off of their IP). Moreover, awesome developers like @lobovkin have since [open-sourced their GPU code](https://github.com/lobovkin/BitPoolMiner)!

### **Why does signing transactions have to go through an iframe at identity.bitclout.com, and is there a roadmap for local /offline signing?**

It doesn’t have to, and the BitClout core devs provide [a whole suite of tools](https://github.com/bitclout/backend/tree/main/scripts/tools/toolslib) that allow independent developers to construct and sign transactions without needing to rely on identity.bitclout.com. Moreover, web clients can use whatever identity provider they want since all the code that powers identity.bitclout.com is open-source.

### **How does code for the BitClout blockchain get updated?**

Below are the steps to update nodes on the BitClout network, as it exists today:

* Code is merged on [GitHub](https://github.com/bitclout).
* A release tag is updated to some commit by the core devs.
* All node operators who are running Docker images that point to the github.com/bitclout/\<repo> reboot to pick up the updates.

This process is relatively centralized, but it’s how most other chains work currently. The check against centralization is the fact that ***any group of sufficiently-motivated developers can hard fork all of the code and data at any time because both the code and data are totally open.***

### **How does Bitclout.com moderate content?**

All users have the right to post, like, comment, message and do all basic BitClout functions forever, as long as they are willing to pay mining fees for their transactions. This is because anybody in the world can [run a BitClout node](https://docs.bitclout.com/devs/running-a-node), which means anybody in the world can access the full range of social network features at all times. Users can also choose from a [long list](https://bithunt.com/explore) of nodes other than bitclout.com such as [bitcloutpulse.com](https://bitcloutpulse.com) and Flick, which have their own distinct moderation policies.

Each individual node on the BitClout network has its own distinct moderation policy. If you want full freedom, you can run your own node fairly easily; however, if you’re using someone else’s node then you are subject to their moderation.

We believe this model of “node-level” moderation presents a significantly more decentralized approach to curating public discourse than what is offered by existing social media today. This is because the barrier to entry for running a node is so low, that we can expect thousands of them to exist, and thus a wide range of diversity in how discourse is curated.

See [running a node](https://docs.bitclout.com/devs/running-a-node). Also see [here](broken://pages/-MdGYmMhQ3M-1afZqzHc#can-i-view-sell-and-access-my-usdclout-and-creator-coins-on-another-bitclout-node-if-my-profile-was-removed-at-bitclout-com).

### **Can I view, sell, and access my $CLOUT and creator coins on another BitClout node if my profile was removed at Bitclout.com?**

Yes. With BitClout, all profiles and posts are stored on the blockchain forever. You cannot remove a profile or post from the blockchain once it has been created and mined into a block.

Individual nodes are responsible for serving their own curated “view” over the blockchain, and they can choose what content they want to show at the node level.

bitclout.com is one node on the network, but there are already many others that do their own totally distinct moderation, such as bitcloutpulse.com, bitcloutsignal.com, prosperclout.com, and tijn.club. The decisions behind what bitclout.com shows do not affect these other nodes.

For example, bitclout.com does not surface all profiles in its UI; it filters out certain profiles that are spamming, scamming, or impersonating legitimate users. To see any profile that is not available on bitclout.com, you can generally just go to any node that is not bitclout.com. For example, any of the following nodes currently show all profiles:

* <https://bitcloutsignal.com/history>&#x20;
* <https://www.prosperclout.com>&#x20;
* <https://tijn.club>

Note that reserved profiles are controlled by the core devs until they are transferred, and so the coins owned by those profiles are not in the custody of the corresponding Twitter user until they are claimed. This means the core devs reserve the right to remove profiles prior to transferring them, as discussed [here](https://app.gitbook.com/@bitclout-1/s/diamondhands-drafts/~/drafts/-Mda9JRswSJvc85UwFlq/bitclout-faq).

### How does the global feed work?

Every node operator gets to curate what shows up on their own global feed, as described and shown [here](https://docs.bitclout.com/devs/running-a-node#managing-your-feed). This means that, in the very near future, we will have many feeds, not just the global feed on bitclout.com, as described in more detail [here](https://docs.bitclout.com/devs/running-a-node#running-your-own-feed).

In addition, the follow feed will *always* shows you every post from all the people you follow, which reduces the reliance on node-level curation. Once you're following enough people, there ceases to be a need to check the global feed anymore.

This being said, there are no strict guidelines on anything that shows up in the global feed on bitclout.com. In the short-term, because bitclout.com aims to appeal to as wide an audience as possible, the content will generally bias more toward things that have mass appeal. But that's about it.

## **4. $CLOUT**

### **Can you cash out your $CLOUT for BTC?**

Yes! The BitClout cryptocurrency recently listed on [exchange.blockchain.com](http://exchange.blockchain.com). There, you can exchange BitClout for USD and Bitcoin. Other exchange listings are coming soon!

### **Why are there so many coins in the Genesis Block?**

This is a commonly-misunderstood issue, and it is due to the fact that there was a hard fork in March 2021 that compressed all transactions between November 2020 and March 2021 into a single block. This made it look as though the BitClout core developers gifted coins to early purchasers, when in reality everyone bought right off the bonding curve defined in [supply.go](https://github.com/bitclout/core/blob/738005f9746454374121224b6ca646ce4d0ffb68/lib/supply.go#L1).

### **What happens to the BTC people use to buy $CLOUT?**

Today, node operators can specify a [CLOUT wallet](https://github.com/bitclout/backend/blob/527751f1358aae19b13450cad2c0d270b9ba226b/cmd/run.go#L129) and a [Bitcoin wallet](https://github.com/bitclout/backend/blob/527751f1358aae19b13450cad2c0d270b9ba226b/cmd/run.go#L128) and allow their users to seamlessly purchase CLOUT for Bitcoin through their node. The node operator can then use the Bitcoin they accumulate purchase CLOUT from an exchange to refill their CLOUT wallet and earn a "slippage fee" for this service (basically acting as a market maker).

Prior to the [Deflation Bomb](https://bitclout.com/posts/3a13a7e4342148e76e1de957f22775a4f6916ed809a90e77a035bb7cefaaaf44?feedTab=Global), CLOUT was purchased via a [BitcoinExchange](https://github.com/bitclout/core/blob/31735a82b8446421176df151dd5f80d9dac2eabd/lib/network.go#L208) transaction on the BitClout blockchain, which resulted in BTC accumulating in a treasury wallet. For security reasons, we cannot publicly explain exactly how these funds are custodied. This being said, the core dev team is working on clarifying the governance around this wallet and should have some updates very soon.

## 5. Community Questions

A community AMA recently resulted in some [amazing questions](https://bitclout.com/posts/d4d29c0adb284da5190d61593e9dafceddeb92ea02e9d0771f0e6c5f05b6d44c). We decided to give them their own section here to make sure they were all covered.

### Roadmap

#### Can we have more visibility of the product roadmap? This will help the dev community to build appropriately. Would you consider making the roadmap public? (@GeneGMB @Davidsun @usmansheikh @CloutCurator)

We are working on formalizing this. The priorities fluctuate, but below are some priorities for the next month or two as of July 2021 (which is a long time for BitClout!). These are from memory as I'm typing fast, and I'm probably missing several:

* **NFTs** We will be getting feedback on the community for some proposals prior to this, and are looking to develop and launch this a little more collaboratively than other features.
* **Improve the onboarding and overall look and feel of the reference client.** The core dev team has retained a professional design firm to work on these. And all improvements become instantly accessible to the community via the open-source repos.
* **Notifications.** Currently, bitclout.com sends precisely zero email and phone notifications, even if users have opted into them. It's somewhat ridiculous that this is the case, and that BitClout has the traction that it does given the lack of a "notification loop," but it will be fixed soon (and all node operators will benefit).
  * Part of this work requires txindex to be more efficient, which is a top priority in its own right. There is currently an experiment underway to move it to Postgres, which will make it easier to query as well.
* **Derived keys (aka permissions).** Third-party apps on iOS currently have issues using identity.bitclout.com due to app store restrictions. Separately, many have expressed a desire to have someone else manage their account without giving them access to their funds or their seed phrase. Both of these concerns will be addressed by a proposal we're working on to allow "derived keys" to sign transactions on behalf of a "master key" for some period of time. We are working with Flick and Gem on this in particular.
  * Along with this work is implementing a way for ordinary users to transfer their profile to a new key, which will allow us to hopefully remove/sunset SwapIdentity.
* **Referral program and gas on the fire.** Almost no money has been spent to acquire BitClout users, and the core dev team has yet to tap into a deep bench of high-powered connections to grow BitClout. This is because the core devs have wanted to refine everything before "pouring gas on the fire." This being said, we believe that after completing the other priorities, we will be ready. And every user we acquire will create value not just for bitclout.com, but for all third-party apps.
* **Scaling.** Soon we will hit the limits of "big block" scaling (see [here](https://app.gitbook.com/@bitclout-1/s/diamondhands-drafts/~/drafts/-MdaSuHgyhxyqnpDFNo0/bitclout-faq)). We will be working very hard with the community to make sure the warp upgrade is in place prior to this point.
  * Along with this work is investigation into the optimal way to move to full proof of stake.
* **Listings.** In the background of all of this, expect more listings. Smaller exchanges will be faster to list than bigger exchanges, but we are working with as many as we can to list CLOUT on as many venues as possible. Every listing brings with it new users on these exchanges that have never heard of BitClout before, serving as a great growth hack in and of itself.

#### When will decisions & timescales for move to Proof of Stake be open for review? (@Davidsun @tijn)

There is no designated time on this yet, but hoping within 3 months of July 2021.

#### When will verification and profile blocks move on chain and how will this work? (@ItsAditya @Tijn)

There is a PR to move blocks on chain that will be merged soonish. For verification, we have a proposal that we call "associations" that will allow any profile to "associate" with another profile, creating a directed graph of "associations." The blue checkmark on bitclout.com will then become a special case of this, as simply an association between a bitclout.com profile and a user, and each node will be able to provide its own blue checkmark via its own on-chain association.

This same primitive can also be used by universities or other credentialing authorities in the future as a means of doing cryptographically verifiable diplomas. This would cause BitClout to become a sort of "identity hub," and eat into the LinkedIn use-case.

But we need to write it up and run it by the community first :)

#### Was Bitclout originally intended to focus on coin price, gains, trading ? And what consideration was given to this maybe encouraging bad behavior and bad actors by design? (@GeneGMB)

It was intended to promote positivity and unity over division and toxicity, while also allowing creators to earn more per follower than on any other platform. Coin price, gains, and trading, to the extent they are a big part of BitClout, are a means to that end.&#x20;

#### Will there be a function to lock-up an X part of your coin for an X part of time in our profile? (@Nigels)

The amount of time we've spent thinking about lock-ups... There is a tremendously long doc that walks through many proposals and explains why we haven't publicly proposed something here yet, but it's not properly anonymized. I will share it soon...

#### How about giving creators the optionality to reject investors?

There has been a lot of discussion about this, and it's mainly a matter of getting the user experience right. For example, if a creator wants to approve every buy, then do they have to be approved in order? And we need to think about edge cases where a lot of buys queue up and the creator accepts them all at once. It's all solvable, and we look forward to iterating on proposals with the community once we get through a couple major releases like the NFTs launch.

#### When will we be able to give ‘bananas’? #apelife 🦧🦧🦧 (@DannyWithAlotOfUgene)

Great idea for a third-party node: ApeClout. BitClout for apes. Diamonds can be reskinned as bananas, among other things.

### Community Engagement

#### Can we have a regular community engagement event, like Clubhouse has their weekly Townhalls (@Davidsun @GeneGMB @CloutCurator)

I would love to do this, but we're very focused on shipping. Once we hit the "gas on the fire" point above, however, I think doing more community stuff will make more sense.

#### What is the status of CIPs and can you give us a top line summary of what scope the CIPs will focus on? (@tijn)

We've been thinking a lot about how to do them. Right now, because speed is essential to the development of BitClout, we are leaning toward a more casual process, whereby changes can just be submitted via GitHub issues or pull requests and merged with two approvals from the core devs (with some process for making sure your change is something that's needed). But we are hoping to write this out more coherenly soon. Just a lot to do.

#### Will there be hackathons, covering product, user experience, and dev? (@Davidsun @GeneGMB)

We need the community to do this right now. Again, there are some very high-value things the core dev team wants to focus on, and so we need to put all of our energy on those, and only do very scalable things like this AMA.

#### Will there be a fund to support the developer eco-system (@Davidsun)

This would be great, and we hope to develop this more. In the short-term, everyone who we've spoken to about funding has been able to raise tons of money from venture capitalists and hasn't needed any help, which is a very good sign that the organic incentives to decentralize are working as planned.

#### In work underway to implement a badges / profile system on Bitclout? Eg designate profiles ad user, trader, creator, developer, project? (@brootle @GeneGMB)

Good idea! We haven't thought about this, but it could be interesting. I would put it as a lower priority than the things mentioned in the roadmap, though, and it does seem to require quite a bit of manual labor to curate.

#### What criteria are or will be used for user verification as it seems inconsistent at times ? And will there be away to get verified without social profiles (@ItsAditya @lukasjakson)

See my answer about "associations" previously. The long-term answer is that every node should do its own verification to avoid concentration, and this is precisely why bitclout.com verifications don't carry over to other nodes. Today, bitclout.com verifies users if they have a verified checkmark on Twitter, with very rare exceptions in cases where it looks like a user will add a lot of value to the community. Again, the long-term answer, though, is that no one entity has universal power over this, so that many different standards can compete.

#### Considering the official twitter account, how do you balance this with being a decentralized network - how do you balance anonymous vs public involvement? (@zopel)

In a perfect world, the core devs could just focus on shipping. But we're practical and will do public stuff (anonymously) as needed to make sure the vision is being communicated appropriately.

#### What can non dev's do to help / support the project? (@luce)

Keep doing what you're doing! We are doing our best to read all the PRs, and hopefully it will become easier once the priorities are more known and the process for submitting changes is more fleshed out. **Additionally, onboarding as many devs as you can to BitClout is probably the number one thing you can do to grow the community!**

### Growth

#### What is the plan for growth ? Many devs funding projects based on anticipated growth. Crypto bear market may cause considerable reduction in engagement. (@Davidsun @GeneGMB)

See the [roadmap](/faq/bitclout-faq#roadmap). Gas on the fire will come once a few more big product improvements ship.

#### What are the plans for improving user onboarding? Could there be a welcome page for new users with trusted resources, creators / investors to follow, and best practices? Maybe have a user support centre for reporting and tracking issues? (@GeneGMB)

Yes, it's a top priority. See [roadmap](/faq/bitclout-faq#roadmap).

#### ~~What happens on 10 August when Bitclout.com expires?~~ Bitclout.com has been renewed until 2022. (@tijn)

Saw that; thanks guys. We want bitclout.com to eventually shut down full-stop, and it would be great if we could make it happen that quickly, but it will take a little bit more time than that.

#### Are you hiring ? (@Davidsun)

Yes! We've had issues hiring since we're not a company and everyone is pseudonymous, but hoping to at least put up a resume drop or something soon for people who are interested.

#### What efforts are being made to convince a major social media platform to test-run a Bitclout front end; either as an optional mode or standalone app? (@AndyFazliu)

I can't say anything about this just yet, but I'll give you a hint: Exchanges >> Social Media Companies for this because it allows them to break into social as an adjacent business.

### Reserved Accounts

#### Why can’t I access the formerly reserved profiles of many founders like @conaw, VCs like @ariannasimpson, of whom I hold coins in? Did they asked to have their profiles moved? What happens to those that invested in those coins before removal? (@Marnimelrose @Davidsun)

See [here](/faq/bitclout-faq#can-reserved-profiles-be-removed-prior-to-being-claimed).

#### A big problem is reserved profiles just activating their accounts so they can dump. Would you be open to locking the "gifted" coins of pre-reserved profiles for at least 3 months? Or maybe requiring a month of active posting ? (@lukasjakson @OscarArgaez)

See the answer on locking.

#### Will there be an option for reserved accounts to delete their profile if they dont want it? And in that case what will happen to the creator coins & investors? (@OscarArgaez)

Yes. See [here](/faq/bitclout-faq#how-do-i-remove-my-profile-from-bitclout-com-if-it-was-reserved). Their coins remain locked in the profile once they are removed, but will eventually be sold after everyone else has pulled their money out.

### Exchange

#### @diamondhands indicated any Bitclout sold by them on bitclout.com is purchased on blockchain exchange. Does this mean its 1:1 purchase, or does the "Bank" pre-purchase clout on site prior to selling. Do you market buy on Blockchain or place limit orders. Can we have more transparency about $clout purchases on site vs on exchange for the bitclout.com bank? (@lukasjakson @Krassenstein @Davidsun @tijn @Shhubham)

Good question. It's not perfect because we don't have a great way to know exactly what price all the Bitcoin came in at. We try and put in limit orders at approximately the price we sold it at. Sometimes we can't execute at those prices and have to raise it, in which case we lose some CLOUT. It's hard to give much more transparency than this here, but hopefully this makes sense.

### Investing

#### What criteria do you (@diamondhands) use when you invest in a coin (@PAZAN)

When someone creates a lot of value for BitClout or when they're doing something that speaks to me, I invest.

#### What factors influence the BitClout price? (@PAZAN)

Our good friends supply and demand, and supply is fixed as of the Deflation Bomb :)

#### Are there vesting schedules for the original VCs? Is there any deal contractual or otherwise with large early investors on when and or how to sell ? If not what deterrent do they have not to dump early? (@Davidsun @flanagan)

The VCs bought off the bonding curve just like everyone else, so technically no. That said, all of the early coin-holders were selected on the basis that they are long-term holders, and I'm not aware of a single one that has sold or plans to sell in the near future (and we watch the blockchain.com deposits). VCs in particular typically have 5-10 year investment horizons by default, and they literally can't sell until their funds are up.

### Blockchain / Genesis

#### Why does the transaction ID of genesis block reward not show up as an input for transactions spending clout from genesis block? (@carsenk @tijn)

It's a bug. I think it's fixed in the rosetta-bitclout repo but I can't remember if we merged the change back into core.

#### BitClout wallet contains over 4k BTC from clout sales prior to genesis, and after. What is its purpose / role ? (@Davidsun @Tijn)

See [here](/faq/bitclout-faq#what-happens-to-the-btc-people-use-to-buy-usdclout).

#### Whats the role of the 2m clout generated by the devteam as result of FR on 8m genesis clout? (@tijn @AndyFazliu)

Can't say anything about this yet, but we're working on it and should have an update soon.

#### What is the long term plan for the SWAP\_IDENTITY god power transaction ? It would allow core team to take over any account. While its in place, what protocols are in place to secure & limit abuse of this transaction? Related, An open SWAP transaction signed by two parties would be very useful (@CloutAngel)

The plan is to implement "transfer profile" as a transaction type that any user can use to move their profile from one key to another. Once we have this, we don't need SWAP\_IDENTITY anymore since we will be able to transfer reserved profiles using this non-god-mode transaction type. The reason we didn't come out the gate with a fully-functional transfer-profile is because making it work efficiently is hard, and requires re-indexing posts and other content to use a PKID rather than a public key (grep the code for PKID to see what I mean).

#### What was your thinking and reasoning behind not storing creator coins directly on chain, but instead just storing the purchase/sell transactions? This introduces possible issues with financial accounting & taxation. (@CloutAngel)

I'm not sure what this is asking. Creator coins are stored directly on-chain.

#### When will independent nodes be able to "decide" what transactions are included in blocks? (@CloutAngel)

I'm not sure exactly what this is referring to. Block producers and miners, together, decide what transactions go into blocks.

#### How do creator coins scale given that miners can theoretically "front-run" blockchain transactions?

This problem is generally known as "miner extractable value" or MEV. The solution is to have a "slippage" parameter set on every creator coin transaction, and that's currently the case today. By having such a parameter, you are capping the amount a miner can extract. This is exactly how Uniswap works as well.

### Behind the Curtain

#### Who is the funniest and who is the most sarcastic in the core dev group? (@cloutviz)

Ha. Good question. @maebeam is the most playful for sure. Beyond that, everyone has a pretty good sense of humor. @diamondhands has a very witty, deep cut style of humor if you can imagine it.

#### How did the core devs all come to work together (@tijn)

Without revealing too much, two of the core devs have known each other for over a decade, and everyone is a good friend.

#### How long has Bitclout been in development before it was released earlier this year? (@tijn)

@diamondhands started working on it religiously in early 2019, alone, in total isolation. He didn't tell anyone about it until very late in 2020. At that point, he felt it was finally ready to tell people about, and brought on the second core dev. The rest is history.

#### Will the core devs always remain pseudononymous or will there be a face reveal (maybe at $1k clout price) ? (@tijn)

Pseudonymous for sure. Not only because we prefer it, but also because we think it's the best way to build a truly decentralized platform and to empower third-party devs. BitClout has no CEO or board of directors or shareholders, and pseudonymity helps reinforce that. Nobody will ever de-platform third-party devs, and no company will ever get between a creator and their followers.

#### What does the core dev team have at stake / invested? (@AndyFazliu)

A lot :)


# Privacy and Security

## **What is a seed phrase?**

Your seed phrase is the password that controls your entire account. **Your seed phrase can never be changed and sharing your seed phrase with anyone could result in total loss of funds.**

## **Does bitclout.com have access to my seed phrase?**

**No, bitclout.com does not have access to your seed phrase.** Your seed is stored in your browser in a highly-secured `iframe` that is completely isolated from the rest of the app. Transactions are signed in your browser by this `iframe` and **your seed phrase never leaves your browser.**

## **How do I keep my account safe?**

**For maximum security, the developer community recommends you use mobile browsers or the BitClout desktop app to access bitclout.com.**&#x20;

Both mobile browsers and the BitClout desktop app are secured, sandboxed environments that cannot be easily compromised by third party attackers.

While bitclout.com is generally safe to access in a regular Desktop browser like Chrome, Safari, Firefox, etc, there is some risk that malicious browser extensions could steal your seed phrase if you give them access to bitclout.com. **This should be rare, but if you own a large amount of BitClout it is recommended that you either disable extensions manually or use Incognito mode, which disables extensions automatically.**

Furthermore, if you own a large amount of BitClout it may be prudent to create two separate accounts: one account that you use to post and follow, and a separate account to hold your coins. This will be easier to manage once creator coin transfers are launched.

## **What do I do i**f I lose my seed phrase?

Because your seed phrase is stored exclusively in your browser, it cannot be recovered by any third party, including bitclout.com. **If you lose your seed phrase, currently the only option is to create a new account, save the new seed phrase, and send all of your holdings to this new account.** You may need to liquidate your creator coin holdings into BitClout first. You can transfer a username by first changing the username on the old account and then quickly claiming the username with the new account.

We apologize for the inconvenience here. We know this process is not ideal, we're working on alternative solutions, and hope to have an easier recovery path for users in the future.

## How does BitClout Identity work?

BitClout Identity, located at [identity.bitclout.com](https://identity.bitclout.com), safely stores your sensitive account information in your browser's local storage. To protect private key material the identity service has minimal dependencies, a strict content security policy, and is audited by multiple security firms. **For now, the developer community does not recommend entering your seed phrase anywhere other than identity.bitclout.com.** Always check the URL bar to verify you are using identity.bitclout.com.

The BitClout Identity Service aims to make it easy for users to use a wide array of community projects safely and securely. Apps and nodes can integrate with BitClout Identity to onboard users without requiring them to enter private key material. Users can easily grant different levels of access on a per-account basis. The developer community is working on complete documentation for integrating with the BitClout Identity Service.


# Setting Up Your Dev Environment

This doc will teach you how to set up your dev environment. Although it's not a hard prerequisite, we recommend skimming the [BitClout Code Walkthrough](/code/walkthrough) first, as it provides some useful context.

## Prerequisites

To run the frontend repo, you will need to be running Node v13.13.0 and NPM 6.14.4. We recommend using NVM to set this environment up. To run the backend you'll need Go v1.15.6 installed.

We will also assume that you have [Goland](https://www.jetbrains.com/go/) installed. This is the recommended IDE for developing on BitClout since most of the code is Go code.

## Setup

First, you must checkout all repos into the same directory. Some of these repos are technically optional, but checking them all out allows you to hop around the code more easily.

```
cd $WORKING_DIRECTORY
git clone https://github.com/bitclout/core.git
git clone https://github.com/bitclout/backend.git
git clone https://github.com/bitclout/frontend.git
git clone https://github.com/bitclout/identity.git
```

Once all of these repos are checked out, we recommend importing them into a single Goland project. This allows you search across and develop on all of of the repos concurrently. To do this, open Goland, hit File > Open, select a repo folder, and select "Attach" when prompted. If you do this correctly, you should have all four repos loaded into a single Goland project.

If you're not familiar with Goland, the following hotkeys are useful for jumping around the code ([full cheat sheet here](https://www.jetbrains.com/help/go/mastering-keyboard-shortcuts.html)):

* SHIFT+SHIFT: Open any file across all four repos with fuzzy search.
* CTRL+SHIFT+F: Search across all four repos at once with regexes.
* CTRL+SHIFT+A: Runs any action that you would normally find in a menu.
* CTRL+B: Jump to definition or find usages.

If you like Vim, you can also install the Vim plugin so you get your typical Vim hotkeys.

## Building and running locally

### Running the frontend in development mode

```
# Assume we're starting in $WORKING_DIRECTORY, which contains all the repos
cd frontend
npm install

# The following command will serve the frontend on localhost:4200 with
# auto-reloading on changes. You must run a node before the site will
# actually work however (see next section).
ng serve
```

### Running the node in testnet mode

```
# Assume we're starting in $WORKING_DIRECTORY, which contains all the
# repos. Also assume we have "ng serve" running.
cd backend/scripts/nodes

# The n0_test script runs a testnet blockchain locally. It starts mining 
# blocks immediately at a much faster rate than mainnet. You can set your 
# public key to receive the block rewards by setting it as --miner-public-key 
# in the arguments. This gives you funds that you can test with. You can see 
# the status of the node by going to the Admin tab after logging in with an
# account and then going to the Network subtab.
./n0_test

# Once n0_test is running, you must navigate to the following URL. 4200 is the
# port for ng serve. Note that in order to be 
http://localhost:4200
```

By default, your browser will point at `localhost:17001`, which is the default "mainnet" API port. However, when you run n0\_test, your node spins up on `localhost:18001`. To point your frontend at your testnet node, however, you must open up your inspector and change your `lastLocalNodev2` parameter to `localhost:18001` as shown in the screenshot below. After you do this, you should be able to Sign Up, and everything should work normally.

![](/files/-M_zzdSq3ixQztmxlAIc)

### Running the node in mainnet mode

Most of the time, we develop using testnet mode because it's fast and cheap. However, to make sure our changes work before pushing we like to run full-blown mainnet nodes locally.

```
# Assume we're starting in $WORKING_DIRECTORY, which contains all the repos.
# Also assume we have "ng serve" running.
cd backend/scripts/nodes

# The n0 script runs a node that connects to mainnet peers. It will download
# all the blocks from its peers and then start syncing its mempool from them.
# You can see the status of the node by going to the Admin tab after
# logging in with an account and then going to the Network subtab. Note that
# syncing the blockchain may take an hour or so.
$ ./n0

# Once n0 is running, you must navigate to the following URL. 4200 is the
# ng serve port. It should automatically hit your node, which should be
# exposing its API at localhost:17001.
http://localhost:4200
```

## Running a local identity service (optional)

Running an identity service locally is generally not required. However, doing so is as easy as running the Angular app:

```
# Assume we're starting in $WORKING_DIRECTORY, which contains all the repos
cd identity
npm install

# Install angular cli
sudo npm install -g @angular/cli typescript tslint dep

# The following command will serve identity on localhost:4201 with
# auto-reloading on changes.
ng serve --port 4201
```

In order to point your browser at your local identity service rather than at identity.bitclout.com, you must change a localStorage value similar to what we did to get the testnet node running. In this case, we must change `lastIdentityServiceURL` to `http://localhost:4201`. See the screenshot below:

![](/files/-M_zzhIS_Vj12BbxXCV0)


# Making Your First Changes

In this tutorial, we will show you how to make changes to the BitClout codebase, and see your changes reflected in a local dev environment.

## Prerequisites

This guide assumes you have successfully made it through [**Setting Up Your Dev Environment**](/code/dev-setup). In particular, it assumes you have a testnet node running with n0\_test showing a frontend UI that looks roughly like the following screenshot:

![](/files/-Ma-C_CJI1vVZbV96zGi)

## Make Your First Frontend Change

If your frontend repo is loaded into Goland, the following steps should allow you to make your first frontend change, and see it update your local node in real time:

* Run your n0\_test. Create an account and make sure you can see the page shown in the prerequisites.
* Assuming you're using Goland, navigate to the `feed.component.ts`. Hint: You can use SHIFT+SHIFT to easily jump to it.
* Look for the `GLOBAL_TAB` function in the file and modify the return statement as follows (you can name your feed whatever you want):
  * `static GLOBAL_TAB = "Satoshi's Feed";`
* Save your changes.

After your changes are saved, your browser should update to show a new title for your feed tab:

![](/files/-Ma-Cc-6WvKC8kGAH2fE)

## Make Your First Backend Change

The backend repo runs an API that the frontend Angular app queries to get all of the information it displays. Let's make our first change to this API by following the steps below:

* Before going into the code, go to the Admin panel, add a post to the global feed, and verify that it shows up by refreshing the page.
* With the backend repo loaded in Goland, find the `post.go` file, which defines one of the API endpoints queried by the frontend. Hint: You can use SHIFT+SHIFT to navigate to it.
* In that file, find a function called `GetPostsStateless`. Modify the response at the end of the function as follows to customize the content:
  * ```
    	if len(postEntryResponses) > 0 {
    		postEntryResponses[0].Body = "This is some content"
    	}

    	// Return the posts found.
    	res := &GetPostsStatelessResponse{
    		PostsFound: postEntryResponses,
    	}
    ```
* Save the file and restart n0\_test. When you make changes to anything in backend or core, you need to restart your node for them to take effect.

Now you should see some custom content in the post that you added to the feed. You can modify endpoints in backend like this one to customize how data is returned to the user.

![](/files/-Ma-CeICfrCOMgqjFLtD)

## Make Your First Core Change

**WIP**


# BitClout Code Walkthrough

## Introduction: The BitClout Repos

Today, bitclout.com is powered by the following repos. Together, these repos make up the entirety of what runs on bitclout.com while also supporting the ability for anyone to run their own BitClout node with all of the same data that bitclout.com has access to:

* [github.com/bitclout/core](https://github.com/bitclout/core)&#x20;
  * This is a Golang repo that contains all of the "consensus" code behind BitClout. It's meant to be kernel that's embedded as a library into projects that want to build on the BitClout firehose.
* [github.com/bitclout/backend](https://github.com/bitclout/backend)
  * The backend repo embeds core as a library and exposes a rich API on top of it to support transaction construction, submitting transactions to the blockchain, storing user data, and more. In some sense, it's the first "reference" app built on the core BitClout blockchain.
* [github.com/bitclout/frontend](<https://github.com/bitclout/frontend >)
  * This is an Angular app that is the frontend for bitclout.com. It uses the API exposed by the backend repo to support all of its queries.
* [github.com/bitclout/identity](<https://github.com/bitclout/identity >)
  * This is a lightweight embeddable app that gets loaded as an iFrame in the frontend Angular app to handle all signing functions.

Below is a simple diagram that shows visually how these repositories fit together:

![](/files/-M_zz33vO8wHrDzZYQgz)

## Overview of the architecture

We think the easiest way to understand the architecture is to describe how a node syncs with other nodes, and then to walk through key codepaths with pointers to functions and line numbers. We do this below. We use the following commit hashes to refer to the code:

* core: [135c03a958039423ac2c775cb83eb2a41d903511](https://github.com/bitclout/core/tree/135c03a958039423ac2c775cb83eb2a41d903511)
* backend: [96d24569a7b4581644a330be168c441c948d9040](https://github.com/bitclout/backend/tree/96d24569a7b4581644a330be168c441c948d9040)
* frontend: [c1363f7fb0239a835b1f2c91d395c8e2d22cbb8f](https://github.com/bitclout/frontend/tree/c1363f7fb0239a835b1f2c91d395c8e2d22cbb8f)
* Identity: [665281c54b8136a5b8965fb907aac7419ac4c735](https://github.com/bitclout/identity/tree/665281c54b8136a5b8965fb907aac7419ac4c735)

### The node’s main loop

* The entrypoint to everything the node does is [`main.go`](https://github.com/bitclout/backend/blob/96d2456/main.go#L15). It's better to start tracing from the backend repo's main rather than the core repo's main, since the core repo is mainly intended to be used as a library. Moreover, since backend uses the core repo as a library, we will hit all of the core functionality by starting here anyway.
  * There is a lot of indirection in main introduced by the fact that we are using Viper to manage our command-line flags. When the backend binary is run, a command is passed, such as "run," which triggers [a `Run()` function defined in the cmd package](https://github.com/bitclout/backend/blob/96d2456/cmd/run.go#L23).
  * All available commandline flags can be viewed [in the `init()` function](https://github.com/bitclout/backend/blob/96d2456/cmd/run.go#L45). Some of these flags are initialized in [`LoadConfig()`](https://github.com/bitclout/backend/blob/96d2456/cmd/run.go#L25) at the beginning of `Run()`.
    * Note the core repo's flags are effectively imported into backend. This allows for maximum composability, whereby someone can include the core repo and get all of its functionality embedded into their binary for free.
  * Once you get into the [`Run()`](https://github.com/bitclout/backend/blob/96d2456/cmd/run.go#L23) function, everything the node does can be traced explicitly. We will be walking through some of the key codepaths below
* When a node [starts up](https://github.com/bitclout/backend/blob/96d2456/cmd/node.go#L31), it looks for peers that it can download blocks and transactions from. There are two main ways a node finds peers:
  * DNS bootstrapping. All peers scan domains of the form `bitclout-seed-*.io` to see if any valid peers are available. The function that does that is [`addSeedAddrsFromPrefixes()`](https://github.com/bitclout/core/blob/135c03a/cmd/node.go#L303) and the list of "prefixes" that are scanned is defined in [`constants.go`](https://github.com/bitclout/core/blob/135c03a/lib/constants.go#L479).
    * Because it would cost O($1M) to buy all of the seeds, and because a node only needs one valid sync peer in order to thwart an "eclipse" attack, and because a node can iterate over tens of thousand of DNS records per second, and because DNS seeds can be changed by node operators if a particular prefix is monopolized, we think this is a safe way to find initial peers.
  * Commandline flags. `--connect-ips` means a peer will connect to the specified peer and nothing else. `--add-ips` means these peers will be added to the list of things that the peer is going to try and connect to. When we spin up new nodes, we often use `--connect-ips` with a trusted node because it's easier than bootstrapping from the sea of nodes that are running in the wider internet.
* The ConnectionManager is responsible for managing all connections with peers. It's initialized using a [`Start()`](https://github.com/bitclout/core/blob/135c03a/lib/connection_manager.go#L769) function that is kicked off in main.go. Tracing the code starting from this function is a great way to understand how connections with peers are established and maintained.
* When the ConnectionManager connects to a peer, it does a "version negotiation" similar to Bitcoin. This happens in [`ConnectPeer()`](https://github.com/bitclout/core/blob/135c03a/lib/connection_manager.go#L372). If the peer passes this version negotiation, then the peer is passed off to `server.go` via a "newPeerChan." server.go is then responsible for doing higher-level interactions with the peer.
  * `server.go` is started using a [`Start()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1720), which is a good place to start tracing through it. `server.go` can be thought of as the "main loop" for the node. It is basically a single for{} loop that all peers and services are adding messages to. See [`messageHandler()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1515) to see this "main loop" in action.&#x20;
  * server.go processes two types of messages conceptually. [Control messages](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1471) and [peer messages](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1489), both via messageHandler.
    * Peer messages just contain messages that came from one of the peers that the node was connected to. You can see there aren't very many of them, and they're fairly straightforward.
    * Control messages are basically notifications about things that happened internally to the node. For example, a new peer connected or a new peer disconnected.
* When a peer is connected, server.go gets a NewPeer or [`MsgBitCloutNewPeer`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1474) control message from the ConnectionManager and handles it in [`_handleNewPeer()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L775). This is typically the "starting point" for server.go
  * If the peer is a valid one, then server.go will accept this peer as a "sync peer" in [`_startSync()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L709), and it will send it a GetHeaders or [`MsgBitCloutGetHeaders`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L765) message to start syncing headers and blocks from it.
  * The initial sync for a node is currently completely single-threaded. A sync peer is found and other peer messages are largely ignored until the node has downloaded up to the last 24 hours worth of blocks.
* Below are the steps to syncing with a peer, which can be traced by following the functions in server.go:
  * ConnectionManager passes a `MsgBitCloutNewPeer` message to server.go, which is processed in [`messageHandler()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1515).
  * Choose a remote peer as a syncPeer in [`_startSync()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L685). Call this the "remote peer."
  * Send the remote peer [`MsgBitCloutGetHeaders` in `_startSync()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L765)
  * Remote peer replies to the `MsgBitCloutGetHeaders` with a [`MsgBitCloutHeaderBundle` in `_handleGetHeaders()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L439).
    * Note that a "header locator" similar to Bitcoin is used to determine which headers are needed.
  * Node processes the `MsgBitCloutHeaderBundle` at [`_handleHeaderBundle()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L526) and responds with different messages depending on how synced the peer is.
    * If more headers are required, it sends [another `MsgBitCloutGetHeaders`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L692). Note that headers are requested until the number of headers in the [latest HeaderBundle is < `MaxHeadersPerMsg`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L604). This is how the node knows that it's downloaded all the headers the remote peer has for it.
    * If the node has exhausted the peer's headers then it downloads blocks until it has a block for every corresponding header that the peer sent it. This is exactly the same as the "headers-first" synchronization that Bitcoin does. The `MsgBitCloutGetBlocks` message is sent in [`GetBlocks()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L480).
    * Processing a block happens in [`ProcessBlock()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1494), which is a great function to trace through. It calls [`ConnectBlock()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1766), which calls ConnectTransaction on each transaction, which we'll discuss later.
    * Once the node has all the headers it needs from the peer, and if the node has downloaded and validated all the blocks from this peer, then the node is fully synced.
      * Once we get to this state, the node listens to INV messages from all of its peers. If it sees an INV message for a new block that it doesn't have yet, then it will send the peer a GetHeaders request, which will kick off this headers-first process for the single missing header/block.
* Once the node has gotten through this loop, it is fully synced and in a "steady-state." At this point, the node listens for INV messages from its peer to update its state. `INV` messages or `MsgBitCloutInv` are processed via [`messageHandler()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1515) just like everything else. `INV` messages can be for a block, as mentioned previously OR for a transaction. Below is the case for a transaction `INV`:
  * Note that some "handle" functions are defined in peer.go rather than server.go. When this is the case, the server.go [`_handlePeerMessages()`](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L1489) function will just enqueue the message for the peer's thread to process it. This is done in order to move processing into another thread for efficiency reasons (not doing this would cause server.go to be \*too\* single-threaded). Here you can see the `_handleInv()` in `server.go` [delegate the call](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1306) to peer.go, and here you see peer.go [dequeuing it to process it](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L562). Note that there are several messages that are delegated in this way, all defined in the [`StartBitCloutMessageProcessor()`](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L530) function.
  * If the node is missing a transaction that it received an INV for, it sends a GetTransactions or [`MsgBitCloutGetTransactions`](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L440) message to the peer.
  * This triggers the node's [`_handleGetTransactions()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1309) function in server.go, which results in a `TransactionBundle` or `MsgBitCloutTransactionBundle` [being sent back](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L217).
  * The node receives the transaction bundle [here](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L218) and processes each transaction in [`_processTransactions()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1334) in `server.go`.
    * When a transaction is processed in `server.go`, it is basically just calling [`processTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/mempool.go#L1887) in `mempool.go`. If the transaction is valid then it will be added to the mempool, and if not then it will be rejected. In order to validate a transaction, mempool uses the previously mentioned [`ConnectTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6043) function defined in `block_view.go`.
* Now we understand how a node syncs initial blocks, and how it accepts new blocks and transactions in the steady-state. The next step is to understand how blocks are created and mined:
  * `block_producer.go` runs in a continuous loop kicked off via a [`Start()`](https://github.com/bitclout/core/blob/135c03a/lib/block_producer.go#L522) function called in main.go. `Start()` calls [`UpdateLatestBlockTemplate()`](https://github.com/bitclout/core/blob/135c03a/lib/block_producer.go#L476) at regular intervals to create new blocks for miners to mine. This is a great function to trace.
  * Function [`_getBlockTemplate()`](https://github.com/bitclout/core/blob/135c03a/lib/block_producer.go#L110) contains the logic for constructing a new block. It basically does the following:
    * Add txns from the mempool to the block until the block is full.
    * Compute the fee, merkle root, etc.
  * Newly-created "block template" is added to `recentBlockTemplatesProduced` in [`AddBlockTemplate()`](https://github.com/bitclout/core/blob/135c03a/lib/block_producer.go#L376).
  * `block_producer.go` just produces block templates, but it's up to miners to compute winning hashes. That happens via a remote process as follows:
    * Every node exposes two functions via JSON API: [`GetBlockTemplate()`](https://github.com/bitclout/backend/tree/main/routes#L10372) and [`SubmitBlock()`](https://github.com/bitclout/backend/tree/main/routes#L10445). The URL paths for these and all other API functions can be seen [here](https://github.com/bitclout/backend/tree/main/routes#L9638) and [here](https://github.com/bitclout/core/blob/135c03a/lib/api.go#L63) (the latter powers the block explorer).&#x20;
    * Miners run [`remote_miner_main.go`](https://github.com/bitclout/core/blob/135c03a/remote_miner_main.go) and connect to any node they want via a flag. This can be their own local node or a remote node like api.bitclout.com. `remote_miner_main.go` will continuously call `GetBlockTemplate()` on the chosen node and hash it until it's found a block. Once it has found a winning hash, it calls `SubmitBlock()`, which then causes the node to process it and broadcast it to the rest of the network.
      * Because all nodes expose `get-block-template`, all nodes can be used to mine blocks in this way. Miners generally don't need to do anything other than point to a valid BitClout node somewhere on the network.
    * Note that we are currently working on increasing the nonce size to 64 bits up from 32 bits. This will result in ExtraNonce being basically deprecated, and will make `GetBlockTemplate()` much faster because it won't have to copy a block.
  * Once a block has been submitted via SubmitBlock, it is then relayed to other peers via the INV mechanism described previously. This happens as follows:
    * [`SubmitBlock()` in `miner.go`](https://github.com/bitclout/backend/blob/47bcc8af71b039f857bd949fcea94bfbed8b57e8/routes/miner.go#L125) calls [`ProcessBlock()`](https://github.com/bitclout/backend/blob/47bcc8af71b039f857bd949fcea94bfbed8b57e8/routes/miner.go#L177)
    * `ProcessBlock()` notifies core's `server.go` that a block was connected by calling [`_handleBlockMainChainConnectedd()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1854)
    * `_handleBlockMainChainConnectedd()` updates the mempool using [`UpdateAfterConnectBlock()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1078), which removes transactions from the mempool that have been mined into the block
    * `ProcessBlock()` notifies `server.go` again by [enqueing a `MsgBitCloutBlockAccepted`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L2135) message at the end, triggering a call to [`_handleBlockAccepted`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1127).
      * This creates an `INV` for the new block that gets relayed to all the peers who will then request it from this node.
* There is one more important thread that a node runs at startup, which is the BitcoinManager thread defined in `bitcoin_manager.go`. Like everything else, it has a [`Start()`](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L2105) function that is kicked off in `main.go` via `server.go` (called [here](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1741). It works as follows:
  * It looks for a Bitcoin peer and connects to it through [`_getBitcoinPeer()`](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1741).
  * It sends the Bitcoin peer a [`GetHeaders`](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1985) and kicks off a single-threaded main loop with its peer [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L2001).&#x20;
  * It downloads headers until it is fully synced with the Bitcoin peer.
    * All we really need from a Bitcoin node is its header chain.
    * The headers are used to validate [BitcoinExchange](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2647) transactions when calling `ConnectTransaction()` in either [`ProcessBlock()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1688) or [`processTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/mempool.go#L999). A BitcoinExchange transaction is only valid if it has a merkle proof attached to it that has a valid Bitcoin header hash as its root. More on this later.
  * In addition to the header chain, new blocks are downloaded from the Bitcoin node in order to extract valid BitcoinExchange transactions from them. Basically, any transaction that sends Bitcoin to the sink address, [defined here](https://github.com/bitclout/core/blob/135c03a/lib/constants.go#L506), is recognized as being able to print BitClout on the Bitcoin chain.
    * Blocks are downloaded from the Bitcoin peer whenever a new header is received from the peer [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1414) and [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1333).
    * You can see how the extraction of a BitcoinExchange transaction works [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1632).
  * Like other services, whenever the BitcoinManager gets some new transactions or headers, it notifies server.go by adding a message that will be processed by `messageHandler`. This happens [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1098).
  * The BitcoinManager does some other things, like for example it is used to broadcast BitcoinExchange transactions to many peers at once [here](https://github.com/bitclout/core/blob/135c03a/lib/bitcoin_manager.go#L1806). But its main purpose is to download the Bitcoin header chain and, to a lesser extent, to download new blocks and extract valid BitcoinExchange transactions from them.&#x20;
  * Note also that using a single Bitcoin peer may seem insecure, but because the node checks the minimum work is above a certain threshold, it's generally not an issue. Additionally, nodes that run bitclout.com are pointed at specific trustworthy Bitcoin peers using [--bitcoin\_connect\_peer](https://github.com/bitclout/core/blob/135c03a/cmd/config.go#L91)

### Seed creation and transaction construction

Below we trace how seeds and transactions are created while giving detail on their format and how validation works.

* First, a user lands on bitclout.com, which is the Angular frontend.
  * All the API endpoints for the frontend are defined in a single file called [backend\_api\_service.ts](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts)
    * All the routes are defined [here](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L12).
  * They all hit corresponding API endpoints defined on the node's JSON API, which is fully defined in [frontend\_server.go](https://github.com/bitclout/backend/tree/main/routes).
    * All the routes are the same as the ones defined in `backend_api_service.go` and are defined [here](https://github.com/bitclout/backend/tree/main/routes#L9435) and configured [here](https://github.com/bitclout/backend/tree/main/routes#L9500).
    * When a node starts up it opens up three ports: A "web" port that serves the Angular app, a "protocol" port that is used to connect with peers and process all blockchain-related messages, and an "API" port that is used to handle requests from the Angular app.
      * By default these ports are: 4002=Angular app, 17001=JSON API, 17000=protocol port
      * Note that the “web” port is deprecated in favor of running the frontend Angular app as a stand-alone service. So very soon a node will only have a JSON API port and a protocol port.
    * Anytime the angular app needs to do something like construct a transaction or download the data for a user, it uses the API port. The JSON API is like "glue" between the blockchain and the frontend.
* Creating and storing the seed
  * When a user hits “Sign Up,” they are taken to identity.bitclout.com.
    * On identity.bitclout.com, the user generates a seed phrase and then [hits next](https://github.com/bitclout/identity/blob/665281c/src/app/sign-up/sign-up.component.ts#L69).
      * The seed is stored in the `localStorage` of identity.bitclout.com using a call to [addUser](https://github.com/bitclout/identity/blob/665281c/src/app/sign-up/sign-up.component.ts#L75).
    * All of the seed phrases stored in `localStorage` are encrypted using a call to [`getEncryptedUsers()`](https://github.com/bitclout/identity/blob/665281c/src/app/sign-up/sign-up.component.ts#L85).
      * The [access level](https://github.com/bitclout/identity/blob/665281c/src/app/account.service.ts#L32) of the host is determined. For example, bitclout.com has “FULL”  access. Other nodes will have different access depending on what users have explicitly allowed.
      * If a host has “FULL” access, then an [encryption key](https://github.com/bitclout/identity/blob/665281c/src/app/crypto.service.ts#L70) is computed for that host, to be used in a subsequent step. This encryption key is [stored in localStorage](https://github.com/bitclout/identity/blob/665281c/src/app/crypto.service.ts#L44) where possible, but for some browsers like Safari it must be stored in a Cookie, which is less ideal but it works.
      * Once an encryption key is generated for the host, it is used to compute an [`encryptedSeedHex`](https://github.com/bitclout/identity/blob/665281c/src/app/account.service.ts#L36). Again, this only happens if the node has the FULL access level.
    * Then, if the host has the FULL access level, the encrypted users are sent back to the host (in our case it’s bitclout.com) by a call to [login()](https://github.com/bitclout/identity/blob/665281c/src/app/sign-up/sign-up.component.ts#L84), which then does a [window.postMessage](https://github.com/bitclout/identity/blob/665281c/src/app/identity.service.ts#L44) back to the host.
      * Note: This is tab-to-tab communication. bitclout.com opens identity.bitclout.com, identity generates the `encryptedSeedHex`, and then sends it back to bitclout.com. This same process works if you replace bitclout.com with the host of your own third-party node. The difference is that your third-party node will need to ask the user for permission in order to get encryptedSeedHex sent back to it.
  * Once bitclout.com has the `encryptedSeedHex`, it uses it to sign things. It does this by calling various operations on an iframe of identity.bitclout.com embedded within it.
    * /frontend gets an unsigned transaction from the JSON API. Here is an example where it gets [an unsigned SubmitPost transaction](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L598).
    * Then it calls [`signAndSubmitTransaction`](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L612), which [sends](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L270) it to the identity.bitclout.com iframe via a [postMessage](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/identity.service.ts#L84) to call [doSign()](https://github.com/bitclout/identity/blob/665281c/src/app/embed/embed.component.ts#L47).
      * Importantly, in order to have identity sign the transaction, bitclout.com includes the [`encryptedSeedHex` and the transaction hex](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L271).
    * Identity.bitclout.com then decrypts the `encryptedSeedHex` with the host-specific encryption key, signs the transaction, and returns the signed transaction back. This all happens [here](https://github.com/bitclout/identity/blob/665281c/src/app/embed/embed.component.ts#L73).
  * Why is this so complicated? Why send `encryptedSeedHex` back to the host? Wouldn’t it be better to just keep everything in identity.bitclout.com?
    * The reason for this setup is that iOS devices does not allow identity.bitclout.com to access persistent `localStorage` when it’s embedded as an `iframe` in bitclout.com. This is due to Apple’s crusade against third-party cookies. However, Apple does allow identity.bitclout.com to access its cookies when its embedded as an iframe on bitclout.com if those cookies are set as first-party cookies.
    * So, what do we do? We push the user to create their seed on identity.bitclout.com, where we can set an encryption key as a first-party cookie. Then, back on bitclout.com we store the `encryptedSeedHex`. When signing is needed, the `encryptedSeedHex` is passed to the identity.bitclout.com iframe, which has access to the encryption key in the cookie, which it then uses to decrypt the `encryptedSeedHex` and sign the transaction.
    * One draw-back of this approach is that cookies are sent to the identity.bitclout.com automatically when the page or iframe loads. This is not ideal, but that information is useless without the actual seed. Moreover, and critically, cookies are only used on iOS devices. On non-iOS devices, the encryption key is stored in `localStorage`. This means that only iOS devices are subject to this drawback.
    * One other draw-back is that an XSS attack on bitclout.com or a third-party node could technically give the attacker access to the `encryptedSeedHex`. However, this information is useless without the encryption key stored exclusively in identity.bitclout.com.
* When a user does any kind of "write" operation in the app, such as submitting a post, liking, or updating their profile, a corresponding endpoint in `frontend_server.go` is called to construct a transaction. That transaction is then returned unsigned, signed by the identity iframe, and then submitted back to core via [`SubmitTransaction()`](https://github.com/bitclout/backend/tree/main/routes#L2984).
* As an example, consider [`/send-bitclout`](https://github.com/bitclout/backend/blob/47bcc8a/routes/server.go#L45), which is relatively straightforward:
  * [First, a universal view is fetched.](https://github.com/bitclout/backend/tree/main/routes#L2849) More on this later, but it basically gives the endpoint a "union" of the "state" between what's in the mempool and what's in the blocks. For example, if someone sent you BitClout in a txn that's in the mempool, you can use the view to find that UTXO. And if they sent it to you in a txn that's been mined into a block, you can also find it in that view.
  * In order to create the spend transaction, the endpoint needs to find UTXO's for the user. This generally always happens in [`AddInputsAndChangeToTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L3033), which is a good function to trace through. I'm not aware of any transaction assembly that does not utilize this function for UTXO fetching.
    * The key function is [`GetSpendableUtxosForPublicKey()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L2268), which generates a universal view that includes txns from the mempool and then returns all UTXO's that are associated with the particular public key. These UTXO's can then be assembled into a transaction.
    * Again, basically all transaction assembly runs through this codepath.
  * Then the transaction is sent back to the frontend and signed.
  * [`SubmitTransaction()`](https://github.com/bitclout/backend/tree/main/routes#L2983) is called
  * The transaction is then validated and broadcasted in [`VerifyAndBroadcastTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L226).
    * It does [some pre-validation](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L2155) of the transaction by calling [`ConnectTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6043) on it.
    * If the validation passes then it calls [`BroadcastTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L209), which calls [`_addNewTxn()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1023) in server.go, which adds the transaction to the mempool calling [`ProcessTransaction()`](https://github.com/bitclout/core/blob/135c03a/lib/mempool.go#L1943).
    * Once the transaction is in the mempool, the node will eventually relay the transaction to its peers via a separate thread running in server.go that's kicked off in `Start()` through [`_startTransactionRelayer()`](https://github.com/bitclout/core/blob/135c03a/lib/server.go#L1669).
      * This thread is basically looking at the mempool at regular intervals and sending transactions to peers that they don't already have. This is how a transaction that's generated in the UI makes it to the rest of the network.
  * Once a transaction has gone into the mempool then we're done. It will eventually be mined into a block.
* A note on the [`/burn-bitcoin`](https://github.com/bitclout/backend/blob/47bcc8a/routes/server.go#L44) endpoint:
  * This endpoint is called when a user buys BitClout using Bitcoin in the "Buy BitClout" tab. It does the following:
    * Constructs a Bitcoin transaction sending the user's Bitcoin to the "sink" address
    * Broadcasts it to the Bitcoin blockchain
    * Waits some amount of time for the transaction to propagate
    * Checks to see if a double-spend occurred during this interval.
    * If no double-spend was detected, the transaction is added to the BitClout mempool with the expectation that it will eventually mine into a Bitcoin block (and subsequently a BitClout block).
      * The fee is generally set to 2x the "fastest" fee to ensure very high probability that the txn is processed. This is currently set in the frontend, but there is no reason why it can't be re-enforced in either the frontend\_server.go code or in the mempool itself prior to accepting the Bitcoin txn.
    * Once this transaction has been accepted into the mempool, the user can immediately spend it.
      * This means there will be some risk of reversion of the user's transactions if the transaction isn't ultimately confirmed by the Bitcoin blockchain. But we have yet to have someone successfully double-spend against the latest iteration of the double-spend checking logic.
    * BitcoinExchange transactions can also be added to the mempool via relay from other peers. In this case, the node can be set to [ignore unmined Bitcoin transactions from peers](https://github.com/bitclout/core/blob/135c03a/lib/peer.go#L224) so there is minimal risk of a double-spend or reversion.
  * Importantly, no matter what the mempool does, the BitClout blockchain will not allow a BitcoinExchange transaction into it without at least one block of work on it. In practice, three blocks of work are required because miners wait for three blocks in order to be safe. This happens via a param called [`MinerBitcoinMinBurnWorkBlocks`](https://github.com/bitclout/core/blob/135c03a/lib/constants.go#L504) that is utilized by the block producer.

### Transaction format

* Generally, all important "messages" that need to get sent between peers, most notably `MsgBitCloutTxn` and `MsgBitCloutBlock`, are defined in [`network.go`](https://github.com/bitclout/core/blob/135c03a/lib/network.go). They all implement the very simple [`BitCloutMessage`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L208) interface.
* All of these messages have serialization functions called ToBytes() that are defined by us in order to guarantee that all nodes serialize to the exact same bytes. If we were to rely on protobufs of JSON, nodes could get different serialized byte strings for the same messages because these formats do not guarantee consistent serialization across machines.
* Transactions are based on UTXO's. They contain the following:
  * [`TxInputs`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2200), which is effectively a list of \<PreviousTxID, index> pairs called [`UtxoKey`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2148) where the index refers to the output being spent.
  * [`TxOuptuts`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2201), which just specify what amounts are going to which public keys.
  * `TxnMeta`. More on this later
  * [`PublicKey`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2215). In BitClout transactions are very simple and only have one public key that can be deemed to be the "executor" of the transaction. The transaction is generally always signed by this public key.
  * [`ExtraData`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2221). This is a flexible map that arbitrary data can be added to. It is currently used to support Reclouts via [`RecloutedPostHash`](https://github.com/bitclout/core/blob/135c03a/lib/constants.go#L944) and [`IsQuoteReclouted`](https://github.com/bitclout/core/blob/135c03a/lib/constants.go#L946) params. It can be used to augment a transaction without causing a hard fork, which significantly increases the extensibility of BitClout by the community. For example, one can trivially add a "pinned posts" feature using `ExtraData` without consulting the core BitClout devs about it.
* Note that the map keys of `ExtraData` are [always sorted](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2158) when serialized so that consistent serialization across machines is preserved even though we're using a map.
* Transaction metadata is used to determine what type of transaction we're dealing with. For each type of transaction in the system, a metadata type is defined that implements the [`BitCloutTxnMetadata`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L299) interface. The full list of transaction types can be viewed [here](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L239). To see descriptions of each one, simply find where that transaction type implements the interface.
  * For example, here is the [`BitcoinExchangeMetadata`](https://github.com/bitclout/core/blob/135c03a/lib/network.go#L2647). You can see it contains a full Bitcoin transaction plus a merkle proof into the Bitcoin blockchain. This is how a node verifies that a particular Bitcoin transaction has a sufficient amount of work on it.
  * TODO: The comments on these transaction types could use some work.

### Transaction validation

* Virtually all transaction validation happens in [`_connectTransaction`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L5022) in `block_view.go`.
* Validation works by applying the transaction to a "view," which is basically a "simulation" of what would happen if the transaction were written to the database, but that doesn’t actually modify the database. This is useful because a view can allow you to "simulate" what would happen if you applied a bunch of transactions to the database in sequence in order to validate whole blocks before ever actually writing anything to the database. And this is exactly what [`ConnectBlock`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L5120) does.
  * A view is basically a "copy on write" system. When a transaction requires something to be written to the database, an in-memory entry is created representing that entry. This generally happens in calls to \_set.\*mappings and \_get.\*, such as [`_setProfileEntryMappings`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L2873) and [`_getProfileEntryForUsername`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L2757).
* If all of the transactions that have been applied to a view appear to be valid, the view can be "flushed" to the database, which writes all of the updates those transactions produced to the database. The flush code for the view is [here](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6503), and it delegates to individual flush functions [here](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6466).
  * In most cases, flushing to the db just requires first [deleting entries that have i`sDeleted=true`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6347) and then [writing entries that have isDeleted=false](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L6384).
  * The core ProcessBlock function basically just applies all the txns in a block to a view via [`ConnectBlock()`](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1688) and then [flushes it](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1725). The mempool uses a view to validate transactions as well [inside of its core `processTransaction` function](https://github.com/bitclout/core/blob/135c03a/lib/mempool.go#L1402).
* We can walk through connecting an UpdateProfile transaction to see how it works.
  * `_connectTransaction` delegates to [`_connectUpdateProfile`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L5069)\`\`
  * [A bunch of validation happens](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4069)
  * UTXO's are generally always checked by a call to [`_connectBasicTransfer`](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4129), which returns the total input and output of the transaction.
  * An existing profile entry is [looked up](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4108) if one exists. If it exists, it is updated. Otherwise, a new one is created from scratch.
    * Updating an existing profile happens [here](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4154) while creating a new one happens [here](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4195).
  * In both cases, mappings for the profile are first [deleted from the view](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4242) and then [set on the view](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4246).&#x20;
    * Note that deleting something from the view never actually deletes a mapping, it only marks it as `isDeleted=true`. This is because the flush needs to propagate this change to the db, and it can only do that if it knows the entry is scheduled to be deleted by leaving it in the view.
  * Finally, [some information is saved](https://github.com/bitclout/core/blob/135c03a/lib/block_view.go#L4249) that allows us to roll back or "disconnect" the transaction in the future if needed.
* Every transaction has both a `_connect` and a `_disconnect`. The `_disconnect` restores the view to the state it was in before the transaction was connected. `_disconnect` code is rarely used, but it supports reorgs of blocks, which happen from time to time.
  * During a reorg, we need to disconnect some transactions from some blocks and connect transactions from some other blocks in order to validate the fork, \*before\* writing anything to the db. This happens in [ProcessBlock here](https://github.com/bitclout/core/blob/135c03a/lib/blockchain.go#L1786).


# Running a Node

## The Power of Decentralization

BitClout is unlike any existing social network in that the data is fully-decentralized and stored on a blockchain like Bitcoin. **This means that anyone on the internet can run a BitClout "node" and download a** ***full copy*** **of all the data, with real-time updates, without needing to ask for permission and without the risk of being de-platformed.**

## What Can You Do With a Node?

Running a node gives you full access to the BitClout firehose. Access to every profile, post, follow, creator coin trade, etc... But what can you do with all this power?

### **Running your own feed**

When you run a node, it starts with a blank global feed and an "Admin" panel that you can use to start adding posts to it. **All of the same tools that the bitclout.com team uses to manage their global feed are now available to you to manage a feed of your own.**

Essentially, running a BitClout node allows you to expose your own "view" of the firehose of content. Our bitclout.com node exposes all of the crypto-related content, but when you run your own node you have full control to surface whatever content speaks to you. What will you do with your feed? Here are some ideas for feeds that we think would be popular:

* **A feed for every country and every language.** Isn't it weird that people all over the world consume information curated predominantly by the US? How much does an engineer working in Silicon Valley really know about what people in other countries want to see, or what features they want? In the past, we were stuck with this model because US companies built a data network effect that entrenched them, even in non-US countries. But BitClout can break this status quo because all of its data is open and the barrier to entry to starting a competitive feed is virtually zero. For the first time, people who actually live in a country can curate a feed for their people, no matter how large or small their country is. And this applies to every country that succumbed too quickly to the network effects of the Silicon Valley tech companies. By lowering the barrier to entry to creating a feed, and opening up the data firehose to anyone, we think BitClout has the potential to bring international social media products to a whole new level.
* **The politics-focused feed.** bitclout.com doesn't prioritize political content, but someone should. Imagine a feed where all the posts from the top political figures are highlighted. You could even imagine segmenting the firehose into two feeds: a "red" feed and a "blue" feed that's dedicated to each political party.
* **The sports-focused feed.** Wouldn't it make sense for someone to operate a feed that just highlights all of the best sports content from the best sports influencers? So many people are interested in this content, and we think it deserves its own feed.
* **The NSFW feed.** bitclout.com doesn't prioritize NSFW content in its feed because its user-base is too mainstream. This bias against NSFW content is even stronger with incumbent social media companies. Yet there are so many talented adult influencers on BitClout, with thousands of followers, who are posting every day. It's about time they had their own feed dedicated to them.

We're just scratching the surface here-- it's now up to you, the community, to figure out how best to display the BitClout firehose. Reddit pioneered the concept of a "Subreddit," but the problem with a Subreddit is that every time one is created, it has to solve a "chicken and egg" problem with regard to its content. If nobody is posting, then the subreddit has no content-- but without content, nobody will start posting. BitClout bascially takes the subreddit concept to the next level by solving the "content" part of the equation for everyone. When you run a node, you don't need to bootstrap content because you have full access to the BitClout firehose. All you need to do is curate it in some interesting way and you'll have created value for anyone who visits your node.

### Add social to your platform

Suppose you're a platform with millions of users like Coinbase or Robinhood, or even traditional media companies like ESPN. Your users would probably love it if you could integrate a social component into your products-- but you can't because Twitter and Facebook don't allow it. They [closed down their API's](https://www.google.com/url?q=https://www.theverge.com/2018/8/16/17699626/twitter-third-party-apps-streaming-api-deprecation\&sa=D\&source=editors\&ust=1618805849171000\&usg=AOvVaw3zPqxFdHzfISpMoiBG_Yi0) a long time ago because they realized that third-party integrations eat into their ad revenue. Every user who engages on a third-party platform is a user who's engaging less on Twitter and Facebook.

Enter BitClout. With BitClout, you don't need to build a billion-user data moat in order to be able to add social features to your platform. All you need to do is run a BitClout node, and use its API to expose whatever content you want. Suddenly, with just one engineer's worth of effort, any major platform can spin up a social product that's adjacent to its core business. Moreover, it's possible that the best feeds will come from existing publishers that have already built a competency in a particular area. For example, ESPN might be the best entity to run the sports-focused feed because of their relationships and connections, and now they can.

### Analysis tools

Building the best analysis tools requires access to the best data, and running a node is the best way to get full access to the BitClout firehose. Until now, the bitclout.com nodes have had to set up rate limits to avoid having our machines get overloaded. But now, because BitClout is a blockchain that allows anyone to run a full copy of the platform, anyone who wants to build analytics tools can simply run a node and query it in whatever way they want.

### Invent your own features

When you run a node, you have the flexibility to expose the BitClout content in whatever way most resonates with your users. If you wanted to, you could even build a whole new frontend with totally different features than what the "default" node gives you. If you feel like BitClout is missing a feature, like dark mode or paid messages or better filtering for spam for example, now you can build it and run your own node to back it.

## Making Money on Your Node

Incentives are key to making BitClout truly decentralized in the long run. It's not sufficient that nodes be runnable by the community, they must be *profitable* to run as well. Many cryptocurrencies struggle with this, and even Bitcoin and Ethereum nodes are still largely run by volunteers. BitClout is truly unique in this regard, however, because the social features it introduces give node operators incentives that other blockchains don't have.

The above being said, there are several ways that BitClout node operators can earn a profit:

* **Promoted content.** Because running a node comes with the ability to have a social media product with minimal marginal effort, every node operator has an opportunity to amass and monetize the reach that comes from curating a popular feed. This can be as simple as showing promoted posts that partners pay the node operator to pin to their feed.
* **Trading fees.** Anyone who runs a node can modify their frontend to add trading fees on every creator coin trade, which go to the node operator's wallet. By doing this, any node operator basically doubles as a crypto exchange.
* **Other transaction fees.** Any transaction users complete on one's node can be augmented to contain a small fee that goes to the node operator. Thus there should eventually arise an efficient market for node operator fees that is high enough to justify operating a node.

The above mechanisms don't even factor in profits that could be derived from augmenting the BitClout feature set. For example, if someone creates an app experience for BitClout that is significantly better than alternatives, they could even charge a monthly subscription fee or some other premium to cover costs.

## How to Run a Node

Running a node currently requires a modest amount of technical know-how. For the full instructions on how to run a node, check out this GitHub repository:

* <https://github.com/bitclout/run>

Once a node is running, it syncs all of the blocks from its peers, as well as the transactions in the "mempool," which have yet to be mined into a block. Every node comes with an Admin panel with a Network tab that allows you to monitor the node's sync state.

![](/files/-MfDx09RGMc2b8PDj8tP)

Once your node is synced, you have access to the full firehose of BitClout data in real time! Below are some tips on how take full advantage of your node.

* Go to your Admin tab and watch the unfiltered feed update as your node syncs. It's like a time machine!
* Try to whitelist some posts in the Admin tab and see that they've made their way onto your global feed.
* Read through the flags available in the [dev.env](https://github.com/bitclout/run/blob/main/dev.env) file. You can adjust these flags however you want, but note that we strongly recommend keeping your node in read-only mode for now. Turning read-only mode off could cause users who visit your node to make transactions that are not ultimately confirmed.
* Set `ADMIN_PUBLIC_KEYS` to your public key so that the Admin tab is only visible to your username.
* Set `SUPER_ADMIN_PUBLIC_KEYS` to your public key so that the Super Admin tab is only visible to your username.
* Whitelist some posts and verify that they show up on the global feed.
* Deploy your node on any cloud provider with a static IP to make it accessible to anyone on the internet.
* Set a `PASSWORDS_FILE` if you want to restrict read access to your node.
* Add an `SSL_CERT_DIR` and `SSL_DOMAIN` using a letsencrypt cert in order to protect your node with HTTPS.
* Set the `TWILIO*` flags to allow new users to get some starter BitClout.
* Set a `SUPPORT_EMAIL` so your users can contact you if they run into trouble.
* Play with the logging verbosity by increasing `GLOG_V`.

## Managing Your Feed

To manage your feed, start by navigating to the Admin tab as shown below. The Admin tab shows the full firehose of posts in real time, with a button next to each one that allows you to add it to the global feed. You can also sort the posts by clout. These are all the same tools that the bitclout.com mods have, now at your fingertips through the power of decentralization.

![](/files/-MfDx09T6Qlh935yx1nZ)

You can also add any post from anyone's profile to the global feed simply by hitting the dropdown at the top-right of the post. You can also pin posts to your feed, which is a good way of communicating announcements to your user-base.

![](/files/-MYwR9JZwypLkEMdKLr_)

When you run a node, you act as a moderator and have a variety of superpowers that help you manage spam and harmful content.

* **Blacklisting** a profile removes it everywhere except from peoples' wallet pages. This makes it so that anyone who was holding the blacklisted profile can sell out of their holdings.
* **Graylisting** a profile removes it from the leaderboard, removes it from search, removes its comments from threads, and removes its posts from the Admin panel.
* **Whitelisting** a profile makes that user's posts show up on the global feed automatically with some frequency (currently it allows five posts per day).
* Finally, a mod can allow a phone number to be re-used to claim starter BitClout. This is useful for various testing situations.

![](/files/-MYwRCN6TyvbII1Blt9O)

When you've set your public key as an `ADMIN_PUBLIC_KEY`, the Admin tab becomes visible only to you. This is a critical step in securing your node. Not doing this would make it so that all your users can add posts to the global feed.

## Super Admin Public Keys

Within the Admin Panel, there is a `Super` tab which is only accessible by Super Admins. Super Admin can manage user verification and $CLOUT purchasing behavior from the `Super` tab.

### Username Verification

![](/files/-McmLLpLIlXrYYfj_2Me)

Super Admins can grant verification badges (on their node) to a user by putting the username in the `Grant Verification Badge` input box and then clicking `Verify`. Similarly, a Super Admin can revoke verification by putting the username in the `Remove Verification Badge` and then clicking `Remove`.

### Buy $CLOUT Management

Any node can sell $CLOUT if they set the following flags appropriately. Super Admins can set two values in the `Super` tab to manage the price at which $CLOUT is sold on their node: `USD-to-BitClout Reserve Price`and `Buy BitClout Fee Rate`.

![](/files/-McmLTVqKU4LpZW345y-)

#### USD-to-BitClout Reserve Price

This is the minimum price at which you are willing to sell $CLOUT on your node. If the price retrieved from exchange APIs is lower than this amount, your node will sell $CLOUT at this reserve price instead of the API price. Additionally, the price in the right sidebar will appear the reserve price in the event that the price from the API dips below the reserve price.

#### Buy BitClout Fee Rate

This is a percentage-based fee applied to all $CLOUT purchased on your node. If the current price of $CLOUT in USD is $100 and the `Buy BitClout Fee Rate` is 5%, the buyer will pay $105 per $CLOUT and the node operator has earned $5 net. For more details on configuring your node to sell $CLOUT, please read the section titled `Sell $CLOUT on your node`.

## Sell $CLOUT on your node

To simplify the on-boarding experience for new users on your node, you can sell $CLOUT for Bitcoin directly to users. To configure your node to sell $CLOUT, please set the following flags:

* `BUY_BITCLOUT_SEED`: This is a seed phrase for the public key that contains $CLOUT that you will sell to users.  As with all seed phrases, keep this secret and share it with nobody. Take extra precautions to not commit it to version control and quickly move funds if this seed is ever compromised.
  * You will need to deposit $CLOUT to the public key for this seed phrase.  All $CLOUT purchases on your node will send $CLOUT from this wallet.
* `BUY_BITCLOUT_BTC_ADDRESS`: This is a Bitcoin address you control. When users purchased $CLOUT with Bitcoin, the Bitcoin will arrive at this address.&#x20;

## How Users Login

When a user logs in on your node, they have the ability to sign in with their BitClout identity, without having to re-enter their seed phrase. Once a user signs in, your node can sign transactions on their behalf with varying levels of approval required depending on what kind of permission the user granted. This creates a login mechanism for node operators that is as easy for users as "login with Facebook," but it unlocks a wallet in addition to a user's identity.

## FAQ

Answers to common questions and issues about running your own node:

### What are the minimum requirements for syncing a node?

We recommend having a machine with at least 32GB of RAM and 350GB of storage (as at 21 July 2021). If TXIndex is disabled, then you need about 200GB in total. The Blockchain DB takes up about 90 GB, and the TXIndex takes up 160 GB. THe DB+TXindex size grows by about 50GB a month currently.

### How do I configure SSL?

There is an example SSL configuration in `nginx.dev`.

### How do I use the BlockCypher API?

BlockCypher will help prevent double-spends in the mempool. You can signup for a [BlockCypher](https://www.blockcypher.com/) account on the BlockCypher website. BlockCypher does offer a free amount of API calls.

Once you have signed up for an account you may copy a token from the [tokens](https://accounts.blockcypher.com/tokens) section of the dashboard.

You will copy this token in your `dev.env` file as the value for `BLOCK_CYPHER_API_KEY`.

### What type of records do I use with custom domains?

You must create two seperate **A** type domain records.

Both records should point to the IP address of your node.

#### Example DNS Records:

| Hostname          | Type | TTL | Priority | Content     |
| ----------------- | ---- | --- | -------- | ----------- |
| node.`DOMAIN`.com | A    | 299 |          | `IPADDRESS` |
| api.`DOMAIN`.com  | A    | 299 |          | `IPADDRESS` |

If you do not create both records you will be unable to use a custom domain.

### Can my node write back to the mainnet?

Yes! Every transaction is broadcast to all other nodes on the network, and should eventually be mined into a block.

### What does Twilio provide to my node?

Twilio provides an SMS API that allows you to confirm user phone numbers and thus send them currency from your seed wallet set inside the `dev.env` file. If you do not have this set users will be unable to verify a phone number.

Twilio pricing can be reviewed [here](https://www.twilio.com/sms/pricing/us).


# Bug Bounty

We want the BitClout blockchain to be one of the most secure blockchains in the world, but we need your help. If you're skilled at finding exploits and security vulnerabilities, **please email <security@bitclout.com> so we can share some resources with you and include you in our first bug bounty.**&#x200C;

## Rewards <a href="#rewards" id="rewards"></a>

Hundreds of thousands of users have accounts on the BitClout blockchain, and this section covers the rewards for exploits that compromise the security of those users. Please note that what's in scope may change over time, so **please always check this page for the most up-to-date list of things that are a part of the program.**&#x200C;

Below is a list of severity levels and reward amounts for each level, as well as examples of exploits at each level. Please note that all reward amounts are ultimately subject to the discretion of the BitClout developer community, and the example exploits below are just a guide. The actual reward amounts may vary depending on the nature of the exploit, but we will try to be as generous as possible. All rewards are payable in Bitcoin or BitClout.‌

* **Critical: Up to $75,000 USD**
  * Exploit: You can acquire the seed phrases of users on bitclout.com without them having to perform any special action on an external site.
    * The maximum amount will be rewarded if this exploit can impact all currently active users.
    * Example: a post containing an XSS attack that extracts seed phrases for all users who load the post in their browser.
  * Exploit: You are able to print money.
    * The maximum amount will be rewarded if this exploit can result in the actual blockchain becoming corrupted. Corrupting the mempool is a lower-severity issue. In order to be considered critical, the exploit must result in the state of the actual blockchain being corrupted.
    * Example: you create a transaction that prints BitClout and mines into the chain.
    * Example: you buy and sell a creator coin in a way that prints BitClout
* **High: Up to $35,000 USD**
  * Exploit: You can steal money from users on bitclout.com without them having to perform any special action external to the site. However, you are unable to compromise the seed phrases of these users.
    * The maximum amount will be rewarded if this exploit can impact all currently active users.
    * Example: a post containing an XSS attack that sends all of a user's money to your wallet when they view the post in their browser.
    * The reason this is a "High" severity issue rather than a "Critical" severity issue is because an exploit like this could theoretically be reverted by a hard fork, similar to what Ethereum devs implemented during the DAO hack.
  * Exploit: You are able to steal money from users, but they have to perform some trivial action on another website.
    * This will receive a lower amount than an exploit that requires no activity on an external site.
    * Example: a user presses a button on evil.com that steals all of the user's funds.
  * Exploit: You can bring the entire BitClout network down with minimal resources.
    * Example: a corrupt transaction causes all machines that receive it to crash-loop repeatedly.
* **Medium: Up to $10,000 USD**
  * Exploit: You can cause BitClout nodes to lose at least one hour of transactions.
    * The maximum amount will be rewarded if this exploit can be executed with minimal resources. Attacks that require a lot of resources, like the possession of a botnet, are ineligible.
    * Example: submitting a simple corrupt transaction to the mempool that causes all transactions to become invalid.
  * Exploit: You are able to perform low-value actions (post, like, etc) on behalf of users on the site.
* **Low: Up to $1,000 USD**
  * Exploit: You can cause weird and confusing behavior that is mostly harmless to the blockchain.
  * * Example: [The Salomon bug](https://bitclout.com/u/salomon), which causes prices to display incorrectly but doesn't allow users to print BitClout or creator coins.

## Claiming a Bounty <a href="#claiming-a-bounty" id="claiming-a-bounty"></a>

In order to be eligible to receive a bounty you must fully disclose an exploit to the BitClout developer community by emailing **<security@bitclout.com>.** Below are some guidelines for disclosing your exploit:‌

* You must be the first person to report an issue. If you are not the first person to report an issue the developer community may award a consolation prize at its discretion.
  * Additionally, if you report an issue that the developer community is already aware of or is actively fixing, then you are not eligible to receive a bounty.
* You must include clear steps to reproduce the issue and be willing to answer any questions the developer community has regarding your exploit. This is required in order to fix the exploit and protect BitClout users as quickly as possible.
  * If your exploit cannot be reproduced or you cannot provide some evidence that the exploit is real, you will not be eligible for a bounty.
* You must allow 60 days for the developer community to evaluate and fix whatever you've discovered *before* disclosing the exploit publicly.
  * Disclosing your exploit publicly in less than 60 days could not only result in harm to users, but it will also make you ineligible for the bounty.
* Once your exploit is verified you will be asked for a BitClout or Bitcoin address to receive payment.

We understand that the disclosure process described above requires you to put some faith in the judgement of the BitClout developer community. For some reports it may not be clear how severe the exploit is or how much of a reward the reporter should receive. In these instances, we ask that you are patient with us as we refine the scope of exploits we're looking for and trust that we will be generous when an exploit is in a grey area.[<br>](https://app.gitbook.com/@bitclout-1/s/diamondhands-drafts/~/drafts/-MZB-mxH8AxjI0n9wGYd/)


# Backend API

## General Endpoints

### Index

```
GET /
```

Basic endpoint to test if your BitClout node is running.

**Parameters**

None

**Response**

```
Your BitClout node is running!
```

### Health Check

```
GET /api/v0/health-check
```

Check if your BitClout node is synced

**Parameters:**

None

**Response:**

If node is synced and received all transactions.

```
200
```

### Get Exchange Rate

```
GET /api/v0/get-exchange-rate
```

Get BitClout exchange rate, total amount of nanos sold, and Bitcoin exchange rate.

**Parameters:**

None

**Response:**

```
{
    "SatoshisPerBitCloutExchangeRate":498484,
    "NanosSold":8491518125648433,
    "USDCentsPerBitcoinExchangeRate":3608200
}
```

### Get App State

```
POST /api/v0/get-app-state
```

Get state of BitClout App, such as cost of profile creation and diamond level map. Example use in the [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1106) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/base.go#L86).

**Parameters**

None; however, you need to send an empty JSON `{ }`. Otherwise, you will get 400 - Bad Request. More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/base.go#L63).

| Name                 | Type   | Description                 |
| -------------------- | ------ | --------------------------- |
| PublicKeyBase58Check | string | (optional) check public key |

**Response**

```
{
    "AmplitudeKey": "",
    "AmplitudeDomain": "api.amplitude.com",
    "MinSatoshisBurnedForProfileCreation": 50000,
    "IsTestnet": false,
    "SupportEmail": "node.admin@protonmail.com",
    "ShowProcessingSpinners": true,
    "HasStarterBitCloutSeed": false,
    "HasTwilioAPIKey": false,
    "CreateProfileFeeNanos": 10000000,
    "CompProfileCreation": false,
    "DiamondLevelMap": {
        "1": 50000,
        "2": 500000,
        "3": 5000000,
        "4": 50000000,
        "5": 500000000,
        "6": 5000000000,
        "7": 50000000000,
        "8": 500000000000
    },
    "HasWyreIntegration": false,
    "Password": ""
}
```

## Transaction Endpoints

### Get Txn

```
POST /api/v0/get-txn
```

Check if Txn is currently in mempool. Example use in the [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/app.component.ts#L291) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L34).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L25).

| Name       | Type   | Description      |
| ---------- | ------ | ---------------- |
| TxnHashHex | string | Transaction hash |

**Response**

```
{
    "TxnFound": true
}
```

### Submit Transaction

```
POST /api/v0/submit-transaction
```

Submit transaction to BitClout blockchain. Example use in [frontend](https://github.com/bitclout/docs/tree/48edcd8f15f30a527a2d6d927e87c83bf10becdb/devs/%60https:/github.com/bitclout/frontend/blob/96bdf0c40e05010ec62a1b1cdc78bf0d0fb2ef44/src/app/backend-api.service.ts#L496%60) and endpoint implementation in [backend](https://github.com/bitclout/docs/tree/48edcd8f15f30a527a2d6d927e87c83bf10becdb/devs/%60https:/github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L81%60).

**Parameters**

Read more on transaction format [here](https://github.com/bitclout/docs/blob/main/code/walkthrough.md#transaction-format). More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L69).

| Name           | Type   | Description      |
| -------------- | ------ | ---------------- |
| TransactionHex | string | Transaction hash |

**Response**

```
{
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TxnHashHex: "...",
    PostEntryResponse: {...}
}
```

### Update Profile

```
POST /api/v0/update-profile
```

Update profile fields and receive corresponding Txn. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L816) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L247).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L214).

| Name                        | Type   | Description                                                    |
| --------------------------- | ------ | -------------------------------------------------------------- |
| UpdaterPublicKeyBase58Check | string | Public key of updater                                          |
| ProfilePublicKeyBase58Check | string | (optional) Public key of the profile if different from updater |
| NewUsername                 | string | Username                                                       |
| NewDescription              | string | Description                                                    |
| NewProfilePic               | string | Profile picture                                                |
| NewCreatorBasisPoints       | uint64 | Creator Reward                                                 |
| NewStakeMultipleBasisPoints | uint64 | Staking Reward                                                 |
| IsHidden                    | bool   |                                                                |
| MinFeeRateNanosPerKB        | uint64 | Rate per KB                                                    |

**Response**

```
{
    TotalInputNanos: 999999,
    ChangeAmountNanos: 999420,
    FeeNanos: 579
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
    TxnHashHex: "..."
}
```

### Burn Bitcoin

TODO

### Send BitClout

```
POST /api/v0/send-bitclout
```

Prepare transaction for sending BitClout. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L470) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L837).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L817).

| Name                         | Type   | Description                 |
| ---------------------------- | ------ | --------------------------- |
| SenderPublicKeyBase58Check   | string | Public key of the sender    |
| RecipientPublicKeyOrUsername | string | Public key of the recipient |
| AmountNanos                  | int64  | transaction amount in nanos |
| MinFeeRateNanosPerKB         | uint64 | Rate per KB                 |

**Response**

```
{
    TotalInputNanos: 2220387140,
    SpendAmountNanos: 2000000000
    ChangeAmountNanos: 220386848,
    FeeNanos: 579
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
    TxnHashHex: "...",
}
```

### Submit Post

```
POST /api/v0/submit-post
```

Prepare transaction for submiting a post. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L644) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1100).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1061).

| Name                        | Type   | Description                                   |
| --------------------------- | ------ | --------------------------------------------- |
| UpdaterPublicKeyBase58Check | string | Public key of the updater                     |
| PostHashHexToModify         | string | (optional) Modified post's hash               |
| ParentStakeID               | string | (optional)                                    |
| Title                       | string | (optional)                                    |
| BodyObj                     | json   | {Body: STRING, ImageURLs: \[]}                |
| RecloutedPostHashHex        | string | (optional) hash of post to modify             |
| PostExtraData               | json   | (optional) extra data, values must be strings |
| IsHidden                    | bool   |                                               |
| MinFeeRateNanosPerKB        | uint64 | Rate per KB                                   |

**Response**

```
{
    TstampNanos: 1623106441519911200,
    PostHashHex: "..."
    TotalInputNanos: 96669,
    ChangeAmountNanos: 96434,
    FeeNanos: 235,
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
}
```

### Create Follow Txn Stateless

```
POST /api/v0/create-follow-txn-stateless
```

Prepare a follow/unfollow transaction. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L855) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1331).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1314).

| Name                         | Type   | Description                        |
| ---------------------------- | ------ | ---------------------------------- |
| FollowerPublicKeyBase58Check | string | Public key of creator followed     |
| FollowedPublicKeyBase58Check | string | Public key of follower             |
| IsUnfollow                   | bool   | false if follow / true if unfollow |
| MinFeeRateNanosPerKB         | uint64 | Rate per KB                        |

**Response**

```
{
    TotalInputNanos: 220387362,
    ChangeAmountNanos: 220387140
    FeeNanos: 235,
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
}
```

### Creator Like Stateless

```
POST /api/v0/create-like-stateless
```

Prepare a like/unlike transaction. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L936) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1002).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L985).

| Name                       | Type   | Description                    |
| -------------------------- | ------ | ------------------------------ |
| ReaderPublicKeyBase58Check | string | Public key of reader           |
| LikedPostHashHex           | string | Hash of liked post             |
| IsUnlike                   | bool   | false if like / true if unlike |
| MinFeeRateNanosPerKB       | uint64 | Rate per KB                    |

**Response**

```
{
    TotalInputNanos: 220387362,
    ChangeAmountNanos: 220387140
    FeeNanos: 235,
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
}
```

### Buy or Sell Creator Coin

```
POST /api/v0/buy-or-sell-creator-coin
```

Prepare transaction for buying/selling creator coin. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1012) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1454).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1401).

| Name                        | Type   | Description                     |
| --------------------------- | ------ | ------------------------------- |
| UpdaterPublicKeyBase58Check | string | Public key of updater           |
| CreatorPublicKeyBase58Check | string | Public key of creator           |
| OperationType               | string | "buy" or "sell"                 |
| BitCloutToSellNanos         | uint64 | Amount of BitClout to spend     |
| CreatorCoinToSellNanos      | uint64 | Amount of Creator Coin to spend |
| BitCloutToAddNanos          | uint64 | 0                               |
| MinBitCloutExpectedNanos    | uint64 | 0                               |
| MinCreatorCoinExpectedNanos | uint64 | 0                               |
| MinFeeRateNanosPerKB        | uint64 | Rate per KB                     |

**Response**

```
{
    ExpectedBitCloutReturnedNanos: 0,
    ExpectedCreatorCoinReturnedNanos: 220387140
    FounderRewardGeneratedNanos: 0,
    FounderRewardGeneratedNanos    0
    SpendAmountNanos    285038185
    TotalInputNanos    1220385962
    ChangeAmountNanos    935347512,
    FeeNanos: 265
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
    TxnHashHex: "..."
}
```

### Transfer Creator Coin

```
POST /api/v0/transfer-creator-coin
```

Prepare transaction for transfering creator coin. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1042) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1615).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1587).

| Name                                   | Type   | Description                        |
| -------------------------------------- | ------ | ---------------------------------- |
| SenderPublicKeyBase58Check             | string | Public key of sender               |
| CreatorPublicKeyBase58Check            | string | Public key of creator              |
| ReceiverUsernameOrPublicKeyBase58Check | string | username or public key of receiver |
| CreatorCoinToTransferNanos             | uint64 | Amount of Creator Coin to transfer |
| MinFeeRateNanosPerKB                   | uint64 | Rate per KB                        |

**Response**

```
{
    SpendAmountNanos: 0,
    TotalInputNanos    355031025
    ChangeAmountNanos    355030764
    FeeNanos    261
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
    TxnHashHex: "..."
}
```

### Send Diamonds

```
POST /api/v0/send-diamonds
```

Prepare transaction for sending diamonds 💎. Transaction needs to be signed and submitted through `api/v0/submit-transaction` before changes come into effect. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L954) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1750).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/transaction.go#L1739).

| Name                         | Type   | Description                    |
| ---------------------------- | ------ | ------------------------------ |
| SenderPublicKeyBase58Check   | string | Public key of sender           |
| ReceiverPublicKeyBase58Check | string | Public key of receiver         |
| DiamondPostHashHex           | string | Hash of post receiving diamond |
| DiamondLevel                 | int64  | Diamond level                  |
| MinFeeRateNanosPerKB         | uint64 | Rate per KB                    |

**Response**

```
{
    SpendAmountNanos: 0,
    TotalInputNanos    355031025
    ChangeAmountNanos    355030764
    FeeNanos    261
    Transaction: {
        TxInputs : [ 
            {
                TxID: [...],
                Index: 0
            } , ...
        ],
        TxOutputs : [
            {
                PublicKey: "...",
                AmountNanos: 999420
            }, ...
        ],
        TxnMeta : {...},
        PublicKey: "...",
        ExtraData: {...},
        Signature: {...},
        TxnTypeJSON: 6
    },
    TransactionHex: "...",
    TxnHashHex: "..."
}
```

## User Endpoints

### Get Users Stateless

```
POST /api/v0/get-users-stateless
```

Get information about users. Request contains a list of public keys of users to fetch. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L520) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L34).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L21).

| Name                  | Type      | Description         |
| --------------------- | --------- | ------------------- |
| PublicKeysBase58Check | \[]string | list of public keys |
| SkipHodlings          | bool      | HODL                |

**Response**

```
{
    UserList:[
        {
            PublicKeyBase58Check    "BC1YLg3FS19Syz9h6fqErZEtsKkRxBfkzqp75PiGwMUXJ1fLrytRVVk"
            ProfileEntryResponse    null
            Utxos    null
            BalanceNanos    0
            UnminedBalanceNanos    0
            PublicKeysBase58CheckFollowedByUser    []
            UsersYouHODL    null
            UsersWhoHODLYou    null
            HasPhoneNumber    false
            CanCreateProfile    true
            BlockedPubKeys    Object { }
            IsAdmin    true
            IsBlacklisted    false
            IsGraylisted    false
        }, ...
    ],
    DefaultFeeRateNanosPerKB: 100,
    ParamUpdaters: {...}
}
```

### Delete Identities

```
POST /api/v0/delete-identities
```

Temporary route to wipe [seedinfo cookies](https://github.com/bitclout/docs/blob/main/code/walkthrough.md#seed-creation-and-transaction-construction). This endpoint relies on [identity api](https://github.com/bitclout/docs/blob/main/devs/identity-api.md). Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L408) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L424).

**Parameters**

None

**Response**

None

### Get Profiles

```
POST /api/v0/get-profiles
```

Get user profile information. Default number of returned profiles is 20. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L723) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L513).

**Parameters**

OrderBy possible values: `{"influencer_stake", "influencer_post_stake", "newest_last_post", "newest_last_comment", "influencer_coin_price"}`. More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L455).

| Name                       | Type   | Description                                                                      |
| -------------------------- | ------ | -------------------------------------------------------------------------------- |
| PublicKeyBase58Check       | string | (optional) Check public key                                                      |
| Username                   | string | (optional) reader username                                                       |
| UsernamePrefix             | string | (optional) username prefix                                                       |
| Description                | string | (optional) description                                                           |
| OrderBy                    | string | Order ENUM                                                                       |
| NumToFetch                 | uint32 | (optional) number of profiles to fetch                                           |
| ReaderPublicKeyBase58Check | string | Reader public key                                                                |
| ModerationType             | string | (optional) empty string or "leaderboard"                                         |
| FetchUsersThatHODL         | bool   | If single profile is requested, return a list of HODLers                         |
| AddGlobalFeedBool          | bool   | If set to true posts in response will contain boolean if they are in global feed |

**Response**

```
{
    ProfilesFound: [
        {
            PublicKeyBase58Check: "...",
            Username: "...",
            Description: "...",
            ProfilePic : "...",
            IsHidden: false,
            IsReserved: false,
            IsVerified: false,
            Comments: null,
            Posts: null,
            CoinEntry: {
                CreatorBasisPoints: 1000,
                BitCloutLockedNanos: 0,
                NumberOfHolders: 0,
                CoinsInCirculationNanos: 0,
                CoinWatermarkNanos: 0
            },
            CoinPriceBitCloutNanos: 0,
            StakeMultipleBasisPoints: 12500,
            StakeEntryStats: {
                TotalStakeNanos: 0, 
                TotalStakeOwedNanos: 0,
                TotalCreatorEarningsNanos: 0,
                TotalFeesBurnedNanos: 0,
                TotalPostStakeNanos: 0
            }
            UsersThatHODL: {...}
        }, ...
    ],
    NextPublicKey: null
}
```

### Get Single Profile

```
POST /api/v0/get-single-profile
```

Get information about single profile. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L736) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L935).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L923).

| Name                 | Type   | Description                 |
| -------------------- | ------ | --------------------------- |
| PublicKeyBase58Check | string | (optional) Check public key |
| Username             | string | profile username            |

**Response**

```
{
    ProfilesFound: [
        {
            PublicKeyBase58Check: "...",
            Username: "...",
            Description: "...",
            ProfilePic : "...",
            IsHidden: false,
            IsReserved: false,
            IsVerified: false,
            Comments: null,
            Posts: null,
            CoinEntry: {
                CreatorBasisPoints: 1000,
                BitCloutLockedNanos: 0,
                NumberOfHolders: 0,
                CoinsInCirculationNanos: 0,
                CoinWatermarkNanos: 0
            },
            CoinPriceBitCloutNanos: 0,
            StakeMultipleBasisPoints: 12500,
            StakeEntryStats: {
                TotalStakeNanos: 0, 
                TotalStakeOwedNanos: 0,
                TotalCreatorEarningsNanos: 0,
                TotalFeesBurnedNanos: 0,
                TotalPostStakeNanos: 0
            }
            UsersThatHODL: {...}
        }, ...
    ],
    NextPublicKey: null
}
```

### Get Hodlers For Public Key

```
POST /api/v0/get-hodlers-for-public-key
```

Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L736) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1030).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L996).

| Name                     | Type   | Description                        |
| ------------------------ | ------ | ---------------------------------- |
| PublicKeyBase58Check     | string | (optional) check public key        |
| Username                 | string | profile username                   |
| LastPublicKeyBase58Check | string | (optional) last public key check   |
| NumToFetch               | uint64 | number of records to fetch         |
| FetchHodlings            | bool   | if true fetch balance for hodlings |
| FetchAll                 | bool   | if true fetch all                  |

**Response**

```
{
    Hodlers: [
        {
            HODLerPublicKeyBase58Check: "...",
            CreatorPublicKeyBase58Check: "...",
            HasPurchased: false,
            BalanceNanos: 2500509627,
            NetBalanceInMempool: 0,
            ProfileEntryResponse: {...}
        }, ...
    ],
    LastPublicKeyBase58Check: "..."
}
```

### Get Diamonds for Public Key

```
POST /api/v0/get-diamonds-for-public-key
```

Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L970) and implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1171).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1158).

| Name                 | Type   | Description                               |
| -------------------- | ------ | ----------------------------------------- |
| PublicKeyBase58Check | string | Check public key                          |
| FetchYouDiamonded    | bool   | If true fetch diamonds this user gave out |

**Response**

```
{
    DiamondSenderSummaryResponses: [
        {
            SenderPublicKeyBase58Check: "...",
            ReceiverPublicKeyBase58Check: "...",
            TotalDiamonds: "...",
            HighestDiamondLevel: "...",
            DiamondLevelMap: {...},
            ProfileEntryResponse: {...}
        }, ...
    ],
    TotalDiamonds: 555
}
```

### Get Follows Stateless

```
POST /api/v0/get-follows-stateless
```

Get followers. Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L839) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1440).

**Parameters**

Either publickey or username can be set. More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1288).

| Name                        | Type   | Description                          |
| --------------------------- | ------ | ------------------------------------ |
| PublicKeyBase58Check        | string | Check public key                     |
| Username                    | string | username                             |
| GetEntriesFollowingUsername | bool   | Get entries following username       |
| LastPublicKeyBase58Check    | string | public key of last follower/followee |
| NumToFetch                  | uint64 | number of records to fetch           |

**Response**

```
{
    PublicKeyToProfileEntry: {
        "BC1YLfuD5AGm2guj3q5wF7WGi3jTUzNhHUHc84GtVsk9kHyxbnk5V1H" : {
            PublicKeyBase58Check: "...",
            Username: "...",
            Description: "...",
            ProfilePic : "...",
            IsHidden: false,
            IsReserved: false,
            IsVerified: false,
            Comments: null,
            Posts: null,
            CoinEntry: {
                CreatorBasisPoints: 1000,
                BitCloutLockedNanos: 0,
                NumberOfHolders: 0,
                CoinsInCirculationNanos: 0,
                CoinWatermarkNanos: 0
            },
            CoinPriceBitCloutNanos: 0,
            StakeMultipleBasisPoints: 12500,
            StakeEntryStats: {
                TotalStakeNanos: 0, 
                TotalStakeOwedNanos: 0,
                TotalCreatorEarningsNanos: 0,
                TotalFeesBurnedNanos: 0,
                TotalPostStakeNanos: 0
            },
            UsersThatHODL: {...}
        }, ...
    },
    NumFollowers: 17707
}
```

### Get User Global Metadata

```
POST /api/v0/get-user-global-metadata
```

Get user metadata such as email and phone. This endpoint relies on [identity api](https://github.com/bitclout/docs/blob/main/devs/identity-api.md). Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1131) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1523).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1507).

| Name                     | Type   | Description                        |
| ------------------------ | ------ | ---------------------------------- |
| UserPublicKeyBase58Check | string | user public key                    |
| JWT                      | string | JSON web token authenticating user |

**Response**

```
{
    Email: "...",
    PhoneNumber: "..."
}
```

### Update User Global Meta

```
POST /api/v0/update-user-global-metadata
```

TODO

### Get Notifications

```
POST /api/v0/get-notifications
```

Get user notifications. This endpoint relies on [identity api](https://github.com/bitclout/docs/blob/main/devs/identity-api.md). Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1099) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1670).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1655).

| Name                 | Type   | Description                                                             |
| -------------------- | ------ | ----------------------------------------------------------------------- |
| PublicKeyBase58Check | string | user public key                                                         |
| FetchStartIndex      | int64  | Index of notification at which to start paginated lookup. Can set to -1 |
| NumToFetch           | int64  | Number of notifications to fetch                                        |

**Response**

```
{
    Notifications : [
        {
            Metadata : {
                BlockHashHex: "...",
                TxnIndexInBlock: 3921,
                TxnType: "FOLLOW",
                TransactorPublicKeyBase58Check: "...",
                AffectedPublicKeys: [...],
                BasicTransferTxindexMetadata: {...},
                TotalInputNanos: 89585061,
                TotalOutputNanos: 89584839,
                FeeNanos: 222,
                UtxoOpsDump: "..."
            },
            Txn: null,
            Index: 50
        }, ...
    ],
    ProfilesByPublicKey: {
        "BC1YLfuD5AGm2guj3q5wF7WGi3jTUzNhHUHc84GtVsk9kHyxbnk5V1H" : {
            PublicKeyBase58Check: "...",
            Username: "...",
            Description: "...",
            ProfilePic : "...",
            IsHidden: false,
            IsReserved: false,
            IsVerified: false,
            Comments: null,
            Posts: null,
            CoinEntry: {
                CreatorBasisPoints: 1000,
                BitCloutLockedNanos: 0,
                NumberOfHolders: 0,
                CoinsInCirculationNanos: 0,
                CoinWatermarkNanos: 0
            },
            CoinPriceBitCloutNanos: 0,
            StakeMultipleBasisPoints: 12500,
            StakeEntryStats: {
                TotalStakeNanos: 0, 
                TotalStakeOwedNanos: 0,
                TotalCreatorEarningsNanos: 0,
                TotalFeesBurnedNanos: 0,
                TotalPostStakeNanos: 0
            },
            UsersThatHODL: {...}
        }, ...
    },
    PostsByHash: {
        "5782badd48b3db0ea3074fa6339e1a726265bdfbd86ed38e1e55691f2d79b296" : {
            PostHashHex: "...",
            PosterPublicKeyBase58Check: "...",
            ParentStakeID : "",
            Body: "...",
            ImageURLs: [],
            RecloutedPostEntryResponse: null,
            CreatorBasisPoints: 1000,
            StakeMultipleBasisPoints: 12500,
            TimestampNanos: 1623010583195063300,
            IsHidden: false,
            ConfirmationBlockHeight: 31919,
            InMempool: false,
            StakeEntry: {...},
            StakeEntryStats: {...},
            ProfileEntryResponse: {...},
            Comments: null,
            LikeCount: 1,
            DiamondCount: 1,
            PostEntryReaderState: {...},
            IsPinned: false,
            PostExtraData: {...},
            CommentCount: 0,
            RecloutCount: 0,
            ParentPosts: null,
            DiamondsFromSender: 0
        }
    }
}
```

### Block Public Key

```
POST /api/v0/block-public-key
```

Block user. This endpoint relies on [identity api](https://github.com/bitclout/docs/blob/main/devs/identity-api.md). Example use in [frontend](https://github.com/bitclout/frontend/blob/96bdf0c/src/app/backend-api.service.ts#L1099) and endpoint implementation in [backend](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L1670).

**Parameters**

More info on the request [here](https://github.com/bitclout/backend/blob/47bcc8a/routes/user.go#L2153).

| Name                      | Type   | Description                        |
| ------------------------- | ------ | ---------------------------------- |
| PublicKeyBase58Check      | string | user public key                    |
| BlockPublicKeyBase58Check | string | blocked user public key            |
| Unblock                   | bool   | false if block, true if unblock    |
| JWT                       | string | JSON web token authenticating user |

**Response**

```
{
    BlockedPublicKeys: {
        "BC1YLhqEhWvNnwW9TBqXURFqwkdpUYKrMVgTHQzopF5rRBDcD1LLSUp": {...},
        ...
    }
}
```

## Post Endpoints

### Get Posts Stateless

```
POST /api/v0/get-posts-stateless
```

TODO

### Get Single Post

```
POST /api/v0/get-single-post
```

TODO

### Get Posts For Public Key

```
POST /api/v0/get-posts-for-public-key
```

TODO

### Get Diamonded Posts

```
POST /api/v0/get-diamonded-posts
```

TODO

## Media Endpoints

### Upload Image

```
POST /api/v0/upload-image
```

TODO

### Get Full TikTok URL

```
POST /api/v0/get-full-tiktok-url
```

TODO

## Message Endpoints

### Send Message Stateless

```
POST /api/v0/send-message-stateless
```

TODO

### Get Messages Stateless

```
POST /api/v0/get-messages-stateless
```

### Mark Contact Messages Read

```
POST /api/v0/mark-contact-messages-read
```

TODO

### Mark All Messages Read

```
POST /api/v0/mark-all-messages-read
```

TODO

## Verify Endpoints

### Send Phone Number Verification Text

```
POST /api/v0/send-phone-number-verification-text
```

TODO

### Submit Phone Number Verification Text

```
POST /api/v0/submit-phone-number-verification-code
```

TODO

## Wyre Endpoints

### Get Wyre Wallet Order Quotation

```
POST /api/v0/get-wyre-wallet-order-quotation
```

### Get Wyre Wallet Order Reservation

```
POST /api/v0/get-wyre-wallet-order-reservation
```

TODO

### Wyre Wallet Order Subscription

```
POST /api/v0/wyre-wallet-order-subscription
```

TODO

### Admin Get Wyre Orders For Public Key

```
POST /api/v0/admin/get-wyre-wallet-orders-for-public-key
```

TODO

## Miner Endpoints

### Get Block Template

```
POST /api/v0/get-block-template
```

TODO

### Submit Block

```
POST /api/v0/submit-block
```

TODO

## Admin Node Endpoints

### Node Control

```
POST /api/v0/admin/node-control
```

TODO

### Reprocess Bitcoin Block

```
POST /api/v0/admin/reprocess-bitcoin-block
```

TODO

### Get Mempool Stats

```
POST /api/v0/admin/get-mempool-stats
```

TODO

### Evict Unmined Bitcoin Txns

```
POST /api/v0/admin/evict-unmined-bitcoin-txns
```

TODO

## Admin Transaction Endpoints

### Get Global Params

```
POST /api/v0/admin/get-global-params
```

TODO

### Update Global Params

```
POST /api/v0/admin/update-global-params
```

TODO

### Swap Identity

```
POST /api/v0/admin/swap-identity
```

TODO

## Admin User Endpoints

### Update User Global Metadata

```
POST /api/v0/admin/update-user-global-metadata
```

TODO

### Get All User Global Metadata

```
POST /api/v0/admin/get-all-user-global-metadata
```

TODO

### Get User Global Metadata

```
POST /api/v0/admin/get-user-global-metadata
```

TODO

### Grant Verification Badge

```
POST /api/v0/admin/grant-verification-badge
```

TODO

### Remove Verification Badge

```
POST /api/v0/admin/remove-verification-badge
```

TODO

### Get Verified Users

```
POST /api/v0/admin/get-verified-users
```

TODO

### Get Username Verification Audit Logs

```
POST /api/v0/admin/get-username-verification-audit-logs
```

TODO

## Admin Feed Endpoints

### Update Global Feed

```
POST /api/v0/admin/update-global-feed
```

TODO

### Pin Post

```
POST /api/v0/admin/pin-post
```

TODO

### Remove Nil Posts

```
POST /api/v0/admin/remove-nil-posts
```

TODO


# Identity API

The BitClout Identity service provides a convenient and secure way for users to login to many different BitClout nodes and applications. When using BitClout Identity, users' private key material never leaves the browser. All signing happens in a secured `iframe` and transaction approvals occur in a pop-up window.

The developer community highly recommends node operators and app developers integrate with [identity.bitclout.com](https://identity.bitclout.com) to provide users with consistent log in, sign up, and account management experiences. Identity currently integrates most smoothly with web-based applications. The developer community is working on creating libraries for integrating with iOS and Android.

## Message Protocol

Applications interact with Identity in two ways: embedding Identity in an `iframe` and opening Identity in a new window via `window.open`. The `iframe` context can handle transaction signing and message decryption. The `window.open` context can handle log in, sign up, log out, and account management. Both `iframe` and `window.open` contexts communicate with the parent via `window.postMessage` .

A few notes about message formats:

* Messages with an `id` and `method` are requests that expect a response.
* Messages with an `id` and no `method` are responses to requests.
* Messages without an `id` do not expect a response.
* UUID v4 is the recommended `id` format.

### `initialize`

The first message Identity sends to the parent when it loads in is `initialize`. This message is sent in both `iframe` and `window.open` contexts. A response is required so Identity knows the hostname of the parent window.

#### Request

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  method: 'initialize',
}
```

#### Response

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
}
```

## `window.open` context

Opening Identity using window\.open allows an application to send and receive messages to the newly opened tab or pop-up. A new Identity window can be opened at many paths:

```javascript
const login   = window.open('https://identity.bitclout.com/log-in');
const signUp  = window.open('https://identity.bitclout.com/sign-up');
const logout  = window.open('https://identity.bitclout.com/logout?publicKey=BC123');
const approve = window.open('https://identity.bitclout.com/approve?tx=0abf35a');

// Can be added to any path for testnet bitclout and bitcoin addresses
const testnet = window.open('https://identity.bitclout.com/log-in?testnet=true');
```

Only one Identity window should be opened at a time.

### Access Levels

Users can control access level on a per-domain and per-account basis. The available access levels are:

```javascript
enum AccessLevel {
  // User revoked permissions
  None = 0,

  // Approval required for all transactions
  ApproveAll = 2,

  // Approval required for buys, sends, and sells
  ApproveLarge = 3,

  // Node can sign all transactions without approval
  Full = 4,
}
```

An application can specify which access level it would like to request by including `accessLevelRequest` as a query parameter when opening the Identity window. If no `accessLevelRequest` is specified then `ApproveAll` is used as the default.

### `login`

When a user finishes any action in an Identity window a `login` message is sent. The login message does not expect a response and means the Identity window can be closed by calling `window.close` on the stored reference to the window\.open.

For a log in or sign up action the selected `publicKey` will be included in `publicKeyAdded`. When a user approves a transaction the signed transaction will be included in `signedTransactionHex`.

An application should store the current `publicKey` and `users` objects in its local storage. When an application wants to sign or decrypt something the `accessLevel`, `accessLevelHmac`, and `encryptedSeedHex` values will be required.

#### Request

```javascript
{
  users: {
    BC1YLfsWMfv8UdytwrWqWvqSP6M6eQJg7W5TWL1WNDYd7zxi6wEShQX: {
      accessLevel: 4,
      accessLevelHmac: "0d22e283751c904ab36dc3910afe1a981...",
      btcDepositAddress: "1PXhm3D6sgZtfGNe2mtP27NVBHEcNJX2AW",
      encryptedSeedHex: "bdad93a19eb3be8b4c2f63b5cefb82823...",
      hasExtraText: false,
      network: "mainnet",
    },
  },
  publicKeyAdded: '',
  signedUp: false,
  signedTransactionHex: '',
}
```

## `iframe` context

The iframe is responsible for signing and decryption. The iframe is usually entirely invisible to the user. However, the iframe does need to render when the user needs to grant storage access on Safari.

```markup
<iframe
  id="identity"
  frameborder="0"
  src="https://identity.bitclout.com/embed"
  style="height: 100vh; width: 100vw;"
  [style.display]="requestingStorageAccess ? 'block' : 'none'"
></iframe>
```

### `info`

The iframe responds to `info` messages which helps Identity support Safari and Chrome on iOS. Apple's Intelligent Tracking Prevention (ITP) places strict limitations on cross-domain data storage and access. This means the Identity `iframe` must request storage access every time the page reloads. When a user visits a BitClout application in Safari they will see a "Tap anywhere to unlock your wallet" prompt which is a giant button in the `iframe`. When the `info` message returns `hasStorageAccess: false`, an application should make the `iframe` take over the entire page. Above, this means setting `requestingStorageAccess = true`.

The `info` message also detects if a user has disabled third party cookies. Third party cookies are required for Identity to securely sign transactions. If `info` returns `browserSupported: false` an application should inform the user they will not be able to use Identity to sign or decrypt anything.

#### Request

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  method: 'info',
}
```

#### Response

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  payload: {
    hasStorageAccess: true,
    browserSupported: true,
  },
}
```

### `storageGranted`

The `iframe` sends a `storageGranted` message when a user clicks "Tap anywhere to unlock your wallet." It does not expect a response. When an application receives this message it can hide the `iframe` from view and the `iframe` is now ready to receive `sign` and `decrypt` messages.

#### Request

```javascript
{
  service: 'identity',
  method: 'storageGranted',
}
```

### `sign`

The sign message is responsible for signing transaction hexes. If approval is required an application must call `window.open` to acquire a `signedTransactionHex`.

#### Request

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  method: 'sign',
  payload: {
    accessLevel: 3,
    accessLevelHmac: "0fab13f4...",
    encryptedSeedHex: "0fab13f4...",
    transactionHex: "0fab13f4...",
  },
}
```

#### Response (Success)

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  payload: {
    signedTransactionHex: "0fab13f4...",
  },
}
```

#### Response (Approval Required)

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  payload: {
    approvalRequired: true,
  },
}
```

### `decrypt`

The decrypt message is responsible for decrypting messages.

#### Request

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  method: 'decrypt',
  payload: {
    accessLevel: 3,
    accessLevelHmac: "0fab13f4...",
    encryptedSeedHex: "0fab13f4...",
    encryptedHexes: [
      "0fab13f4...",
      "0fab13f4...",
    ]
  },
}
```

#### Response

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  payload: {
    decryptedHexes: {
      "0fab13f4...": "hello world"
      "0fab13f4...": "in retrospect it was inevitable",
    }
  },
}
```

### `jwt`

The `jwt` message creates signed JWT tokens that can be used to verify a user's ownership of a specific public key.

#### Request

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  method: 'jwt',
  payload: {
    accessLevel: 3,
    accessLevelHmac: "0fab13f4...",
    encryptedSeedHex: "0fab13f4...",
  },
}
```

#### Response

```javascript
{
  id: '21e02080-0ef4-4056-a319-a66403f33768',
  service: 'identity',
  payload: {
    jwt: "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE2MTk2NDk4MDcsImV4cCI6MTYxOTY0OTg2N30.FKZF8DSwwlnUaW_eRa7Wr1v2QcG7_iDN-NjdqXUcgrSAPg1EdSfpWsLL4GeUiD9zdLUgrNoKU7EsKkE-ZKMaVQ",
  },
}
```

#### Validation in Go

```javascript
func ValidateJWT(publicKey string, jwtToken string) (bool, error) {
    pubKeyBytes, _, err := Base58CheckDecode(publicKey)
    if err != nil {
        return false, err
    }

    pubKey, err := btcec.ParsePubKey(pubKeyBytes, btcec.S256())
    if err != nil {
        return false, err
    }

    token, err := jwt.Parse(jwtToken, func(token *jwt.Token) (interface{}, error) {
        return pubKey.ToECDSA(), nil
    })

    return token.Valid, err
}
```

## Mobile / Webview support

Identity current offers support for mobile projects as well, but there are some differences needed in order to fully integrate.

Major differences:

1. There is no need to run an iframe context. You will send all messages to one context running in a webview.
2. Your webview context will need have an additional parameter `?webview=true`
3. Depending on your mobile development framework, you need to make sure messages to and from the webview are being registered appropriately. Currently iOS, Android, and React Native webviews are supported.


# Exchange Listing API

**The dev community recommends using the open source Rosetta API implementation for integrating BitClout on an exchange:** [**https://github.com/bitclout/rosetta-bitclout**](https://github.com/bitclout/rosetta-bitclout)**. The other APIs in this doc are less supported than the Rosetta APIs.**

Multiple major crypto exchanges have expressed interest in listing BitClout. The dev community is working closely with several of these, but, now that anyone in the world can run a BitClout node, we thought we'd democratize and decentralize this effort by publishing a simple public API that any crypto exchange in the world could follow to integrate BitClout.

This guide will cover all of the API endpoints that are needed in order to list BitClout, with detailed descriptions and examples. This includes:

* Setting up a node.
* Using the Exchange API to create unlimited public/private key pairs.
* Using the Exchange API to check the balance of BitClout public keys.
* Using the Exchange API to transfer BitClout between public keys.
* Using the Exchange API to query for transactions by transaction ID.
* Using the Exchange API to query for transactions by public key.
* Using the Exchange API to query for node sync status.
* Using the Exchange API to query for block information by height or block hash.

The [Quick Start](/devs/exchange-listing-api#quick-start) section provides examples of all of the above using the “curl” command. The [Full API Guide](/devs/exchange-listing-api#full-api-guide) section provides more detail on each API endpoint shown in the examples.

***Note: This API is strictly for use by exchanges. The bitclout.com nodes use in-browser signing such that your seed phrase never leaves your browser (***[***learn more***](https://docs.bitclout.com/privacy-and-security)***). In contrast, exchanges are typically custodial and so some of these endpoints manipulate seeds on behalf of users.***

## Quick Start

### **Generate a Seed Mnemonic**

To get started, you need to generate a standard [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki) mnemonic seed that will be used to generate public/private key pairs. If you don't require that your keys be generated on an air-gapped computer, then you can use the [bitclout.com](https://bitclout.com) signup flow to generate your mnemonic. Note that your seed *never* leaves your browser when you generate it on bitclout.com. See [Privacy and Security](https://docs.bitclout.com/privacy-and-security) for more details on this process.

If you need your seed to be generated in an offline fashion, then we recommend that you use [this tool](https://iancoleman.io/bip39/). Either a 12 or 24-word mnemonic should be fine, and standard Bitcoin mnemonics work as well.

What we will use in our examples:

* Mnemonic: *arrive mixture refuse loud people robot dolphin scissors lift curve better demand*
* Passphrase (also known as "ExtraText"): *password*

### Run a Node

All of the commands and examples in this guide will assume that you have a BitClout node running on your local machine. To set one up, simply follow the instructions in the open-source /run repository. If you run into any trouble, the [nodes-discussion](https://discord.com/channels/820740896181452841/835273317773869086) Discord channel is always available to help you:

* <https://github.com/bitclout/run>

Note that the node software is cross-platform and should run on Linux, Mac, and Windows. However, it seems as though people have had the most success with Linux and Mac machines with at least 32GB of RAM and at least 100GB of free disk space.

*NOTE: You must set `READ_ONLY_MODE` to false in* [*dev.env*](https://github.com/bitclout/run/blob/190a2380b278689a4db844bb52a31d0450db7d46/dev.env#L265) *in order for some API calls to work. However, at the time of this writing, it is not yet recommended to deploy a production node with `READ_ONLY_MODE` set to false. This should change shortly, though. Keep an eye on the* [*README*](https://github.com/bitclout/run/tree/190a2380b278689a4db844bb52a31d0450db7d46) *for updates.*

### Check Node Sync Status

This query will return information about a node’s sync status, among other things. See the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for more information.

```
curl --header "Content-Type: application/json" --data-raw '{}' \
    http://localhost:17001/api/v1/node-info | python -m json.tool
```

Notes:

* We pipe the command into “python -m json.tool” so that it will “pretty print” but that you can delete this part of the command if you don’t have Python installed.
* We are assuming the node is running on the same machine on which we’re doing this query. If the node is running on a different machine then the IP of that machine should be substituted for “localhost.”

### Generate a Public/Private Key Pair

This will generate a public/private key-pair that corresponds to index “0” for this account. Each key-pair will map to an index for a particular seed. To generate more key-pairs, simply iterate the “Index” parameter.

```
curl --header "Content-Type: application/json" --request POST --data '{
    "Mnemonic":"arrive mixture refuse loud people robot dolphin scissors lift curve better demand",
    "ExtraText":"password",
    "Index": 0
}' http://localhost:17001/api/v1/key-pair  | python -m json.tool
```

Notes:

* Under the hood, every public/private key pair maps to derivation path m/44'/0'/0'/0/{index}. **Thus they would be identical to what is generated by any Bitcoin wallet using the same mnemonic, passphrase, and derivation path.**
* The public and private keys returned by this function will be encoded using base58 check encoding described in more detail in the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for this endpoint. For now, all that you need to know is that you can pass the public/private key strings to other API endpoints to check balances, spend BitClout, etc…
  * BitClout public keys that are encoded with base58 always start with the prefix “BC”. BitClout private keys that are encoded with base58 always start with the prefix “bc” (lower-case).
* Example of BitClout public/private key pair returned by this function. Note that Error being empty string means the endpoint succeeded.
  * ```
    {
        "Error": "",
        "PrivateKeyBase58Check": "bc6EmekhAbzn2V9BchgRLMRMZW1m8mo7kmvdwjZRB5nnKpgQhWSf4",
        "PrivateKeyHex": "423e1f1fe03469e4173f5a0056f468255358f9200fd5acfa7be8185d2fcb98b4",
        "PublicKeyBase58Check": "BC1YLgAJ2kZ7Q4fZp7KzK2Mzr9zyuYPaQ1evEWG4s968sChRBPKbSV1",
        "PublicKeyHex": "024089f4297576513ce07de8190583154c15b8279a586f7d0663ff3c5391351a1e"
    }
    ```
* We pipe the command into “python -m json.tool” so that it will “pretty print” but that you can delete this if you don’t have Python installed.

***Note: This API is strictly for use by exchanges. The bitclout.com nodes use a different API that never receives your seed phrase, and your seed phrase never leaves your browser. In contrast, exchanges are typically custodial and so some of these endpoints manipulate seeds on behalf of users.***

### Check Balance of BitClout Public Key

```
curl --header "Content-Type: application/json" --request POST --data '{
    "PublicKeyBase58Check":"BC1YLgAJ2kZ7Q4fZp7KzK2Mzr9zyuYPaQ1evEWG4s968sChRBPKbSV1"
}' http://localhost:17001/api/v1/balance | python -m json.tool
```

Notes:

* This will return the balance in “nanos,” where 1 BitClout = 1,000,000,000 “nanos.” For example, if the balance for this public key was “1 BitClout” then this endpoint will return 1,000,000,000 (or 1e9 nanos).
* This endpoint also returns UTXO's, but this likely won't be useful to most node operators.

### Transfer BitClout Using a Public/Private Key-Pair

```
curl --header "Content-Type: application/json" --request POST --data '{
    "SenderPublicKeyBase58Check":"BC1YLgAJ2kZ7Q4fZp7KzK2Mzr9zyuYPaQ1evEWG4s968sChRBPKbSV1", 
    "SenderPrivateKeyBase58Check":"bc6EmekhAbzn2V9BchgRLMRMZW1m8mo7kmvdwjZRB5nnKpgQhWSf4", 
    "RecipientPublicKeyBase58Check":"BC1YLgU67opDhT9bTPsqvue9QmyJLDHRZrSj77cF3P4yYDndmad9Wmx", 
    "AmountNanos": 1000000000
}' http://localhost:17001/api/v1/transfer-bitclout | python -m json.tool
```

Notes:

* This example will fail unless you send BitClout to the `SenderPublicKeyBase58Check`.
  * You can buy BitClout on bitclout.com and then use the "Send BitClout" page to get some BitClout for testing purposes.
* The amount must be specified in "nanos," where 1 BitClout = 1e9 nanos. This example transfers 1 BitClout from public key `BC1YLgAJ2kZ7Q4fZp7KzK2Mzr9zyuYPaQ1evEWG4s968sChRBPKbSV1` to public key `BC1YLgU67opDhT9bTPsqvue9QmyJLDHRZrSj77cF3P4yYDndmad9Wmx`
  * To do a "dry run" of the transaction without broadcasting it, simply add `DryRun: true` to the params.
* Setting “AmountNanos” to a negative value like -1 will send the maximum amount possible.
  * To implement a UI with a “Max” button, we recommend hitting this endpoint with a negative AmountNanos with DryRun set to true, grabbing the resultant “spend amount,” which will be net of fees, and displaying that to the user.
* This endpoint will return information for the transaction created. See the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section on this endpoint for more information on what is returned.
* A custom “fee rate” can also be set. See the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for this endpoint for more detail on that.

***Note: This API is strictly for use by exchanges. The bitclout.com nodes use a different API that never receives your seed phrase, and your seed phrase never leaves your browser. In contrast, exchanges are typically custodial and so some of these endpoints manipulate seeds on behalf of users.***

### Look Up Transactions for a Public Key

```
curl --header "Content-Type: application/json" --request POST --data '{
    "PublicKeyBase58Check":"BC1YLgAJ2kZ7Q4fZp7KzK2Mzr9zyuYPaQ1evEWG4s968sChRBPKbSV1",
    "IDsOnly": true
}' http://localhost:17001/api/v1/transaction-info | python -m json.tool
```

Notes:

* A transaction ID is a sha256 hash of a transaction, encoded using base58 check encoding, that uniquely identifies a transaction.
* This gets all the transaction IDs for a particular public key ordered from oldest to newest.
  * To fetch full transactions rather than just the IDs, simply set `IDsOnly` to `false` rather than `true` or leave it out of the request entirely.
* This endpoint will only work if the node was started with the [TXINDEX flag](https://github.com/bitclout/run/blob/190a2380b278689a4db844bb52a31d0450db7d46/dev.env#L123) set to true, which is the default.
  * You must also wait for your `TXINDEX` to generate, which can take a few hours. Grep your logs for UpdateTxIndex to monitor its progress.
* See the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for this endpoint to see what information will be returned by this endpoint.

### Look Up Transaction Using Transaction ID

Get information for a specific transaction using that transaction’s transaction ID. You can get a transaction ID from other endpoints like the [transfer-bitclout endpoint](/devs/exchange-listing-api#api-v-1-transfer-bitclout) described previously.

```
curl --header "Content-Type: application/json" --request POST --data '{
    "TransactionIDBase58Check": "3JuEUE5QSkjyuLwY8WUjS3MRjMbaNEd4nE63VugpU17HMzJW7vbrJP"
}' http://localhost:17001/api/v1/transaction-info | python -m json.tool
```

Notes:

* This is the same endpoint as the one used to lookup the transactions for a public key. When a `PublicKeyBase58Check` param is set, the `TransactionIDBase58Check` param is expected to be unset and is ignored.
* This endpoint will only work if the node was started with the [TXINDEX flag](https://github.com/bitclout/run/blob/190a2380b278689a4db844bb52a31d0450db7d46/dev.env#L123) set to true, which is the default.
* See the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for this endpoint to see what information will be returned by this endpoint.

### **Get Block For Block Hash or Height**

This will return all the information associated with the block at height 10715. If the chain is not synced up to this point, an error will be returned.

```
curl --header "Content-Type: application/json" --request POST --data '{
    "Height":10715
}' http://localhost:17001/api/v1/block | python -m json.tool
```

Same as the previous example, only queries the block by its hash rather than its height.

```
curl --header "Content-Type: application/json" --request POST --data '{
    "HashHex":"0000000000306a10b85a0bfd801479f1f2227ebaa8bdd5c61da4736dff319362"
}' http://localhost:17001/api/v1/block | python -m json.tool
```

For more information, see the [Full API Guide](/devs/exchange-listing-api#full-api-guide) section for these endpoints.

## Full API Guide

***Note: This API is strictly for use by exchanges. The bitclout.com nodes use a different API that never receives your seed phrase, and your seed phrase never leaves your browser. In contrast, exchanges are typically custodial and so some of these endpoints manipulate seeds on behalf of users.***

***Note: The dev community is also working to complete an integration with*** [***Rosetta***](https://www.rosetta-api.org/) ***that will further build on this API.***

### /api/v1/key-pair

You can generate public/private keypairs with a standard BIP39 mnemonic. Each public/private key pair corresponds to a particular index associated with the mnemonic. This means that index “5” for a particular mnemonic, for example, will always generate the same public/private key pair. An infinite number of public/private key pairs can thus be generated by iterating an index over a particular mnemonic.

All public/private keys are inter-operable as Bitcoin public/private keys. Meaning they represent a point on the secp256k1 curve (same as what is used by Bitcoin).

Under the hood, BitClout takes the BIP39 mnemonic and generates the public/private key pairs using the BIP32 derivation path m/44'/0'/0'/0/{index}, where "index" is the index of the public/private key being generated. This means that BitClout public/private key pair generated by the node will always line up with the public/private key pairs generated by [this Ian Coleman tool](https://iancoleman.io/bip39/). An engineer can therefore “sanity check” that things are working by generating a mnemonic using bitclout.com or Ian Coleman, creating a key pair with that mnemonic, and then verifying that the public/private key pairs generated line up with what is shown on bitclout.com or Ian Coleman.

```
PATH: /api/v1/key-pair
METHOD: POST
POST PARAMS:
	// A BIP39 mnemonic and extra text. Mnemonic can be 12 words or
	// 24 words. ExtraText is optional.
	Mnemonic  string
	ExtraText string
	// The index of the public/private key pair to generate
	Index uint32
RETURNS:
  // Blank if successful. Otherwise, contains a description of the
  // error that occurred.
  Error string
  // The BitClout public key encoded using base58 check encoding with
  // prefix = [3]byte{0x11, 0xc2, 0x0}
  // This public key can be passed in subsequent API calls to check
  // balance, among other things. All encoded BitClout public keys start
  // with the characters “BC”
  PublicKeyBase58Check string
  // The BitClout public key encoded as a plain hex string. This should
  // match the public key with the corresponding index generated by the
  // Ian Coleman tool.
  // This should not be passed to subsequent API calls, it is only provided
  // as a reference, mainly as a sanity-check.
  PublicKeyHex string
  // The BitClout private key encoded using base58 check encoding with
  // prefix = [3]byte{0x4f, 0x6, 0x1b}
  // This private key can be passed in subsequent API calls to spend BitClout,
  // among other things. All BitClout private keys start with
  // the characters “bc”
  PrivateKeyBase58Check string
  // The BitClout private key encoded as a plain hex string. Note that
  // this will not directly match what is produced by the Ian Coleman
  // tool because the tool shows the private key encoded using
  // Bitcoin’s WIF format rather than as raw hex. To convert this raw hex
  // into Bitcoin’s WIF format you can use this simple Python script:
  // https://github.com/geniusprodigy/bitcoin-convertpvk
  // This should not be passed to subsequent API calls. It is provided as
  // a reference, mainly as a sanity-check.
  PrivateKeyHex string
```

### /api/v1/balance

One can check the balance of a particular public key by passing the public key to the following endpoint.

Spent transaction outputs are not returned by this endpoint. To perform operations on spent transaction outputs, one must use the “transaction-info” endpoint instead.

```
PATH: /api/v1/balance
METHOD: POST
POST PARAMS:
  // A BitClout public key encoded using base58 check encoding (starts
  // with “BC”). When this field is provided, the other params are
  // ignored.
  PublicKeyBase58Check string
  // Only consider UTXOs with greater than or equal to the specified number
  // of confirmations. This defaults to zero, which considers all UTXOs,
  // including those in the mempool.
  Confirmations uint32
RETURNS:
  // Blank if successful. Otherwise, contains a description of the
  // error that occurred.
  Error string
  // The balance of the public key queried in “nanos.” Note 
  // there are 1e9 “nanos” per BitClout, so if the balance were “1 BitClout” then
  // this value would be set to 1e9.
  ConfirmedBalanceNanos int64
  // The unconfirmed balance of the public key queried in “nanos.” This field
  // is set to zero if Confirmations is set to a value greater than zero.
  UnconfirmedBalanceNanos int64
  // BitClout uses a UTXO model similar to Bitcoin. As such, querying
  // the balance returns all of the UTXOs for a particular public key for
  // convenience. Note that a UTXO is simply a reference to a particular
  // output index in a previous transaction
  UTXOs [{
    // A string that uniquely identifies a previous transaction. This is
    // a sha256 hash of the transaction’s information encoded using
    // base58 check encoding. Will be empty string if this UTXO is
    // a block reward.
    TransactionIDBase58Check string
    // The index within this transaction that corresponds to an output
    // spendable by the passed-in public key.
    Index int64
    // The amount that is spendable by this UTXO in “nanos” = 1e9 BitClout.
    AmountNanos uint64
    // The pulic key entitled to spend the amount stored in this UTXO.
    PublicKeyBase58Check string
    // The number of confirmations this UTXO has. Set to zero if the
    // UTXO is unconfirmed.
    Confirmations int64
    // Whether or not this UTXO was a block reward.
    IsBlockReward bool
  }, ... ]
```

### /api/v1/transfer-bitclout

BitClout can be transferred from one public key to another using this simple API call. To transfer BitClout, one must either provide a public/private key pair.

BitClout uses a UTXO model like Bitcoin but BitClout transactions are generally simpler than Bitcoin transactions because BitClout always uses the “from public key” as the “change” public key (meaning that it does not “rotate” keys by default). For example, if a transaction sends 10 BitClout from PubA to PubB with 5 BitClout in “change” and 1 BitClout as a “miner fee,” then the transaction would look as follows:

```
Input: 16 BitClout (10 BitClout to send, 5 BitClout in change, and 1 BitClout as a fee)
PubB: 10 BitClout (the amount being sent from A to B)
PubA: 5 BitClout (change returned to A)

Implicit 1 BitClout is paid as a fee to the miner. The miner fee is implicitly
computed as (total input – total output) just like in Bitcoin.
```

The maximum amount of BitClout can be sent by specifying a negative amount when calling the endpoint. We recommend running the endpoint once with `DryRun` set to `true`, inspecting the output, and then running it with `DryRun` set to `false`, which will actually broadcast the transaction.

```
PATH: /api/v1/transfer-bitclout
METHOD: POST
POST PARAMS:
	// A BitClout private key encoded using base58 check encoding (starts
	// with "bc").
	SenderPrivateKeyBase58Check string
	// A BitClout public key encoded using base58 check encoding (starts
	// with “BC”) that will receive the BitClout being sent.
	RecipientPublicKeyBase58Check string
	// The amount of BitClout to send in “nanos.” Note that “1 BitClout” is equal to
	// 1e9 nanos, so to send 1 BitClout, this value would need to be set to 1e9.
	AmountNanos int64
	// The fee rate to use for this transaction. If left unset, a default fee rate
	// will be used. This can be checked using the “DryRun” parameter below.
	MinFeeRateNanosPerKB int64
	// When set to true, the transaction is returned in the response but not
	// actually broadcast to the network. Useful for testing.
	DryRun bool
RETURNS:
  // Blank if successful. Otherwise, contains a description of the
  // error that occurred.
  Error string
  // The transaction that executes the transfer. Will not be broadcast
  // if DryRun is set to true.
  Transaction {
    // A string that uniquely identifies this transaction. This is a sha256 hash
    // of the transaction’s data encoded using base58 check encoding.
    TransactionIDBase58Check string
    // The raw hex of the transaction data. This can be fully-constructed from
    // the human-readable portions of this object.
    RawTransactionHex string
    // The inputs of this transaction.
    Inputs [{
        // An input in a transaction consists of the transaction ID and
        // the index of the output from that transaction.
        TransactionIDBase58Check string
        Index int64
      }, ... ]
    Outputs [
      // A transaction output is simply a public key and the
      // amount that is being allocated to that public key in
      // “nanos” where 1 BitClout = 1e9 nanos.
      {
        PublicKeyBase58Check string
        AmountNanos int64
      }, ... ]
    // The signature of the transaction in hex format.
    SignatureHex string
    // Will always be “0” for basic transfers
    TransactionType int64
    // Will always be empty for basic transfers
    TransactionMeta {}
    // The hash of the block in which this transaction was mined. If the
    // transaction is unconfirmed, this field will be empty. To look up
    // how many confirmations a transaction has, simply plug this value
    // into the "block" endpoint.
    BlockHashHex string
  }
  TransactionInfo {
    // The sum of the inputs
    TotalInputNanos uint64
    // The amount being sent to the “RecipientPublicKeyBase58Check”
    SpendAmountNanos uint64
    // The amount being returned to the “SenderPublicKeyBase58Check”
    ChangeAmountNanos uint64
    // The total fee and the fee rate (in nanos per KB) that was used for this
    // transaction.
    FeeNanos uint64
    FeeRateNanosPerKB uint64
    // Will match the public keys passed as params. Note that
    // SenderPublicKeyBase58Check receives the change from this transaction.
    SenderPublicKeyBase58Check string
    RecipientPublicKeyBase58Check string
  }
```

### /api/v1/transaction-info

If one has a TransactionIDBase58Check, e.g. from calling the “transfer-bitclout” endpoint, one can get the corresponding human-readable “Transaction object” by passing this transaction id to a node. Note that this endpoint will error if `TXINDEX` is set to false. If `TXINDEX` was passed to the node but it has not finished syncing the blockchain yet, this endpoint may return incomplete results. The `/node-info` endpoint can be used to check where a node is in its sync process (generally, syncing takes only a minute or two).

If one has a PublicKeyBase58Check (starts with “BC”), one can get all of the TransactionIDs associated with that public key sorted by oldest to newest (this will include transactions where the address is a sender and a receiver). One can also optionally get the full Transaction objects for all of the transactions in the same call.

```
PATH: /api/v1/transaction-info
METHOD: POST
POST PARAMS:
  // A string that uniquely identifies this transaction. E.g. from a previous
  // call to “transfer-bitclout”. Ignored when PublicKeyBase58Check is set.
  // When a transaction is looked up using its ID directly, we also scan the
  // mempool for it. This makes it so that a “block explorer” can easily
  // surface transactions associated with a particular ID.
  TransactionIDBase58Check string
  // A BitClout public key encoded using base58 check encoding (starts
  // with “BC”) to get transaction IDs for. When set,
  // TransactionIDBase58Check is ignored.
  PublicKeyBase58Check string
  // Whether or not to return full transaction info or just the TransactionIDHex
  // for each transaction. Full transactions are returned when this is unset.
  IDsOnly bool
RETURNS
  // Blank if successful. Otherwise, contains a description of the
  // error that occurred.
  Error string
  // The info for all transactions this public key is associated with from oldest
  // to newest. If “IDsOnly” is set to true, each Transaction object will contain
  // only TransactionIDBase58Check. Otherwise, all other fields will be set as well.
  Transactions [
    Transaction {
      // Always set.
      TransactionIDBase58Check string
      // Rest of fields are as defined previously, but only set if
      // IDsOnly is unset or false.
      ...
  }, ... ]

```

### /api/v1/node-info

General information about the node’s blockchain and sync state can be queried using this endpoint. The blockchain does a “headers-first” sync, meaning it first downloads all BitClout headers and then downloads all blocks. This means that, when the node is first syncing, the tip of the best “header chain” may be ahead of of its most recently downloaded block. In addition to syncing BitClout headers and BitClout blocks, a BitClout node will also sync all of the latest Bitcoin headers to power its built-in decentralized Bitcoin <> BitClout swap mechanism. For this reason, the endpoint also returns information on the node’s best Bitcoin header chain, which is distinct from its BitClout chain.

```
PATH: /api/v1/node-info
METHOD: POST
RETURNS
  BitCloutStatus {
    // A summary of what the node is currently doing.
    State string
    
    // We generally track the latest header we have and the latest block we have
    // separately since headers-first synchronization can cause the latest header
    // to diverge slightly from the latest block.
    LatestHeaderHeight     uint32
    LatestHeaderHash       string
    LatestHeaderTstampSecs uint32
    
    LatestBlockHeight     uint32
    LatestBlockHash       string
    LatestBlockTstampSecs uint32
    
    // This is non-zero unless the main header chain is fully current. It can be
    // an estimate in cases where we don't know exactly what the tstamp of the
    // current main chain is.
    HeadersRemaining uint32
    // This is non-zero unless the main header chain is fully current and all
    // the corresponding blocks have been downloaded.
    BlocksRemaining uint32
  }
  BitcoinStatus {
    // We download Bitcoin headers in order to power the decentralized
    // Bitcoin <> BitClout swap built-in to the app,
    // which allows users to convert Bitcoin into BitClout without needing
    // to trust third-parties.
    //
    // This part of the response has the same schema as BitCloutStatus, only 
    // the block information won’t be populated since we only download
    // Bitcoin headers not full Bitcoin blocks.
  }
  BitCloutOutboundPeers []PeerResponse {
    IP           string
    ProtocolPort uint16
    JSONPort     uint16
    IsSyncPeer   bool
  }
  BitCloutInboundPeers []PeerResponse{
    // Same schema as above
  }
  BitCloutUnconnectedPeers []PeerResponse{
    // Same schema as above
  }
  BitcoinSyncPeer []PeerResponse{
    // Same schema as above
  }
  BitcoinUnconnectedPeers []PeerResponse{
    // Same schema as above
  }
  // The public keys the node is currently sending block rewards to.
  // If no public keys have been specified then the node will not be mining.
  MinerPublicKeys []string
```

### /api/v1/block

A block’s information can be queried using either the block hash or height. To get all blocks in the chain, simply query this endpoint by enumerating the heights starting from zero and iterating up to the tip. The tip height and hash can be obtained using the `/node-info` endpoint.

```
PATH: /api/v1/block
METHOD: POST
POST PARAMS:
  // Block height. 0 corresponds to the genesis block. An error will be
  // returned if the height exceeds the tip. This field is ignored if HashHex is
  // set.
  Height int64
  // Hash of the block to return. Height is ignored if this is set.
  HashHex string
  // When set to false, only returns the header of the block requested
  // not the full block. Otherwise, returns the full block.
  FullBlock bool
RETURNS
  // Blank if successful. Otherwise, contains a description of the
  // error that occurred.
  Error string
  // The information contained in the block’s header.
  Header {
    // The hash of the block that was queried.
    BlockHashHex string
    // Generally set to zero
    Version uint32
    // Hash of the previous block in the chain.
    PrevBlockHashHex string
    // The merkle root of all the transactions contained within the block.
    TransactionMerkleRootHex string
    // The unix timestamp (in seconds) specifying when this block was
    // mined.
    TstampSecs uint32
    // The height of the block this header corresponds to.
    Height uint32
    // The nonce is encoded as a little-endian 32-bit integer. If more than 2^32
    // hashes are required in order to mine a block, the block reward's ExtraData
    // field can be twiddled to change the merkle root to give a miner a fresh set
    // of 2^32 header nonces to try. Note that we don't use 64 bits (or more) because
    // keeping the header small is important for the efficiency of light clients and
    // because it doesn't add much value over over just twiddling the ExtraData
    // every 2^32 values.
    Nonce uint32
  }
  // A list of Transactions, where the Transaction object is as defined previously.
  Transactions [
    Transaction {
    }, ... 
  ]
```


# 什么是BitClout? (What is BitClout?)

**BitClout**是一个新型的社交网络，从头构建了用户可以利用其影响力和内容变现机制的自定义的区块链。 其架构和比特币类似，但却有着更大的规模和吞吐量， 可以更好地支持社交媒体复杂的数据，如发帖，用户资料，粉丝，投机预测等功能。并且和比特币一样，BitClout是一个完全开源的项目，其背后没有公司，只有代币和代码。

## 购买**BitClout**代币

BitClout区块链有自己的原生代币，叫BitClout, 用户可以使用它在平台上进行各种操作，包括购买一种如下介绍的叫做“创作者代&#x5E01;**”**&#x7684;新型资产。

任何人都可以在内置程序中在几分钟内用比特币通过去中心化的“原子交换”来购买BitClout。 具体步骤参见“购买BitClout”页面。BitClout 的供应量上限约为 1080 万，大约是比特币的一半，使其自然稀缺。

## 什么是创作者代币？

### 每个人都有一个代币

在平台上的每个用户资料中都有一个独特的可以被任何人买卖的代币，也就是“创作者代币”，它会在你创建用户资料时自动生成。其代币价格会随时购买量增长而上升，反之随着出售量上升而下降。

### 你可以购买您喜欢的人的代币

您可以通过在其他用户资料页面，直接点击“购买”来获得他人的代币。您可以通过搜索功能或在创作者代币“领袖排行榜”（如下所示）上找到其他用户账户。BitClout平台已经预建立了twitter上最有影响力的15000大“V”用户的信息，这也就意味着您可以在他们正式加入平台之前就可以买卖与之相关的“创作者代币“ 。这些“预留”的用户账户的旁边有一个“时钟”图标，表明此用户还没有加入平台，反之则会出现蓝色对勾图标

![](/files/-Mc5v0Ih9fqy2nVwe80_)

### 发推特以领取用户账户

这些预留用户的所有者可以在BitClout上导航到他们的主页并点击发推特确认和公开他们的BitClout公钥（如下图所示）。完成这个步骤后，他们将获得其账户的全部使用权及这个账户相应的所有创作者代币（参见创立者奖励)只有关联该twitter账户的所有者才能去认证这个预留账户。

![](/files/-Mc5v537RDqEoDqL1uO1)

### 创作者代币的用途？

创作者代币是一种关联个人声誉而非公司或者商品的新型资产，是第一个可以将社会影响力可以作为资产交易的工具。实际上，某人的代币应该是与这个人的社会影响力密切相关。比如，如果Elon Musk成功地实现了将第一个人类送上火星，那么他的代币价格理论上会上涨， 反之若他在一个新闻发布会上有不当言论，那么他的代币价格应该就会下跌。这样，人们可以因相信某人的潜力而购买其代币进行投资，并在其证明潜力和实现成功后在财务上得到回报。交易者也可以通过买卖波动来获利。

综上所述，创造者代币还有很多令人激动的方向和机会，我们希望在不久的将来将他们整合在一起， 例如：

#### 权益人代表大会

创作者可以只允许持有一定其代币的持币用户评价其帖子。这样就使得任何想在这个创作者有关内容上发声的用户必须要通过购买这个用户代币的方式与其建立联系。这样的联结方式不仅显著降低了垃圾信息的数量，并且创立了对此用户代币的显著需求，你可以想象下，比如Elon Musk或者Chamath举办一场有最低持币门槛的AMA或者是依照用户持币数量来回答问题。

#### 优先信息

大多数的创作者，都会在其社交媒体收件箱中收到很多的垃圾信息。通过BitClout平台，可以限定只有拥有一定数量其代币的用户发信或者就是直接的优先排序和增加持币多用户的信息优先级。或者，他们可以规定收取一定的代币来开放收件箱。这些都可以一方面增加其代币需求并且同时过滤垃圾信息。

#### 赞助帖子

创作者可以有一个收件箱， 这里任何人可以“出价”让他们去重新发布内容（也称为“转发”）设想下，如果您可以让Kim Kardashian转发您的时尚品牌，您可以直接向她的收件箱发送请求，如果她转推就会保留您的钱。这些投标也可以用创作者代币来进行，这样又显著的增加了对代币的需求。

#### 优质内容

拥有一定数量创作者代币的用户可以访问特殊内容，又或者人们需每月以创作者代币支付订阅费用才可以获得某些优质内容。

#### 分配与参与模式

创作者还可以使用其代币将稀有资源分配给最大的持币者。例如：想象一下，某位名人可以选择在某个特定日期与其最大代币持有者共进午餐。又或者，他们可以向前1000代币持有者增予1000张签名的海报。 这还仅仅是创作者利用代币与粉丝互动的开始，所有这些想法都将大大提高对这些代币的需求。

#### 商业化点赞

点赞可以被想象成对创作者代币的购买行为。点赞需要花费一定成本，但是相应的您也可以获得您点赞的创作者的代币（这样有效地建立了购买代币与其内容直接联结的捷径）。类似的功能可以作为提示更优质内容的有效信号。

#### 新兴现象

当给予人们能投机一个人声望的能力时会发生什么呢？我们不得而知，但是有一个功能已经浮现，就是所谓的“购买和转发”。通常，转发不会带来任何好处。即便这个人因为您日后成为超级巨星，幸运的话，几年后也许这个人还记得您的名字。相反的，在BitClout, 如果您持有某人的代币，然后转发他们的内容，您不仅可以在他们日后爆发后随之获得经济利益，同时也更益于炫耀。想象下，您说“我很早就转推了她”和“我以0.5美元购买了她的代币，现在是这代币价值500美元，并且我已经做了数百次了，这些都记录在区块链上”之间的区别。后者，显然是完全不同的游戏水准。而且这并不只是名人的游戏。如果您知道某人很有影响力，又或者您认识一个认识某人的人，你可以购买代币发送给其他人，以便他们可以购买代币和转发内容。这样就建立了多层次的激励机制。有趣之处在于这种机制并不是在产品中有意设计的，它是自发的在创作者代币的机制上产生的新兴现象，那么想想就激动，我们究竟还有多少还没有想到的创新动力？

### 创作者代币供应曲线

创作者代币是天然稀缺的，每个用户资料会存在少于**100**到**1500**枚代币。这是因为越多人

购买某个人账户的代币，其价格就会以越来越快的速度自然上涨。这也意味着，最终，可能需要花费数十亿美金去铸造一枚新的代币。

决定创作者代币价格的公式或“曲线”如下：请注意创作者代币通常是由BitClout加密货币来买卖，但是这里我们提供了一以美元形式的公式，以方便展示计算：

price\_in\_bitclout （以BitClout为基准代币价格） = .003 x creator\_coins\_in\_circulation^2 （创作者代币流通数量）

`price_in_usd（以美元为基准代币价格） = .003 x creator_coins_in_circulation^2 （创作者代币流通数量）x bitclout_price_in_usd （BitClout代币的美元价值）`

当您创建一个用户资料时，其初始代币数量和价格是零。您如果想购买这个账户的代币，那么根据上面的价格曲线，系统会自动铸造代币并出售给您。并且随着购买代币的数量增多，它的价格也越来越高，相应地您用来购买代币的资金用来兑换这些代币。另一方面，如果您想要出售代币，账户会自动从之前锁定的资金依据曲线购买您手中的代币。因此，购买代币推高代币价格，并且锁定资金在账户中；卖出代币销毁代币降低代币价格释放锁定资金，这也被通常称做“自动做市商”，Uniswap和Bancor等协议也由同样概念驱动。

下面是一个创作者代币价格曲线的图形，该曲线像是由某账户中代币流动数量的函数曲线。我们也加入了一个展示其价值的表格。两者均假设BitClout的价格为16美金。注意对价格曲线“积分”得出在账户中锁定的金额，该金额等于流入改账户的“净”金额，（包含在表格的第三栏中）。如果您想自己进行计算，也可以只用此[工作表](https://docs.google.com/spreadsheets/d/1zBEQBBoS12ZhFpPbB13-GTZ8keDVlstRG3l2If78pWM/edit?usp=sharing)（请制作副本并进行编辑）在此[链接](https://yos.io/2018/11/10/bonding-curves/)可以了解关于联合曲线的更多内容。

| 创作者代币流通量 | 创作者代币价格（美金） | 总锁定价值（美金）   |
| -------- | ----------- | ----------- |
| 5        | $1.2        | $2          |
| 10       | $4.80       | $16         |
| 20       | $19.20      | $128        |
| 40       | $76.80      | $1,024      |
| 80       | $307.20     | $8,192      |
| 160      | $1,228.80   | $65,536     |
| 320      | $4,915.20   | $524,288    |
| 640      | $19,660.80  | $4,194,304  |
| 1280     | $78,643.20  | $33,554,432 |

![](/files/-Mc5vmbMKDKcZf2AqHwq)

(创作者代币价格vs创作者代币流通数量) (创作者代币流通数量)

### 创始人奖励

每个账户都会允许保留一定比例的代币作&#x4E3A;**“**&#x521B;始人奖&#x52B1;**”**&#x4F8B;如：如果某人将其创始人奖励设置为**10%**，那么有人购买了价值**100BitClout**的其代币，相应的**10BitClout**代币会用来购买创作者代币，这些代币将会发送到创作者而非购买者的钱包。

综上所述，我们认为创作者拥有他们代币的增值部分的更优的方式是，在创立个人资料时就预先买入一部分代币，并将其创始人奖励百分比设为**0**。这样，因为在开始时这些代币的价格最低，这样减少了在日后购买其代币的价值磨损。 虽然如此，目前创始人奖&#x52B1;**“**&#x5408;理默&#x8BA4;**”**&#x6BD4;例是**10%**， 这确保了他们即使不做任何行动也会拥有一部分其代币。

## 去中心化的力量

就像比特币一样，互联网上的任何人都可以运行提供BitClout内容的BitClout“节点”， 并且每个节点都存储所有数据的完整副本。 这意味着，任何人都可以在BitClout的数据基础上构建应用程序，而不用担心被去平台化，并且每个节点可以自行定制信息的审核和展示策略。当您访问BitClout.com时候，您在使用我们的节点，但是还有无数像您一样节点同时运行着网络。长远来看，您可能可以从成千上万的节点获取同样的内容，每个节点有他们自定的盈利政策。也意味着您的登录名可以在运行BitClout的任意域名上登录。就像您可以从一个钱包到另一个钱包转移比特币一样， 您也可以在粉丝，帖子，创作者代币余额，等任何地方转移您的“Clout”代币。因此， 从某种意义上来说，BitClout正在以比特币去中心化金融系统的方式来去中心化社交媒体。


# 愿景 (The Vision)

## **BitClout**的灵感来源

当今时代，社交媒体存在诸多问题：

* 没有关注内容创造者奖励方式的任何创新。大多数的内容创作者的收入远远小于在现有平台上所创造的价值和应得收入。
* 少数公司却有效地控制了当今公众舆论。他们根据自身的广告收益而不是公众利益来决定我们看到的内容。
* 占据市&#x573A;**“**&#x7EDF;&#x6CBB;**”**&#x5730;位的公司切断了第三方开发者的可能性。“当权者”完全关闭了对其数据的访问路径，并且快速克隆市场上出现的创新产品用其数据壁垒取得竞争优势， 扼杀了产品创新和公平竞争。

BitClout的灵感来自于一个重要概念， 即：如果能将金融投机和社交媒体恰当地结合在一起，那么不仅可以创造出一款新颖的不基于广告收入的创作者变现产品，并且同时可以创造一种全新的商业模式以解决当今社交媒体存在的诸多问题。

为了实现这一目标，BitClout从比特币和以太坊受到启发。 这些平台取代了封闭的传统的金融生态系统，展现出了创新的开放性的替代方案。任何人都可以在其生态上建立和开发，极大地促进了竞争和创新。比特币和以太坊，他们没有“数据护城河”，事实上，他们越开放，在其生态上的开发者越多，比特币和以太坊的持有者积累的价值也就越高。这些项目首次展现出了，基于数据开放社区同样可以打造主流平台；避免建立一家公司为了股东获利而牺牲他人利益。**Bitcout**构想：这种同样的去中心化金融的模式是否也可以应用于建立去中心化的社交媒体？

## 什么是**BitClout**？

目前：BitClout 从根本上要做两件事：

* 一个新型的社交网&#x7EDC;**.**&#x5982;果您用过BitClout, 那么会知道像twitter一样, 它可以使用户发贴，但是在其基础上引入了“创作者代币” 以提供一种新型的变现工具。借助BitClout,每位创作者都会获得一个任何人都可以在平台上自由买卖的代币。这为内容创造者提供了创新的变现方式，并且使得与其平台粉丝建立更深厚的联系。不过“创作者代币”还仅仅只是创新的开始，您可以通过此链接去了解更多BitClout产品相关的信息 [点此链接](https://bitclout.com/one_pager.pdf).
* 一种新型的区块链：从项目创建伊始，BitClout就决定打造一个独立的自定义区块链平台。其架构类似于比特币，但却为了支持社交平台而重新设计。BitClout并不是一家公司，它没有董事会，没有CEO，像比特币一样，在节点上依靠代码运行。用户资料，发帖，关注…等所有信息都储存在每个人都可以访问的公共区块链上。使BitClout成为了一个完全开放的平台，去解决当今社交媒体存在的诸多问题。

## 终极目标：

现今任何一个在facebook和twitter上的帖子均属于这些公司而不是发布者，所得利益也流向了这些公司。

相比之下，BitClout将所有的数据存储在公共区块链上，这也意味着世界上的任何一个人都可以运行一个“节点”来发自己的内容。举例来说，BitClout.com也运行了一个有关加密货币内容的节点。同理其他“垂直”内容发布者也同样可以进入这个市场，创造相应内容。想象一下：如果ESPN在BitClout上运行其节点，可以为用户提供最优质的体育内容；又或者Politico在BitClout上运行节点也可以发布最好的政治内容。此外，由于BitClout是完全开源的，这些公司甚至可以自定义其用户界面和算法，以特别方式为其内容发布者和内容进行排序和评级来为其特定客户提供服务。这样，一个由少数巨头控制提供信息方式的局面会很快被打破，使得用户有无数的信息来源的选择，同时每个信息源也有其各自专注的领域。

不仅如此，因为信息是存储在公共区块链上，只要一位工程师，任何人都可以构建一个社交媒体尝试来和现有的社交媒体公司展开竞争。这降低了在社交媒体领域创新的门槛。现有发布者可以轻而易举地加速社交产品和其主营业务的联结，使得在先进巨头公司业务基础上也可以快速的创新。这改变了现今社交媒体创业，首先要获得**10**亿用户的数据护城河的现状。

最值得一提的是， 不管是谁，如果运行节点来展示和发布自己的内容，数据都会发送到公共区块链的数据池，包括用户个人资料，帖子，粉丝等数据都会在公共区块链上。一个在ESPN上的帖子或“点赞”可以在Politico的内容中展现。一个在中国的帖子可以出现在美国的节点内容中，反之亦然。随着节点数量的增多，更多的内容返回和存储在数据池中，随之“反哺”到网络中的每个节点，以更好为用户提供更优质的内容。从某种程度来说，BitClout让小型内容发布者可以将内容发布到一个公共内容池而不用担心失去交互权。因此，我们可以实现从数据被严重保护私有化的世界向公开访问和开发的公平世界的转化。

* 重要的是，这极大激励了内容发布者为这个区块链贡献数据，从而吸引到最顶级的内容创作者。毕竟，毋庸质疑，用户发布数据，相比封闭平台，一个利用区块链，在全节点即时同步内容的发布平台有无法比拟的吸引力。

我们认为，相较与现有平台，上述的所有都可以使得创作者可以前所未有地直接与其粉丝建立联系。这种关系不再&#x662F;**“**&#x786C;币的两面： **“**&#x4E00;&#x9762;**“**&#x8054;&#x7CFB;**”**，另一面&#x662F;**“**&#x83B7;&#x5229;**”**。

创作者代币已经改变了内容创作者获利的游戏方式，这还仅仅是开始。因为**BitClout**是一个基于变现的开源协议，使得在世界上的任何人都可以开始进行探索并实践新的变现方法。比如：假设某个创作“大V“想开始通过用户每月订阅方式提供优质内容而变现，他只需在互联网上建立这个功能，整个BitClout的用户群就可以立即访问相关内容。这种模式也可以适用于收件箱管理，在此，创作者可以通过转发帖子和回复粉丝信息而获得相应报酬。 与此同时，此模式也适用于其他方面，比如检测有害内容和清除垃圾信件，那么这样全世界最好的机器学习研究员就可以在无需请求许可的条件下，通过BitClout 随时随地访问完整数据，并且在BitClout上搭建相应解决方案。 从根本上说，Bitcout不是一家公司，是一个全世界可以合作创作内容的协议。我们相信最终这也会激励创造者们释放出真正的潜力，促进整个社交媒体的竞争和创新。

另外，由于BitClout变现核心属性，这有利于更有效地来进行内容排序和评级和排序。 举例来说，BitClout开发者的第一个尝试，就是根据评论者的代币价值，对评论进行评级排序。令人惊讶的是，这种简单的机制已经取得了比中心化平台更有竞争力的成果。对于网红博主来说，这种BitClout独有的币价信息评级模式将有效减少垃圾信息。这还只是个开始，相象一下，当整个世界都开始在**BitClout**平台上贡献和分享内容之后，还能有什么样新&#x7684;**”Clout**信&#x53F7;**“**。

最后，我们认为值得一提的&#x662F;**,BitClout**从第一天开始就是基于在长远发展下也能保证去中心化并实现其激励方式而设计的，有相比中心化的平台，更强的创作者奖励机制。并且因为所有数据都在公共区块链上， 节点运行者拥有所有的数据归属权，开发者永远不用担心失去对其数据和API的访问权限。 对比传统媒体公司，他们最初快速发展，建立网络效应，然而在成功后却建立数据护城河阻止了他人访问。此外，若有保留公司和CEO模式，就不是真正意义上的去中心化，这也就是为什么BitClout原始开发团队保持匿名的原因。我们不希望影响您的判断，我们希望您作为社区成员而决定平台发展方向。BitClout没有考虑股东利益高于社区利益的公司主体，只有社区—并且每个人都是因为持有BitClout和创作者代币而团结一致。

在每个人的帮助下，我们希望将**BitClout**区块链打造成一个长远的促进人类发展的积极力量,并且将竞争和创新带回互联网。 互联网最初本质上是去中心化的，但是我们正处在一个高度集中的时代，创新比以往更加艰难。经过多年的思考，我们坚信钟摆会再次甚至永远向去中心化回归，而我们现在都有机会参与其中。全世界可以通力创造新一代的应用去释放人类创造的全部潜力。

@diamondhands


