{"id":22886604,"url":"https://github.com/zenodeapp/shielded-swap","last_synced_at":"2025-08-02T15:33:49.959Z","repository":{"id":240111521,"uuid":"783795629","full_name":"zenodeapp/shielded-swap","owner":"zenodeapp","description":"A CLI BASED SHIELDED SWAP application for SE.","archived":false,"fork":false,"pushed_at":"2024-04-13T17:58:43.000Z","size":190,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T23:19:14.197Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/zenodeapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["zenodeapp"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":["https://zenode.app/support"]}},"created_at":"2024-04-08T15:30:17.000Z","updated_at":"2024-05-16T17:58:37.000Z","dependencies_parsed_at":"2024-05-16T19:59:39.976Z","dependency_job_id":"299cd554-6bc0-4015-8122-f12e376b5534","html_url":"https://github.com/zenodeapp/shielded-swap","commit_stats":null,"previous_names":["zenodeapp/shielded-swap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Fshielded-swap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Fshielded-swap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Fshielded-swap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenodeapp%2Fshielded-swap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenodeapp","download_url":"https://codeload.github.com/zenodeapp/shielded-swap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246523089,"owners_count":20791431,"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":[],"created_at":"2024-12-13T20:19:28.235Z","updated_at":"2025-03-31T18:45:27.347Z","avatar_url":"https://github.com/zenodeapp.png","language":"Shell","funding_links":["https://github.com/sponsors/zenodeapp","https://zenode.app/support"],"categories":[],"sub_categories":[],"readme":"# Shielded Swap (CLI based)\n\nA CLI BASED SHIELDED SWAP application for SE.\n\nThis has been written by ZENODE and is licensed under the MIT-license (see [LICENSE](./LICENSE)).\n\n\u003e [!TIP]\n\u003e If you need to send funds over from Osmosis to Namada or vice versa, head over to https://zenode.app/explorer/namada/ibc.\n\u003e\n\u003e This is a partially-working web-based Shielded IBC application (Transparent transfers work + shielded OSMO/THETA to Namada).\n\u003e\n\u003e \u003e It's also possible to fund your wallet using the _Fund your wallet(s)_ section inside the wizard.\n\n## Requirements\n- [gum](https://github.com/charmbracelet/gum)\n- [osmosisd](https://docs.osmosis.zone/osmosis-core/osmosisd)\n- [namada](https://docs.namada.net/introduction/install)\n- [jq](https://jqlang.github.io/jq/download)\n- [bc](https://www.gnu.org/software/bc/manual/html_mono/bc.html)\n\n## Features\n\n ### General\n- Written in a modular fashion to promote reusability of code\n- Attempted to add as much error-handling and validity checks as possible for robustness (e.g. user input validation, type errors, etc.)\n- Configure the config.json file from within the wizard (plus auto-validity checker implemented)\n- Namada chain ID can be configured (not exclusively tied to SE)\n\n### Shielded\n- Able to perform shielded-swaps between _naan \u003c=\u003e uosmo_ (shielded actions)\n- Configure _slippage_ for shielded swaps\n- Swaps are simulated and give an approximate for the min. amount of tokens the user could receive\n- Able to shield and unshield assets (shielded actions)\n- Smart shielded-syncing; indicates whenever a shielded-sync should be performed\n- Compatible with broken shielded namada-chains (SE) by enabling the `shieldedBroken`-key in [config.json](config.json). See more about this in section [shieldedBroken](#shieldedbroken) or [Flow of action](#flow-of-action).\n\n ### Pools\n- Allows for a simple way to _create naan-uosmo pools_\n- List all osmosis pools the user is a part of (for quickly switching between created pools)\n- Show information for the selected pool\n\n### Balance\n- Balance checker for osmosis, transparent and shielded addresses\n- Able to fund your linked osmosis or namada wallet with, respectively, naan or uosmo\n- Creating new transparent, shielded (viewing key + payment combined) and osmosis keys made easy\n\n\n## Quick-start\n\n### 1. Install jq and bc\n\n\u003e [!NOTE]\n\u003e\n\u003e Likely already installed!\n\u003e\n\n```\nsudo apt-get install jq bc\n```\n\n### 2. Install gum\n\n```\ngo install github.com/charmbracelet/gum@latest\n```\n\n\u003e For other methods to install gum, see: https://github.com/charmbracelet/gum.\n\n### 3. Install osmosisd\n\n```\ncurl -sL https://get.osmosis.zone/install \u003e i.py \u0026\u0026 python3 i.py\n```\n\n\u003e Or, see: https://docs.osmosis.zone/osmosis-core/osmosisd.\n\n### 4. Install namada\n\n\u003e See: https://docs.namada.net/introduction/install.\n\n### 5. Run the wizard!\n\n```\nbash wizard.sh\n```\n\n## Configuration\n\n\u003e [!TIP]\n\u003e\n\u003e Most of the [config.json](config.json) file is already pre-filled with data one could make use of. The only values you will have to change are:\n\u003e - `namImplicitKey`: _alias_\n\u003e - `namTransparent`: _address_\n\u003e - `namViewingKey`: _alias_\n\u003e - `namPayment`: _address_\n\u003e - `osmoKey`: _alias_\n\u003e - `osmoAddress`: _address_\n\u003e\n\u003e You can make these changes using the wizard. See below for more info or check out the [_config.example.json](/config/_config.example.json)-file for an example.\n\n### Schema\n```\n{\n  \"shieldedBroken\": boolean,\n  \"namChainId\": string,\n  \"osmoChainId\": string,\n  \"namRpc\": string,\n  \"osmoRpc\": string,\n\n  \"osmoPoolId\": number,\n  \"namDenom\": string,\n  \"namIbc\": string,\n  \"namChannel\": string,\n  \"osmoChannel\": string,\n\n  \"namImplicitKey\": alias,\n  \"namTransparent\": address,\n  \"namViewingKey\": alias,\n  \"namPayment\": address,\n  \"namMemo\": string,\n\n  \"osmoKey\": alias,\n  \"osmoAddress\": string\n}\n```\n\u003e `alias` and `address` are both strings but should explicitly be _aliases_ or _addresses_! \n\n#### shieldedBroken\n\n`shieldedBroken` should only be set to `true` if the Namada chain isn't able to perform a _shielded_ IBC transfer to an external chain (the reject VP issue). What this does is tell the wizard to instead use the _transparent address_ for the **initial transfer** of _naan/uosmo from Namada_ to Osmosis.\n\n#### namRpc and osmoRpc\n\nMake sure to also include the port number for `osmoRpc`, else `osmosisd` won't let transactions through. Possibly also the case for `namRpc`.\n\n#### namImplicitKey and namTransparent\n\nMake sure to let these two point to the same address.\n\n#### osmoKey and osmoAddress\n\nMake sure to let these two point to the same address.\n\n## Appendix\n\n### Channels/pools\n\n#### Existing\nI already created the following channels and pools that can be used:\n- ibc `channel-1321 \u003c=\u003e channel-6903`\n- ibc/denom `ibc/F6EE42E1CC8154EFDC3329174F4A519DCB6C62BAC914DC55B1E624C0BD07880F`\n- pool(s) `445` or `447`\n\n#### New\n\nIf you need to create a new pool, I usually used the following settings:\n- A ratio of 5:1\n- 1000000000 uosmo (1000 OSMO) and\n- 200 naan\n\n\u003e This seems to work well for me; just make sure not to create _too small pools_ or try to swap _too little amounts_, else shielded swaps will fail.\n\n### Shielded-sync\n\n\u003e [!CAUTION]\n\u003e\n\u003e If you have an automated script running for keeping your shielded-sync up-to-date, then do not perform any shielded-sync's inside of the wizard itself! There's a chance of corrupting your cached data when multiple shielded-sync runs are executed at the same time!\n\u003e\n\u003e The wizard makes sure to always ask for your consent when it wants to run this command.\n\n### Flow of action\n\nThis is an overall explanation of what happens during a shielded-swap. Details like configuring slippage, balance checking and error-handling have been omitted but can be experienced in the wizard or seen in the code itself (mostly in [layout/shielded.sh](layout/shielded.sh)).\n\n1. Depending on whether `shieldedBroken` is `true` or `false` tokens get send from a **transparent** or **shielded** Namada address to Osmosis address.\n2. Once this arrives on Osmosis, a swap is performed; either **uosmo =\u003e naan or naan =\u003e uosmo**.\n3. After this swap succeeds, a memo gets generated in preparation for sending the tokens back to a Namada **shielded** wallet.\n4. The IBC transfer gets executed and the user is given the option to perform a shielded sync and check their updated balance.\n\n### Ideas\n\n- Swapping of any type of token, not just naan \u003c=\u003e uosmo pairs would have been possible if I refactored the code further. The wizard depends mostly on which pool is selected, thus treating this as the indicator to which two tokens the user wanted to swap would have been feasible!\n- Implementing more tutorial-like workflows for changing the [config](config.json)-file would have made it easier to get started.\n- The [config](config.json)-file is currently quite bloated. Some values could have been fetched and stored into an auto-generated static-config.json file (e.g. like deriving `osmoAddress` from the `osmoKey` and `namTransparent` from the `namImplicitKey`).\n- [Issue #1](https://github.com/zenodeapp/shielded-swap/issues/1)\n- [Issue #2](https://github.com/zenodeapp/shielded-swap/issues/2)\n\n\u003c/br\u003e\n\n\u003cp align=\"right\"\u003e— ZEN\u003c/p\u003e\n\u003cp align=\"right\"\u003eCopyright (c) 2024 ZENODE\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenodeapp%2Fshielded-swap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenodeapp%2Fshielded-swap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenodeapp%2Fshielded-swap/lists"}