June 2, 2021
Sensible Contract Interview by Joshua #
Sensible Contract #
- CoinGeek Interview Link: Token protocols on BSV: Sensible Contract
1. What can the Sensible Contract protocol provide that no other token protocol can? #
Please let me clarify that Sensible Contract is not a token solution which competes which other ones (one use case of it does). It’s a contract model which provides on-chain back-tracing and collaborating for existing bitcoin scripts. By enabling these capabilities we can implement a handy token/NFT system like
BCP02 without any hassle. In
BCP03 you can also find out how Sensible Contract simplifies the creation of an ordinary on-chain swap by formulating a collaborative global state in a graceful way.
Sensible Contract is not here to compete and try to outperform a given token system since day one. On the contrary, it could be used to make the given token system simpler and easier to write and maintain, if that system is written in sCrypt. It helps you on two aspects, specifically.
- First, by hiding details of cumbersome legitimacy backwards tracing and validating, it helps you to focus on your business logic with your tokens or other assets you defined without worrying forged inputs from unknown parties.
- Second, by providing a collaboration mechanism, you are able to access more business-relevant data fields which are not available in the current ordinary transaction context.
The collaboration feature opens a new and very expansive territory to explore. Contract communication could be quite useful to implement automated multi-phases function for non-trivial business logic. The collaboration mechanism consists of three levels:
- multiple inputs identifying each other within the same transaction (which is elaborated in whitepaper);
- multiple modules in the same locking script; (this works in a “function dynamic folding/unfolding feature” enabled context, using state-jumping to minimize the runtime script size dynamically by folding those functions not being used and unfolding them as needed)
- by propagating specific fields of the data segment inside the locking script body, a contract can collaborate asynchronously with another contract not in the same context.
As you may see, this provides many flexibilities from different dimensions which benefits a much larger spectrum of applications, and it goes far beyond the whitepaper which contains only the first level at that time. We are in a very active development cycle in this no-man’s territory to improve both the contract model itself and the applications it incubates.
2. The Sensible Whitepaper did a great job highlighting how all token protocols face the backwards tracing (aka Back to Genesis) problem - why it is so important token protocols to mitigate this? #
Before talking about the tracing problem, I would say the said layer-2 solutions (by using an op-return based solution like Omni-layer used by USDT and using external service to validate transactions) shouldn’t have this issue at all in the first place because you can always ensure the legitimacy by improving the external off-chain service. But, by using that, you probably don’t need the bitcoin programmability at all, and it’s not “programmable money” anymore, it literally says “let’s create a markup system on cash and enforce the rules by interpreting the markups together”)
By utilizing bitcoin script to ensure the on-chain legitimacy for your assets, backwards tracing is inherently an unavoidable issue if you want to solve the problem inside the boundary of bitcoin virtual machine. Because the value of satoshis comes from the node software. The system itself ensures that satoshi is such a thing that is not creatable, duplicatable, deletable, etc. But all script-created resources don’t share that “first-class privilege”, there are thousands ways of hacks to break into a token system by creating a not-easily-recognizable forged input, if you cannot trace backwards to its genesis in a very fast and effective way.
Frankly speaking, backwards-tracing patches the largest hole but not all of them. The programmer still needs to be careful not writing bad code to accidentally ruin the asset in an unexpected way in their code. This (the assets could be broken if the contract contains overlooked mistakes) is the same case in Etherum’s solidity. However, in modern environments like Cadence in Flow, this is a solved problem by utilizing the ‘resource-oriented’ paradigm. Assets created in those environments are well-defined “first class citizens” like the value of satoshis mentioned above and are impossible to be accidentally duplicated or deleted.
The details of backwards tracing could be found in this presentation (linked below):
Here you’ll find the pdf and the full content in Chinese (sorry but it could be auto-translated).
3. Are the advocates for Sensible Contract still asking for a protocol change to solve the backwards tracing issue? Do you think the backwards tracing issue can be solved without a protocol change? #
After we knew the attitude of nChain we don’t call for node upgrading anymore as soon as we knew, because we want to put our efforts into building prototypes and products more effectively, not arguing and advocating repeatedly to be “accepted”. The most important thing is whether it helps the development of applications, with or without the so-called “protocol change” (which technically isn’t).
Sensible Contract works well with 100% features it promised without upgrading PreImage. The next version of the whitepaper would be revised heavily with much more valuable pieces being added, and the ‘PreImage upgrading’ being moved into the footnote area of the implementation section to avoid unnecessary arguing.
(Do you think the backwards tracing issue can be solved without a protocol change?) It could be in the future.
People are still walking into this actively and it’s too early to say it’s a dead-end.
4. Why is it a requirement to increase the Bitcoin script size of transactions to enable applications like TokenSwap to be able to launch? #
We want a bigger size limit for a single locking script so that we don’t have to selectively remove a lot of business code and functions to punch it through the 10KB gate. Just like we simply want bigger blocks than 1MB to have more transactions. It’s that simple.
We worked with TAAL and had 500KB running these months. It works well so we think it’s probably a good proposal candidate to ask node software maintainer to lift the limit to 500KB so that other miners can also mine these transactions in their blocks and we could get a generally shortened average confirmation time. But the issue was closed because someone thought we were “Brigading” the project (maybe it’s because some thumb-up emojis are from non-dev people). And we are redirected to miners (which we have already worked with). The reason they choose was they don’t change these parameters unless the requirement comes from miners (because miners are their customers) It’s quite interesting to me that when changing things they want, they can do it without consulting any miner (hundreds of changes from Genesis 1.0.0 to 1.0.8); when requirements are something they don’t want, they refuse easily by saying “no way. now go and talk to miners”.
However, the size issue can be optimized, both on the toolchain side and application side. We are in an era that both toolchains and application contract code are not matured yet. In earlier days of Visual Studio, developer complained heavily about the executable size generated by Visual C++ on Windows platform using earlier versions of Visual Studio: “Why is an one-liner ‘hello-world’ program generates such a huge executable (a 2~5MB .exe file)?” Microsoft listened to them and optimized their compilers in later iterations. Just now I created a new project in Visual Studio 2017 3 minutes ago and made an experiment. The .exe size result is 47KB in Debug and 10KB in Release (both of them use default optimization options) It’s 10-100x smaller. If you look at the generated bitcoin script of sCrypt output, you will realize that the same thing would/should happen. Xiaohui also confirmed that it has plenty of room to optimize toward a much more compact compilation but it’s generally low-prioritized because the scripted transaction is still uncommon nowadays. So we’ll work together to have a generally smaller locking script to make scripted transactions more compact in future iterations.
5. What are you most excited to see be built atop Sensible Contract? #
SatoPlay NFTex (NFT exchange), SensibleSwap (previously known as TokenSwap), SensibleScan (Asset Browser like Etherscan). We don’t see them being built, we put ourselves into building them with their developers. These are the three projects closed to launch, and we know there are more projects in development.
We are actively testing against the interoperability that the assets and tokens can be transferred across these products smoothly. This will be the most exciting features in the very near future.
6. Sensible is relatively lesser known within the BSV space due to its recent release and origination in the Chinese market. How do you plan to gain more overall adoption of the protocol? #
We generally don’t do too much to gain the attention because we have limited time and resource. We have to put them into the most critical parts of our research and engineering to push things forward, to try and fail quickly, to experiment with many possibilities so that we have generally more progress in a given timeframe. People who know well-enough about bitcoin script will find us somehow and they are generally willing to have great conversations with us. That would be much more productive for both of our time.
Token protocols #
7. Can you give your thoughts on the ‘Layer’ labels for Tokens? (ex. STAS as L0, sCrypt as L1 and Tokenized as L2) #
We heard different “layering” approaches. I don’t plan to compare them in detail like I did using a diagram from L2 to L1 in earlier talks in Feburary. Because no matter how the token system is implemented, it’s ok. Each of them deserves a chance to be used by others. It’s whether the system is continuously widely used that matters. It’s not about whether your design is clean and elegant, it’s about whether you are going to put far more dirty work into it in the future, to have more and more projects believing that your solution is a strong cornerstone that is reliable and stable and will be well maintained and iterated in the foreseeable future.
8. What are your thoughts on using satoshis for tokens? #
By doing this, satoshis are “sliced/staked/burnt” into tokens which could be recovered as needed (or not). It’s viable, but very hard (if not impossible) to do rich contracted financing features that could generally be found on other chains. So yes probably in some use cases that would be good enough to have a simple sat-based token.
9. Do you think multiple Token protocols atop BSV can exist? #
- If so, why?
- How is that different than claiming multiple crypto currencies can co-exist?
Frankly I don’t know. I don’t generally over-simplify things, especially when it comes to such a globally evolving complex system. It could take much longer time than most bitcoiner think to have “one chain to rule them all”.
Engineers introduce various concepts and methods to deal with different situations and make different trade-offs among many aspects, using different token protocols (or maybe even combined in some cases) to form different solutions, just like they use different programming languages, frameworks, libraries to express their idea effectively. Ignore the complexity and the diversity and force people to unify ‘something’ may not be a good idea.
I’d rather encourage a more inclusive atmosphere that enables people to express their ideas and show their talents without worrying that being isolated.
10. How can BSV out-compete Ethereum? #
This is a huge question and I haven’t been prepared to answer it yet. Generally, BSV has potential to contain much more transactions in orders of magnitude than ETH. But can all applications running on EVM be migrated to run well enough on bitcoin VM? That’s not clear and obvious. Solidity and the account and event model surely isn’t sophisticated well enough but they do bring value that cannot be easily replaced by utxo-based contracted applications. However, we know too little about bitcoin and we are still learning, I hope I can be more confident next time I’m asked this question.
11. How can BSV profit from cooperating with ETH and DeFi? #
ETH/Defi gives us excellent use-cases to explore what we can do with Sensible Contract. We’ll do more research and gain more experiences by analyzing what happens in these projects (what went right and what went wrong) After we built a prototype on BSV which runs a similar business logic, we can use ETH as a benchmark for our apps. How the fee compares, how transaction throughput compares, etc. That generally saves a lot of time.
12. What impact do you think the LAW narrative has had on BSV with respect to tokenization? #
The political correctness answer to this is “code is code” and “law is law”. But using blockchain itself to perform automatic and immediate validation doesn’t disable “the law” from functioning. You can still use “the law” to defend yourself when it’s needed, just like any scenario you’ll meet in life. By using contract correctly and wisely, you lose nothing (in aspect of “the law”) but gain automated validated transaction efficiently. That’s why we use bitcoin script in the first place.
If you are referring to using op-return to mimic a ledger, and using an authority or external validators or such (and rely on “the law” to catch them), you are probably have a significant higher cost than your opponent, who use the automated contracted method approach.
Yes, you can fall back to the traditional ways of doing things and keep telling people that “the law” would help. But the point is, “the law” would/should always help, regardless of how you do your business. If the law helps anyway, why not choose the cost-effective method using contracted model automated get executed and validated on-chain?
Having that said, I think it’s worth to mention that a well-formed KYC and AML process is very valuable to people who want to build their business on BSV seriously. We are also very active working in this area.
13. If you could wave a magic wand and change something about the BSV culture or business environment, what would it be? #
I’ve been a veteran in game industry for 15 years. I learnt that the culture and the environment of a given sector consists of many aspects which affect each other in a very complicated way which worth respecting. It’s wise to adapt yourself to it in different ways and see if you can contribute in an effective manner or not.
Additionally, I tend to think in such a way that utilizing the attributes that BSV can afford uniquely to build something good for my purpose, not build something that the BSV ecosystem ‘consider’/ ‘accept’ that it’s worth doing. I force myself to always think from such an “external view angle” to the community. Because the world doen’t/shouldn’t ‘carefully’ help BSV to grow and succeed. On the contrary, BSV should survive and provide value to other industries (which in my case, the game industry) to legitimate its existence.
Thanks for reading this.
I’ve attached a Sensible Contract ecosystem diagram here for your reference below.