Author

Topic: [ANN] Making programing on UTXO model easier with "Animagus" (Read 130 times)

newbie
Activity: 4
Merit: 0
Quote
This is part one in a series that will introduce and explain Animagus, the problem it aims to solve, and how you can make the best use of it.
We believe that Nervos Common Knowledge Base (CKB) has unmatched potential among modern generation blockchains. Currently, specially built tools are required to tap into CKB’s full potential. Animagus is such a tool.
The name “animagus” comes from the Harry Potter series. A witch or wizard is called an “animagus” if she/he can transform into an animal and back again. Depending on the specific witch or wizard, the animal they can transform into also differs. I personally believe the name “animagus” fits well with the scope of this project — hopefully you are with me after reading this series.

Seriously, what is Animagus?

Historically there have been many ways to describe what Animagus does. Some would say it’s a dApp framework, some might say it’s a layer atop CKB, but the description I like these days is “an account layer for CKB.”
While most trending blockchains these days use an account model, CKB uses a UTXO-like model which is inherited from Bitcoin. While the UTXO model certainly has a lot of advantages, there is one signficant drawback: it is harder to program when compared to the account model.
This is where Animagus comes into play. As we will see in this post, and with future posts, Animagus provides a solution to most — if not all — of the programming hurdles one encounters in the UTXO model. We are hoping Animagus can fill in the gaps of the UTXO programming model, and enables the realization of the full benefits of CKB.
On the technical side, Animagus can be viewed as an AST runner:
A developer designs the functionality they want into an AST, or Abstract Syntax Tree. (If this AST thing sounds strange to you, please bear with me for a second. For now, you can just assume it is a short program)
The AST will be expressed in the Protocol Buffers format, so Animagus remains language agnostic
When booting, Animagus loads the AST. Based on the definition of the AST, Animagus can provide different behaviors:
It can read CKB state and index certain cells matching predefined conditions, such as all Nervos DAO deposit cells
It can provide RPCs that a developer can call from other services for certain results, such as fetching the balance of an account or assembling a transfer transaction
It can generate validator smart contracts used on chain from AST definitions



Read more on Medium: https://medium.com/nervosnetwork/https-medium-com-nervosnetwork-animagus-part-1-introduction-66fa8ce27ccd-cfb361a7d883
Jump to: