{"id":13631866,"url":"https://github.com/baking-bad/tezos-on-tezos","last_synced_at":"2026-01-18T01:57:17.858Z","repository":{"id":65861051,"uuid":"570901255","full_name":"baking-bad/tezos-on-tezos","owner":"baking-bad","description":"Michelson VM and Tezos OS in Rust","archived":false,"fork":false,"pushed_at":"2023-09-26T14:25:07.000Z","size":6328,"stargazers_count":25,"open_issues_count":6,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-01T22:50:37.731Z","etag":null,"topics":["appchain","blockchain","michelson-vm","modular","optimistic-rollup","rollup","tezos","wasm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baking-bad.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":"2022-11-26T13:56:55.000Z","updated_at":"2023-12-22T12:51:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"daf09e62-3aa6-4ade-a1ed-44631890221a","html_url":"https://github.com/baking-bad/tezos-on-tezos","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/baking-bad%2Ftezos-on-tezos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftezos-on-tezos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftezos-on-tezos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baking-bad%2Ftezos-on-tezos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baking-bad","download_url":"https://codeload.github.com/baking-bad/tezos-on-tezos/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223768665,"owners_count":17199359,"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":["appchain","blockchain","michelson-vm","modular","optimistic-rollup","rollup","tezos","wasm"],"created_at":"2024-08-01T22:02:41.563Z","updated_at":"2026-01-18T01:57:17.799Z","avatar_url":"https://github.com/baking-bad.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Tezos on Tezos\n\nOptimistic rollup enabled with Tezos VM running on top of Tezos L1.\n\n**IMPORTANT: NOT STABLE YET, DO NOT RUN THIS CODE IN PRODUCTION**\n\n## About\n\nThe goal of this project is to create permissioned application-specific Tezos-compatible rollup that has:\n* Reduced operational costs (contract automation, oracles)\n* Custom MEV-resistant solution\n* Chain-native tokenomics\n* Feeless experience\n* Contract wallets as first-class citizens (account abstraction)\n\n## How to play\n\n`Rollupnet` is a public deployment of the smart rollup operator + Tezos-compatible facade node, it is used mostly for testing and demonstrating purposes.  \n\n### RPC\n\nPublic endpoint:\n* https://rollupnet.zaun.baking-bad.org/chains/main/blocks/head\n\nYou need to add custom network to your wallet, if you want to interact with the `rollupnet`. Check out this tutorial on how to add custom RPC provider to Temple wallet: https://www.youtube.com/watch?v=VzeSFdna8Vk\n\n### Keys\n\nImport one of the following bootstrap keys:\n* `edsk3gUfUPyBSfrS9CCgmCiQsTCHGkviBDusMxDJstFtojtc1zcpsh`\n* `edsk39qAm1fiMjgmPkw1EgQYkMzkJezLNewd7PLNHTkr6w9XA2zdfo`\n* `edsk4ArLQgBTLWG5FJmnGnT689VKoqhXwmDPBuGx3z4cvwU9MmrPZZ`\n* `edsk2uqQB9AY4FvioK2YMdfmyMrer5R8mGFyuaLLFfSRo8EoyNdht3`\n* `edsk4QLrcijEffxV31gGdN2HU7UpyJjA8drFoNcmnB28n89YjPNRFm`\n\n### BCD\n\nWe have a dedicated instance of Better Call Dev explorer for periodic test networks including `rollupnet`:\n* https://teztnets.better-call.dev/\n\nYou can use it to deploy and interact with smart contracts using web interface.\n\n### Limitations\n\n* With the current limit (4096 bytes) for inbox messages you won't be able to deploy large smart contracts\n* Some Michelson features are not yet supported, so you might not able to deploy contracts containing particular opcodes\n\n### Feedback\n\nYour feedback is extremely valuable, and we also expect lots of bugs at early stage, so please contact us if anything works not as expected:\n* [Discord](https://discord.com/invite/RcPGSdcVSx) server\n* [Telegram](https://t.me/baking_bad_chat) chat\n* [Slack](https://tezos-dev.slack.com/archives/CV5NX7F2L) channel\n\n## Installation\n\nInstall Rust toolchain:\n```\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nAdd Wasm32 target:\n```\nrustup target add wasm32-unknown-unknown\n```\n\nInstall build dependencies:\n```\nmake install\n```\n\n## How to build\n\n### Binaries\n\n#### Kernel\n\nCreate wasm file for the payload kernel:\n\n```\nmake build-kernel PACKAGE=tezos_kernel\n```\n\n#### Installer\n\nConvert payload kernel into 4kb pages and create a boot wasm file:\n\n```\nmake build-installer PACKAGE=tezos_kernel\n```\n\n#### Facade node\n\nCreate a binary for the facade node:\n\n```\nmake build-facade\n```\n\n### Docker images\n\nCreates local images out of the pre-built artifacts.\n\n### Rollup node\n\nRequires installer kernel and generated pages.  \nNote the environment file included in the Makefile, that exposes `OCTEZ_TAG`, `OCTEZ_PROTO`.\n\n```\nmake image-operator PACKAGE=tezos_kernel\n```\n\n### Facade node\n\n```\nmake image-facade\n```\n\n## How to run\n\nNote the environment file included in the Makefile, that exposes target `NETWORK`.\n\n### Operator\n\nDepending on the target package run:\n\n```\nmake run-tezos-operator\n```\n\nYou will end up inside the docker container shell.  \nEvery time you call this target, kernel and docker image will be rebuilt.\n\n#### Generate new keys\n\nFor convenience, your local .tezos-client folder is mapped into the container in order to preserve the keys. Upon the first launch you need to create new keypair, in order to do that inside the operator shell:\n\n```\n$ operator generate_key\n```\n\n#### Check account info\n\nIf you already have a key, check it's balance: it should be at least 10k tez to operate a rollup, otherwise top up the balance from the faucet. To get your account address:\n\n```\n$ operator account_info\n```\n\n#### Originate rollup\n\n```\n$ operator deploy_rollup\n```\n\nRollup data is persisted meaning that you can restart the container without data loss. If you try to call this command again it will tell you that there's an existing rollup configuration. Use `--force` flag to remove all data and originate a new one.\n\n#### Run rollup node\n\n```\n$ operator run_node\n```\n\nRuns rollup node in synchronous mode, with logs being printed to stdout.  \nAlso RPC is available at `127.0.0.1:8932` on your host machine.\n\n## Facade\n\nRun tezos node binary with debug logs enabled:\n\n```\n$ make run-facade\n```\n\nEvery time you call this target tezos node binary will be rebuilt.\n\n## Docker compose\n\nOnce you have both operator and facade images built, you can run them together with compose.\n\nFirst, create a `.env` file with four environment variables:\n```\nTAG=\u003coperator image tag\u003e\nNETWORK=\u003cdestination network name\u003e\nROLLUP_ADDRESS=\u003csr rollup address from node logs\u003e\nOPERATOR_KEY=unencrypted:\u003cedsk private key from .tezos-client folder\u003e\n```\n\nThen run docker-compose:\n\n```\ndocker-compose up -d\n```\n\n## How to test\n\n### Unit \u0026 integration tests\n\nMake sure you have nextest installed:\n```\ncargo install cargo-nextest --locked\n```\n\nRun all tests:\n```\nmake nextest\n```\n\n### Wasm REPL\n\nPrepare inputs using notebooks (make sure you have Python installed):\n```\njupyter notebook\n# navigate to scripts folder\n```\n\nBuild kernel in debug mode, create docker image, and run REPL:\n```\nmake debug-kernel PACKAGE=tezos_kernel\n```\n\nPopulate rollup inbox:\n```\n\u003e load inputs\n```\n\nRun kernel:\n```\n\u003e step inbox\n```\n\nMake sure kernel state is updated:\n```\n\u003e show key /head\n```\n\n## Troubleshooting\n\n### Unsupported target `wasm32-unknown-unknown`\n\nKnown issues:\n- `getrandom` (does not compile since version 0.2.10) =\u003e use patched version\n    ```toml\n    [patch.crates-io]\n    getrandom = { git = \"https://github.com/baking-bad/getrandom\", branch = \"patch/0.2\" }\n    ```\n\n### `float instructions are forbidden`\n\nSCORU host does not support operations with floating point thus one need to make sure none of the dependencies introduces them.  \nDon't forget to use `wasm-strip` to eliminate dead code.  \n\nKnown issues with common crates:\n- `serde_json` =\u003e use `serde-json-wasm` instead\n- `num-bigint` (floats used in `to_radix_str` and `from_radix_str`) =\u003e use `ibig` instead\n\nIn order to trace back float usage, first build kernel with debug info and generate `.wat` file:\n```\nmake wat\n```\n\nSearch for `f64 ` and `f32 ` substrings and unwind calls up to the crate level.\n\n### `unknown import \"__wbindgen_placeholder__\"`\n\nSome of your dependencies use `wasm-bindgen` and mistakenly treat `wasm32-unknown-unknown` target as browser env.  \nMake sure you have disabled features that do so, or replace such dependencies.\n\nKnown issues with common crates:\n- `chrono` =\u003e disable `clock` feature\n\n## Credits\n\n* [Tezos SCORU](https://gitlab.com/tezos/tezos) \u0026 [Kernel SDK](https://gitlab.com/tezos/kernel) — Nomadic Labs and TriliTech teams\n* [Tezos Rust SDK](https://github.com/airgap-it/tezos-rust-sdk) — Papers team\n* Thanks to [@emturner](https://github.com/emturner) and [@romarq](https://github.com/romarq) for accepting my PRs :)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Ftezos-on-tezos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaking-bad%2Ftezos-on-tezos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaking-bad%2Ftezos-on-tezos/lists"}