{"id":13430173,"url":"https://github.com/taoheorg/taohe","last_synced_at":"2025-03-16T05:30:34.591Z","repository":{"id":118638837,"uuid":"351897679","full_name":"taoheorg/taohe","owner":"taoheorg","description":"Move smart contracts implementing nestable resources on MoveVM blockchains","archived":false,"fork":false,"pushed_at":"2022-08-18T17:07:00.000Z","size":463,"stargazers_count":18,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-27T08:38:53.615Z","etag":null,"topics":["diem","diem-blockchain","diem-modules","diem-tokens","dove","move","move-modules","movevm","taos"],"latest_commit_sha":null,"homepage":"https://www.taohe.org","language":"Move","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taoheorg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-03-26T19:58:44.000Z","updated_at":"2023-11-07T06:09:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"e563e276-a977-4dd0-a10c-a891fab2613c","html_url":"https://github.com/taoheorg/taohe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoheorg%2Ftaohe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoheorg%2Ftaohe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoheorg%2Ftaohe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taoheorg%2Ftaohe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taoheorg","download_url":"https://codeload.github.com/taoheorg/taohe/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830912,"owners_count":20354848,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diem","diem-blockchain","diem-modules","diem-tokens","dove","move","move-modules","movevm","taos"],"created_at":"2024-07-31T02:00:50.793Z","updated_at":"2025-03-16T05:30:34.215Z","avatar_url":"https://github.com/taoheorg.png","language":"Move","funding_links":[],"categories":["Code","Testnet"],"sub_categories":["Libraries"],"readme":"# ▣ TaoHe: Collection of nestable Move resources\n[![Mentioned in Awesome Move](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/MystenLabs/awesome-move#libraries) ![GitHub](https://img.shields.io/github/license/taoheorg/taohe) [![Movey](https://img.shields.io/badge/Movey-TaoHe-001f60)](https://www.movey.net/packages/TaoHe)\n\nTaoHe is a collection of nestable smart contract resources that can be used to create secure on-chain applications on various [Move-powered blockchains](https://github.com/MystenLabs/awesome-move#move-powered-blockchains). Resources can be nested like a Russian doll ([матрёшка](https://en.wikipedia.org/wiki/Matryoshka_doll)), or Chinese boxes ([套盒](https://en.wikipedia.org/wiki/Chinese_boxes)), the namesake of this project. ▣ is used as the logo, since it depicts a box inside another box.\n\n*Tao* is a simple Move resource that has been designed to be nested inside other taos. *TaoHe* is a collection of taos, and a special Root resource that can be used to store a resource directly into an account (taos themselves can be stored into resources only, for simplicity).\n\nTaoHe follows the [Nestable Resources](http://www.move-patterns.com/nestable-resources.html) software design pattern.\n\n\u003e **Example**: Tokens can be placed into a time locked resource ([Timelock](sources/Timelock.move)), which in turn can be placed into a resource which can be used only by a certain user ([Ownable](sources/Ownable.move)), effectively creating a timelocked non-fungible token.\n\n[See TaoHe on Movey](https://www.movey.net/packages/TaoHe), the package metadata repository for Move. Archived version of the original announcement can be found [here](https://web.archive.org/web/20211130211800/https://community.diem.com/t/introducing-taohe-collection-of-nestable-move-resources/3531).\n\n## Design\n### What taos are\nTaos are meant to form disposable structures that contain a meaningful resource (such as tokens). In order to access the resource in question, taos must be dismantled. A new tao can be created though, if so desired. Nesting taos inside each other can form complicated logics, such as timelocked non-fungible tokens.\n\n### Why taos are small\nKeeping code footprint per each tao in minimum is vital for safer code, and is simpler to audit. Keeping taos simple also shifts the code footprint to scripts, which are easier to develop and update than smart contracts.\n\n### Tao lifespan\nTao's lifespan is divided into three separate phases, listed here chronologically:\n * **Wrap**: Tao is created by placing a resource into the tao, and initializing it with the constructor's arguments.\n * **Wrapped**: In the current design taos are static, with support of immutable references to the resource(s) inside.\n * **Unwrap**: When conditions are satisfied (such as passed time), the resource inside the tao is given away, and the tao is destroyed.\n\n### What taos are not\nTaos are not meant to replace specialized smart contract development for complicated applications, but can be used as part of one.\n\n## Building and developing\nTaoHe is developed with [Microsoft's Visual Studio Code](https://code.visualstudio.com/) and the [`move-analyzer` plugin](https://marketplace.visualstudio.com/items?itemName=move.move-analyzer).\n\nWe use **[Move CLI](https://github.com/move-language/move/tree/b53bb030b556a4e6ac2728d50ec7baaddf0b9a56#quickstart)** (HEAD: `b53bb03`) for building, package management, dependencies, formal verification and testing. After building the Docker image, you can just issue:\n```\nalias move=\"docker run -v \\`pwd\\`:/project move/cli\"\n```\non your POSIX system to get the `move` command.\n\n\u003e **Jumpstart**: `move sandbox publish \u0026\u0026 move sandbox run -v scripts/folder.move --signers 0xA` (replace `folder` with any function residing in [scripts/](scripts/))\n\n### Selecting blockchain\nTaoHe is designed to support every Move powered blockchain. This is achieved by *Connectors*, which is a thin middleware between TaoHe and the desired target blockchain. At the moment only the [Dummy Connector](https://github.com/taoheorg/connector-dummy) is available for easier testing and development, but you can search GitHub for other [Move Connectors](https://github.com/topics/move-connector).\n\nTo change the connector, replace the `Connector` dependency with your desired connector in your `Move.toml`.\n\n### Formal verification\nEvery tao has formal verification specs embedded. You can run the formal verification by running:\n```\nmove prove\n```\n\n\u003e Learn more about installing the formal verification tools and dependencies [here](https://github.com/move-language/move/blob/main/language/move-prover/doc/user/install.md).\n\n\u003e **Warning**: Although every tao has formal verification specs, `move-prover` is still under development, and might have some limitations. Please see each source file for more information.\n\n### Using TaoHe for your projects\nYou can also add TaoHe as a dependency for your Move project by adding these lines to your project's `Move.toml`:\n\n```\n[dependencies.TaoHe]\ngit = \"https://github.com/taoheorg/taohe\"\naddr_subst = { \"TaoHe\" = \"0x2f66c09143acc52a85fec529a4e20c85\" }\nrev=\"....\"\n```\n\n\u003e **Warning**: Due to signed commits, commit hash should be used since it cannot be spoofed. After you know which TaoHe version you want to use, replace `rev` with your desired commit hash.\n\n## Known problems\n### Poor developer experience\nWrapping and unwrapping scripts for complicated taos can get long and confusing, hindering the DX. Therefore a rudimentary generator has been developed. You can call the generator with test input by issuing `./generator.js generator_test.json` ([Node.js](http://nvm.sh) required).\n\n## Documentation\nSee [doc/](doc/) for `move docgen` generated documentation.\n\n## License\nThis repository is released under the *Apache License 2.0*, and is copyrighted to *Solarius Intellectual Properties Ky* (Forssa, Finland, EU). See `Move.toml` for more information on dependencies. No warranty or fitness for a particular purpose provided, as stipulated in [the License](https://github.com/taoheorg/taohe/blob/main/LICENSE#L143).\n\n## Trusted source\nSmart contracts are mission critical and as such should always originate from trusted sources. That's why every commit on `main` is signed with [Ville's GPG key](https://keys.openpgp.org/search?q=0x49065E1275E46F96). Upstream repository is [here](https://github.com/taoheorg/taohe/) and the official webpage is at [www.taohe.org](https://www.taohe.org).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaoheorg%2Ftaohe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaoheorg%2Ftaohe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaoheorg%2Ftaohe/lists"}