{"id":16189957,"url":"https://github.com/brson/solana-move-demo","last_synced_at":"2026-03-18T18:19:34.713Z","repository":{"id":231508324,"uuid":"781933105","full_name":"brson/solana-move-demo","owner":"brson","description":null,"archived":false,"fork":false,"pushed_at":"2024-04-19T00:03:34.000Z","size":34,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T20:19:42.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Move","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-04T10:15:46.000Z","updated_at":"2024-06-05T20:06:03.000Z","dependencies_parsed_at":"2024-04-19T00:30:31.751Z","dependency_job_id":"fde20fa0-041d-40d3-ac2e-cf3db9c1704c","html_url":"https://github.com/brson/solana-move-demo","commit_stats":null,"previous_names":["brson/solana-move-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/brson/solana-move-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fsolana-move-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fsolana-move-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fsolana-move-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fsolana-move-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brson","download_url":"https://codeload.github.com/brson/solana-move-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fsolana-move-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000662,"owners_count":26082817,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-10-10T07:37:44.150Z","updated_at":"2025-10-08T20:19:43.006Z","avatar_url":"https://github.com/brson.png","language":"Move","funding_links":[],"categories":[],"sub_categories":[],"readme":"# End-to-end Move-on-Solana demo\n\nThis is a demo of running Move language programs on Solana.\n\nIt specifies minimum feature requirements,\noutlines a minimal workflow for building, deploying and running Move programs,\ndemos comparable existing workflows on Sui and Solana,\ndescribes implementation details and a roadmap.\n\n- [Requirements](#user-content-requirements)\n- [Which toolset should Solana-Move integrate with?](#user-content-which-toolset-should-solana-move-integrate-with)\n- [Running the Solana-Move demo](#user-content-running-the-solana-move-demo)\n- [`solana-move` commands discussion](#user-content-solana-move-commands-discussion)\n- [Calling Move programs from the client](#user-content-calling-move-programs-from-the-client)\n- [Handling on-chain bytecode dependencies](#user-content-handling-on-chain-bytecode-dependencies)\n- [An interim storage model](#user-content-an-interim-storage-model)\n- [Proposed roadmap](#user-content-proposed-roadmap)\n- [Running the Sui example demo](#user-content-running-the-sui-example-demo)\n- [Running the Solana example demo](#user-content-running-the-solana-examnple-demo)\n\n\n\n## Requirements\n\nWe want to aim to demo the following:\n\n- Build contracts, with dependencies (source, local bytecode, on-chain bytecode)\n- Test contracts on rbpf\n- Deploy and re-deploy contracts to a localnet\n- Call contracts with arguments and return values from Rust client code\n- Call contracts with arguments and return values from the CLI\n\nNote that for now we are not demoing on-chain storage.\n\nWe can do this in two phases, with the first phase MVP being\n\n- Build contracts, no dependencies\n- Test contracts on rbpf\n- Deploy and re-deploy contracts to a localnet\n- Call contracts with arguments and return values from Rust client code\n\nThis MVP forgoes the ability to use dependencies,\nwhich will entail locating the corresponding omve bytecode for rbpf programs;\nand to call programs directly from the CLI, which will require the same,\nplus introspection and reflection on the interface of the program.\n\nThere are two features demonstrated here that are feasible with\nMove but not with plain Solana:\n\n- Calling arbitrary programs from the CLI, introspecting\n  the called program to get argument types\n- Calling dependencies without access to any of their source\n  code, again by using the bytecode.\n\n\n\n\n## Which toolset should Solana-Move integrate with?\n\nSince our project is a mashup of Solana, Move, and Sui,\nthere are already 4 main CLI tools involved.\n\n- `cargo` - The Rust build tool. Solana uses a cargo subcommand, `cargo build-bpf`,\n  as well as `cargo test` etc.\n- `solana` - Used for deploying to Solana, wallets, etc.\n- `sui` - All interaction with Move and Sui\n- `move` - Move build tools, not typically used directly with Sui\n\nThese tools perhaps each have their own different designs and \"feels\".\nI suggest that since we are a Solana project we should attempt to integrate with\nand match the `solana` experience. Ultimately we might want any new\nCLI commands to part of `solana` CLI, and to integrate Move features with\nexisting `solana` commands.\n\nFor an initial demo I suggest we can do everything necessary with a combination of\nthe `solana` and `move` commands.\n\nBeyond that we might work in our own `solana-move` CLI, inside the\n`external-crates/move/solana` subdirectory of Solana's sui fork.\nWe can consider this a prototype tool with the intent of moving the functionality\nelsewhere once proven. Working on the CLI in Solana's `sui` fork will avoid\nhaving to work in the main Solana codebase for now, and avoid the scrutiny\nof mainline Solana pull requests.\n\n\n\n\n## Running the Solana-Move demo\n\n**This is aspirational - not all of this works now but is what we are working toward.**\n\nYou'll need the `move` command from Solana's `sui` repo,\nbuilt with Solana support. This can be done with\n\n```\ncargo build --manifest-path=external-crates/move/Cargo.toml -p move-cli --features=solana-backend\n```\n\nor optionally installed with\n\n```\ncargo install --manifest-path=external-crates/move/Cargo.toml -p move-cli --features=solana-backend\n```\n\n\n### Install `solana` CLI tools and run the test validator\n\nFirst install the Solana tools following\n\nhttps://docs.solanalabs.com/cli/install\n\ne.g. the stable toolchain\n\n```\nsh -c \"$(curl -sSfL https://release.solana.com/v1.18.9/install)\"\n```\n\nRun the test validator:\n\n```\nsolana-test-validator\n```\n\n\n### Change the global configuration to localhost\n\nRun\n\n```\nsolana config set -u localhost\n```\n\nOtherwise all commands will need a `--url localhost` argument.\n\n\n\n### Set up a wallet and get tokens for gas\n\n```\nsolana-keygen new\nsolana airdrop 10\n```\n\n\n### Build the contract\n\nChange to the `solana-move` directory and build\n\n```\ncd solana-move\n```\n\n```\nmove build --arch=solana\n```\n\nThis creates the `build` directory containing:\n\n```\nsolana/demo/\n  demo.so\n  BuildInfo.yml\n  bytecode_modules/\n    demo.mv\n    dependencies/...\n  source_maps/...\n  sources/...\n  ...\n```\n\nNote this is mostly the same as the Sui move build,\nbut there is an rbf dylib, demo.so,\nand it's in an arch-specific `solana` directory.\n\n\n### Run the tests\n\n```\nmove test\n```\n\n\n### Deploy the contract\n\nCreate a re-usable `program-keypair.json`.\nThis contais the address of and signing key to deploy and redeploy.\n\n```\nsolana-keygen new -o program-keypair.json\n```\n\n```\nsolana program deploy target/sbf-solana-solana/release/demo.so --program-id program-keypair.json\n```\n\n### Call the contract from source\n\ntodo\n\n\n### Call the contract from the CLI\n\n```\nsolana-move call --program \u003caddress\u003e --module demo --function main --args 10\n```\n\n\n\n\n\n## `solana-move` commands discussion\n\n\n### `solana-move build`\n\nCompare to: `sui move build`, `move build`, `cargo build-bpf`\n\n- Locate and download bytecode for dependencies\n- Find move-native, optionally embedded directly in binary\n\n### `solana-move test`\n\nCompare to: `sui move test`, `move test`, `cargo test`\n\n### `solana-move publish`\n\nCompare to: `sui client publish`, `solana program publish`\n\n### `solana-move call`\n\nCompare to: `sui client call`\n\n- Parse arguments as move types\n- Build solana transactions\n\n\n\n\n## Calling Move programs from the client\n\ntodo\n\n\n## Handling on-chain bytecode dependencies\n\nI am assuming we want to be able to depend on programs that we don't have the source to.\nThis is something Solana programs can't do - programs must at least publish some interface glue\nto understand the custom calling and serialization conventions of each program.\n\nA scheme:\n\n- In addition to deploying the rbpf program, we also deploy the bytecode to a separate storage location\n- The bytecode storage location is derivable from the rbpf storage location\n- The `move-to-solana` / `move-cli` etc crates know how to derive this location,\n  deploy it / download it as part of the deploy, build, and call processes.\n- TODO: what about transitive bytecode dependencies?\n\n\n\n## An interim storage model\n\nAt the momement, actually storing data is out of scope for the demo,\nbut I think it's worth saying something about how the storage model is intended to\nwork in the short term.\n\nFirstly, we don't expect it to be secure for now, just to work.\n\nThe major facets of how storage is expected to work are:\n\n- Contracts are _statically compiled together_.\n  That is, programs don't actually call other programs;\n  when I compile a move program that calls another, I download the bytecode for the callee\n  and compile it into the caller.\n- There is a dedicated storage program, written in Rust,\n  that all move programs call to write persistent data,\n  and that program \"owns\" all move-language data.\n\nThis obviously has lots of problems,\nbut seems feasible to accomplish within the constraints we have currently.\n\n\n\n## Proposed roadmap\n\nThere are a few main thrusts of work here:\n\n- Creating `solana-move-sdk` crate that can parse move values and prepare solana transactions\n- Creating the `solana-move` CLI, and especially the solana-move-specific `solana-move call`\n  command (other commands will be identical to `move` and `solana` commands at first.\n- Deploying and retrieving bytecode for byte-code based dependencies and introspectio.n\n- Starting a release process and releasing tools people can try out.\n- Moving the storage model forward.\n\n\n### Demo 1\n\n\n- Create a client SDK crate, perhaps `solana-move-sdk` (vs. `solana-sdk`)\n  - This will depend on both existing Solana and Move crates\n- Add APIs for parsing move values\n- Add APIs for preparing Move transactions\n- Write the demo `solana-demo-client` using the `solana-move-sdk`\n  and `solana-client` SDKs, calling the demo program.\n\n\n### Demo 2\n\n- Create `solana-move` crate in `external-crates/move/solana/`\n  - Set up arg parsing with clap for the commands in this demo\n- Include the compiled move-native library directly into the `solana-move` binary\n- Set up binary releases of `solana-move` that people can test\n- Make `solana-move build` and `solana-move test` behave like\n  `move build` and `move test`. The Move libraries are reusable\n  so this shouldn't have much code duplication.\n- Write `solana-move deploy` - crib off of `solana program deploy`,\n  or just shell out to `solana program deploy`.\n- Teach `solana-move deploy` to deploy both rbpf and the original bytecode\n- Create `solana-move call` using `solana-move-client`\n  - Download and introspect bytecode to get argument types\n\n## Future\n\n- Storage model\n- Reduce size of compiled output\n  - Function sections\n  - LTO\n\n\n\n---\n\n\n\n\n\n## Running the Sui example demo\n\nThis shows how the Sui workflow works for the features we want to demo with Move on Solana.\n\n\n### Install `sui` CLI tools and run the test validator\n\nFirst install the Sui tools following\n\nhttps://docs.sui.io/guides/developer/getting-started/sui-install\n\nYou'll need both the `sui` and `sui-test-validator`.\n\nOne option is to install `sui` from source, and run `sui-test-validator` from the source directory:\n\n```\ngit clone https://github.com/MystenLabs/sui.git\ncd sui\ngit checkout origin/testnet -b testnet\n# This will put `sui` in your `.cargo/bin` directory for use later\ncargo install --path crates/sui\n# Run the validator\nRUST_LOG=off,sui_node=info cargo run -p sui-test-validator\n```\n\nConfigure sui for the local network per\n[instructions](https://docs.sui.io/guides/developer/getting-started/local-network):\n\n```\nsui client new-env --alias local --rpc http://127.0.0.1:9000\n```\n\nFIXME: the above doesn't actually work if sui is not alreday configured -\nyou'll have to walk through the interactive setup, providing the same configuration.\n\n\n\n\n### Set up a wallet and get tokens for gas\n\n```\nsui client faucet \u0026\u0026 sui client gas\n```\n\n\n\n## Build the program\n\nChange to the `sui` directory and build\n\n```\ncd sui\n```\n\n```\nsui move build\n```\n\nThis creates a `build` directory with the contents:\n\n```\ndemo/\n  BuildInfo.yml\n  bytecode_modules/\n    demo.mv\n    dependencies/...\n  source_maps/...\n  sources/...\n```\n\n## Run the tests\n\n```\nsui move test\n```\n\n## Deploy the contract\n\n```\nsui client publish --gas-budget 10000000\n```\n\n## Call the contract\n\n```\nsui client call --package \u003cpackage-id\u003e --module demo --function main --args 10 --gas-budget 10000000\n```\n\nThe package ID will be output by the previous `publish` command.\n\n\n\n---\n\n\n\n\n\n## Running the Solana example demo\n\nThis shows how the Solana workflow works for the features we want to demo with Move on Solana.\n\n\n### Install `solana` CLI tools and run the test validator\n\nFirst install the Solana tools following\n\nhttps://docs.solanalabs.com/cli/install\n\ne.g. the stable toolchain\n\n```\nsh -c \"$(curl -sSfL https://release.solana.com/v1.18.9/install)\"\n```\n\nRun the test validator:\n\n```\nsolana-test-validator\n```\n\n\n## Change the global configuration to localhost\n\nRun\n\n```\nsolana config set -u localhost\n```\n\nOtherwise all commands will need a `--url localhost` argument.\n\n\n\n### Set up a wallet and get tokens for gas\n\n```\nsolana-keygen new\nsolana airdrop 10\n```\n\n\n### Run the demo\n\nChange to the `solana` directory:\n\n```\ncd solana\n```\n\nBuild the program:\n\n```\ncargo build-bpf\n```\n\nThis creates a `target` directory with the contents:\n\n```\nsbf-solana-solana/release/\n  demo.so\n```\n\n## Run the tests\n\n```\ncargo test\n```\n\n## Deploy the contract\n\nCreate a re-usable `program-keypair.json`.\nThis contais the address of and signing key to deploy and redeploy.\n\n```\nsolana-keygen new -o program-keypair.json\n```\n\n```\nsolana program deploy target/sbf-solana-solana/release/demo.so --program-id program-keypair.json\n```\n\n## Call the contract\n\ntodo - this needs to be done from code\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fsolana-move-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrson%2Fsolana-move-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fsolana-move-demo/lists"}