CYNIC

Posted on Jul 11, 2023Read on Mirror.xyz

从灵魂绑定中求解放——浅谈Soulbound Token(SBT)

Soulbound token (SBT)是永久绑定至一个特定用户或账号,无法转移或交易给其他用户的一类数字代币。

什么是Soulbound?

Vitalik提出Soulbound,是借用了魔兽世界(World of Warcraft)中soulbound物体的概念。对于soulbound物体,一旦获取,就无法转让或者出售给其他人,也就是与你灵魂绑定了。

对游戏而言,该设计显然降低了部分氪金玩家的体验,提升了游戏的公平性和挑战性。当然氪金玩家仍然有其他方式获取神装,比如聘请团队代打由自己出最后一击,不过总的来说该机制让游戏变得更平等了。(插句题外话,把本可以由游戏团队赚的钱丢掉,反而让高技术玩家来赚这笔钱,现在的抽卡类游戏看了都要落泪。可能那真的是一个理想主义的时代。)

我们知道当前头部的NFT项目,基本属于meme类或者奢侈品性质 (如果不是庞氏的话)是为了社交,为了向他人炫耀,例如BAYC、AZUKI、CryptoPunks。就算如BAYC开发了挖矿模式,也是爆火之后的事了。如果这些NFT都是soulbound,恐怕很难炒作出几十ETH的天价。(当然,对这些已声明在外的项目方而言,即使NFT变成soulbound类型,也可以通过收取Mint Fee来获取高额收益,但是显然soulbound的NFT已不具备任何流动性了。)

不破不立,不塞不流,不止不行。我就是要革你小图片的命!Soulbound Token会终结NFT投机市场的狂热,同时也会为NFT带来真正的应用价值。

Soulbound有什么价值?

有些事情,我们认为是与该用户绑定的,不应该转移。例如KYC、学习记录、技能认证等。有了soulbound token,我们才能真正意义上建立一套数字身份体系,而不是应该所有事情都是价高者得。市场经济固然是好的,但是恐怕也不能将所有事情都交由市场解决。

例如治理权,如果都像$UNI一样随意公开买卖(当然现阶段的项目方为了变现落袋为安全,治理代币大多是这种模式,写$UNI只是因为前段时间看到Uniswap关于上BSC的提案被两大机构控制的事情),那么最终就是资本决定一切。连股市都有AB股制度,这么简单粗暴的“钱说了算”可能并不能代表社区的最大利益。

当然,soulbound当前的价值还在特定场景,广泛的天地等待大家探索。首先关于治理权,即使soulbound了,资方仍然可以通过收买用户来操控投票。即使是最合适的应用场景POAP,也同样因为某些原因(用户迁移钱包、有些POAP具备经济收益)没有将POAP设置为soulbound,而是让用户自己去选择。

如何实现Soulbound?

实际而言很简单,所谓soulbound就是non-transferable 不可转移,只需要在合约中禁止掉转移的行为即可。对于具体的代码实现,soulbound token同样是实现ERC721接口,那么就一定会有tranferFrom()和safeTranferFrom()方法,我们只需要在_beforeTokenTransfer()中禁止非mint的行为(from地址为address(0))即可。

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

 import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol"; 

 contract Soulbound is ERC721, ERC721URIStorage, Ownable {
    using Counters for Counters.Counter;

     Counters.Counter private _tokenIdCounter;

     constructor() ERC721("SoulBound", "SBT") {}
    function _beforeTokenTransfer(address from, address to, uint256 tokenId, uint256 batchSize)
        internal
        override(ERC721)
    {
        require(from == address(0), "Token not transferable");
        super._beforeTokenTransfer(from, to, tokenId, batchSize);
    }

     function safeMint(address to) public onlyOwner {
        uint256 tokenId = _tokenIdCounter.current();
        _tokenIdCounter.increment();
        _safeMint(to, tokenId);
    }

     // The following functions are overrides required by Solidity.

     function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) {
        super._burn(tokenId);
    }

     function tokenURI(uint256 tokenId)
        public
        view
        override(ERC721, ERC721URIStorage)
        returns (string memory)
    {
        return super.tokenURI(tokenId);
    }
}

总结

引用Vitalik的一段话吧:

A common criticism of the “web3” space as it exists today is how money-oriented everything is. People celebrate the ownership, and outright waste, of large amounts of wealth, and this limits the appeal and the long-term sustainability of the culture that emerges around these items. There are of course important benefits that even financialized NFTs can provide, such as funding artists and charities that would otherwise go unrecognized. However, there are limits to that approach, and a lot of underexplored opportunity in trying to go beyond financialization. Making more items in the crypto space “soulbound” can be one path toward an alternative, where NFTs can represent much more of who you are and not just what you can afford.

However, there are technical challenges to doing this, and an uneasy “interface” between the desire to limit or prevent transfers and a blockchain ecosystem where so far all of the standards are designed around maximum transferability. Attaching items to “identity objects” that users are either unable (as with proof-of-humanity profiles) or unwilling (as with ENS names) to trade away seems like the most promising path, but challenges remain in making this easy-to-use, private and secure. We need more effort on thinking through and solving these challenges. If we can, this opens a much wider door to blockchains being at the center of ecosystems that are collaborative and fun, and not just about money.

个人而言:

Soulbound为物欲横流的web3世界提供了一个新的选项,少一些现实主义的逐利,多一些理想主义的建设。尽管当前soulbound还存在不少挑战,但是希望大家能够共同解决难题,打开区块链新的应用场景。

参考文献:

https://www.quicknode.com/guides/ethereum-development/how-to-create-a-soulbound-token