Charting the Soulweb: SBT Graph Concept & Examples

This is an educational piece and and a report on the results of my early experiments with Soulbound Token (SBT) concept and its applications for Decentralized Society.

Reading the paper by Vitalik Buterin, E. Glen Weyl and Puja Ohlhaver got me thinking what the primitives for the early DeSoc could look like. I took some examples as inspiration and visualized them on a SBT constellations graph.

This is followed by a couple of lightweight smart-contract interface and implementation examples for demo purposes.

🐣 This article is also available as a Twitter thread — let me know your thoughts there.

Soulboundness

First, let's define terms and symbols.

The first two on the picture are well-explained in the original paper:

“a person might have a Soul that stores SBTs representing educational credentials, employment history, or hashes of their writings or works of art”.

The last type is introduced by me to make a distinction between individuals and entities such as protocols, DAOs, decentralized authorities etc.

We'll see how both sides of the relationship depend on each other to develop credibility, establish provenance and much more.

The Soulgraph

Now to the Soulweb itself!

You might've heard already that the 'selling' feature of SBTs is non-transferability. There's a good summary from @pastry on why this matters.

But there's something that makes me even more bullish — Graph Theory 🕸️.

Graphs are amazing because of their scalability and our ability to solve so many problems with them. For example, to deliver this article, The Internet Protocol calculated the fastest way to send electrical signals through thousands of routers on the global graph to your device.

Social Graphs is an important subset that most social networks rely on.

The biggest web2 social network we all know is a massive social graph. @LensProtocol is a recent example of a decentralized social graph architecture.

So what's the big deal for Soulbound Tokens?

Directed Graph — a set of vertices connected by directed edges — is an optimal way to map social relationships in a way that's efficiently stored and traversable.

The left side of the picture above shows an array of records in the following format:

{ FROM, TO, SBT }

which is the minimal sufficient information for anyone to restore the graph structure shown on the right side of the picture.

Now let's say you want to do a smart token airdrop. How does this graph help you?

Enter Weighted Directed Graphs.

If you trust some specific issuers and know their SBTs are legitimate, you can assign or calculate your own score for every kind of SBT based on what matters for your airdrop.

You can then calculate the total score for each vertex.

The example above is very simple and assumes calculation based on the nearest neighbours only, which may (and will) not be the case in a complex social network — SBTs will spawn SBTs spawning SBTs, etc.

Fortunately graph theory arms us with all sorts of search algorithms for that.

The DeSoc

With the tools for social graph traversal and payload extraction we've just selected, now let's imagine how Decentralized Society (DeSoc) could look like.

The graph above is the example of multiple intersecting soulbound constellations.

While there are noticeable clusters of SBTs issued between neighbouring topics and relationships, the whole society benefits from the wealth and depth of intelligible data from every corner.

This turns reputation and trust into a resource that is both:

  • Easier to 'mine', since the network in DeSoc is built on peer attestations VS centralized gatekeepers;
  • Easier to lose, especially compared to the trustless environment promoted and utilized by DeFi.

As the original paper puts it,

DeSoc empowers the vision of J. C. R. Licklider — founder of ARPANET — of an “intergalactic computer network” with increased social dynamism built on trust, and lets souls "encode their own relationships and co-create plural property".

Of course, such as powerful technology opens possibilities for dystopian use cases.

Even if we split our 'souls' into many contexts to isolate identities, the existence of algorithms that know how to connect the dots on the graph and target you is only a matter of time. Fortunately, as with blockchain, we have plenty of well-researched privacy preservation techniques, from off-chain data encryption to the rapidly emerging zero-knowledge (ZK) proofs.

The diagram is from the original paper
The diagram is from the original paper

ZK-proofs fit SBTs especially nicely because they let you provide the society with the answers it needs while keeping any targetable info about yourself off-graph. For example, an SBT proving that you repaid a loan with the amount of at least 5 ETH in the past without revealing the exact amount or creditor.

I'm not going to focus on ZK here, although my code below features a short example of where it would be used in an SBT use case. If you want to learn about ZK-proofs in depth, I like how @pseudotheos explains them.

The Standard & Implementation

⚠️ This is getting a bit more technical, feel free to skip the code!

⚠️ Also, I use screenshots instead of code snippets in this article for a reason. Please follow the link below to the repository with the complete code examples.

While thinking about the graph re-calculation, I played with contract interfaces and implementation ideas, and figured I'd share what I have.

My toy version of the standard begins with the interface describing a generic non-transferable token that:

  • Can be issued from Issuer to Holder;
  • Can be revoked by Issuer;
  • Has a set of 32-byte attributes addressable by 8-bit keys.

🚩

Let me put a disclaimer right here and say that I consider this version suboptimal, unsafe and very much work-in-progress. I spent exactly one day drafting it, plan to keep working on it, and discourage anyone looking to take and use it as is in production.

🚩

The implementation can restrict SBT attributes mutation to the Issuer only or use a whitelist-like access. Arguably some SBTs should have immutable attributes set during the issuance as atomic transaction.

Anyway, note the 'Issue', 'Revoke' and 'SetAttribute' events emitted.

The events is what helps an indexing layer such as @graphprotocol (the name is a fun coincidence BTW) 'write down' the info that can be used by off-chain algorithms to traverse DeSoc graph and calculate whatever they need for any possible purpose.

Now having the general implementation, let's create an actual $LOAN token that can be issued by a creditor to a borrower and feature attributes such as the loan amount and interest rate.

And to balance the history out upon the loan repayment, another token — $PAID — would be issued to the soul.

We could keep old loan token, burn it or flip an 'isPaid' bool.. In this example we revoke the $LOAN from holder but keep its attributes in the contract for history.

It will be up to the SBT developers to decide how much or how little of the data to keep on-chain. The generalized solution works as both 'in-place' value storage and a foreign key storage.

Finally, an example of an on-chain entity — Credit Union — that a borrower can call and be given the SBTs throughout the loan lifecycle.

Zero Knowledge

I mentioned previously that SBTs can retain privacy by hosting zero-knowledge proofs.

The $ZKLOAN and $ZKPAID soulbound tokens in such a case would feature attributes that satisfy the requirements of any specific actor in the society but maintain the holder's privacy.

Zero-knowledge proofs is something I’d love to learn and experiment with more in the near future, so hopefully I can show you more soon!

And that's it for the example. I plan to work more on the primitives and use cases for the various SBT scenarios, and then generalize things gradually into something that would be worth a standard.

Conclusion

Soulbound tokens are about to make a splash, and many feel the vibes similar to what the early NFT research frontier was years ago. However, this time it’s the very fabric of the society we’re dealing with. The beauty of the simple concepts mentioned in this article may turn into a powerful decentralized civilization growth engine, or be used as an instrument for discrimination, corruption, personal targeting and other dystopian use cases.

It is an exciting challenge to build the ecosystem step by step and bootstrap a technological layer of the society that will make it better.

Thank you for reading this article! It is also available as a Twitter thread — let me know your thoughts there.

I am learning, exploring and building things non-stop. Follow me on Twitter and join me on this web3 journey along with other passionate researchers and creators.

Collect & Donate to Public Goods

This article is collectable as NFT! 100% of proceeds go straight to Gitcoin Grants Matching Pool Fund on Optimism. Click Collect to grab a piece of an early token standard history and support Public Goods in a single transaction!

The original paper that inspired my research and experiments.

The code repository with the examples.

Wiki articles with basic knowledge relevant to the graph theory mentioned.

Subscribe to 0xNSHuman
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.