{"id":25931165,"url":"https://github.com/kayleexx/icp-token-wallet","last_synced_at":"2026-05-12T14:04:22.394Z","repository":{"id":264467758,"uuid":"893461478","full_name":"Kayleexx/ICP-Token-Wallet","owner":"Kayleexx","description":"A decentralized token wallet on the Internet Computer Protocol (ICP) blockchain. This wallet allows users to mint, transfer, and query token balances.","archived":false,"fork":false,"pushed_at":"2024-11-24T14:43:39.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-24T15:24:30.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/Kayleexx.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-11-24T14:08:52.000Z","updated_at":"2024-11-24T14:43:42.000Z","dependencies_parsed_at":"2024-11-24T18:01:29.931Z","dependency_job_id":null,"html_url":"https://github.com/Kayleexx/ICP-Token-Wallet","commit_stats":null,"previous_names":["kayleexx/icp-token-wallet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kayleexx%2FICP-Token-Wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kayleexx%2FICP-Token-Wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kayleexx%2FICP-Token-Wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kayleexx%2FICP-Token-Wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kayleexx","download_url":"https://codeload.github.com/Kayleexx/ICP-Token-Wallet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241758969,"owners_count":20015248,"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":"2025-03-03T23:58:16.350Z","updated_at":"2026-05-12T14:04:17.366Z","avatar_url":"https://github.com/Kayleexx.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ICP Token Wallet\n\nA decentralized token wallet built on the Internet Computer Protocol (ICP) blockchain. This project allows users to manage tokens with features like minting, transferring, and querying balances. Written in Rust and integrated with the DFINITY SDK, it demonstrates the creation of secure and scalable token management on the ICP network.\n\n\n\n## Prerequisites\n\n- [Node.js](https://nodejs.org/) (v12.22.9)\n- [DFX SDK](https://internetcomputer.org/docs/current/developer-docs/build/install-upgrade-remove) (v0.24.2)\n- Internet Computer Local Network\n\nEnsure you have an identity set up with `dfx`:\n```bash\ndfx identity use \u003cidentity_name\u003e\n```\n\n---\n\n## Installation\n\n1. Clone the repository:\n   ```bash\n   git clone \u003crepository_url\u003e\n   cd icp_token_wallet\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n---\n\n## Project Structure\n\n```plaintext\nicp_token_wallet/\n│\n├── src/\n│   └── icp_token_wallet_backend/\n│       ├── src/\n│       │   └── lib.rs          # Rust backend logic\n│       └── icp_token_wallet_backend.did  # Candid interface\n│\n├── dfx.json                    # DFX configuration\n└── package.json                # Project metadata\n```\n\n---\n\n## Deploying the Canister\n\n1. **Start the Local Network:**\n   ```bash\n   dfx start --background\n   ```\n\n2. **Create and Deploy the Canister:**\n   ```bash\n   dfx canister create icp_token_wallet_backend\n   dfx build\n   dfx canister install icp_token_wallet_backend\n   ```\n\n---\n\n## Using the Canister\n\n### Check Principal ID\nTo interact with the wallet, get your principal ID:\n```bash\ndfx identity get-principal\n```\n\n### Example Commands\n1. **Query Balance:**\n   ```bash\n   dfx canister call icp_token_wallet_backend balance_of \"(principal \\\"\u003cyour_principal_id\u003e\\\")\"\n   ```\n   Replace `\u003cyour_principal_id\u003e` with your principal ID.\n\n2. **Transfer Tokens:**\n   ```bash\n   dfx canister call icp_token_wallet_backend transfer \"(principal \\\"\u003crecipient_principal_id\u003e\\\", \u003camount\u003e)\"\n   ```\n\n3. **Mint Tokens:**\n   Only the owner can mint tokens:\n   ```bash\n   dfx canister call icp_token_wallet_backend mint \"(principal \\\"\u003crecipient_principal_id\u003e\\\", \u003camount\u003e)\"\n   ```\n\n4. **Query Token Info:**\n   ```bash\n   dfx canister call icp_token_wallet_backend token_info\n   ```\n\n---\n\n## Security Measures\n\nSecurity is a key focus in the development of this token wallet to ensure the integrity of transactions and user data. Below are the key security measures implemented:\n\n### 1. **Owner Control**\n   - The wallet is initialized with a designated owner. Only the owner can mint new tokens.\n   - This ensures that the supply of tokens is controlled and prevents unauthorized users from inflating the total supply.\n\n### 2. **Access Control for Transactions**\n   - For each transaction, the sender's balance is checked before transferring tokens to the recipient.\n   - If the sender does not have enough tokens, the transaction is rejected.\n   - This ensures that users cannot transfer more tokens than they possess, preventing issues such as negative balances.\n\n### 3. **Principal-based Authorization**\n   - Transactions are verified based on the `Principal` of the caller (sender). \n   - This ensures that only the intended user can interact with their own wallet, adding a layer of identity validation.\n\n### 4. **Immutable Wallet State**\n   - The wallet state is stored securely using the `RefCell` mechanism, making it thread-safe and ensuring that the data is not tampered with during updates.\n   - This ensures that no unauthorized changes can be made to balances, token symbols, or other key properties without proper checks.\n\n### 5. **Secure Token Minting**\n   - The minting function ensures that only the designated owner of the wallet can create new tokens. \n   - This prevents unauthorized minting, ensuring that the token supply is under control and not subject to malicious manipulation.\n\n### 6. **Data Privacy**\n   - All wallet data, such as balances and token information, is stored in a decentralized manner on the ICP blockchain, ensuring that users' private information remains secure and immutable.\n   \n### 7. **Secure Encryption for Wallet Identity**\n   - Wallet identities are encrypted to prevent unauthorized access and to ensure user data privacy.\n\n### 8. **Smart Contract Safety**\n   - The code leverages the DFINITY SDK's secure development environment, ensuring that no malicious code can be injected into the wallet contract.\n   - Each contract call (such as `transfer`, `mint`, `balance_of`) is carefully implemented to avoid vulnerabilities such as reentrancy attacks, ensuring safe interactions with the blockchain.\n\n---\n\n\n## Available Methods\n\n### `init`\nInitializes the canister with the deployer's principal as the owner.\n\n### `balance_of(owner: Principal) -\u003e u64`\nReturns the balance of the specified principal.\n\n### `transfer(to: Principal, amount: u64) -\u003e bool`\nTransfers tokens from the caller to the specified recipient.\n\n### `mint(to: Principal, amount: u64) -\u003e bool`\nMints tokens to a specific principal. Only callable by the owner.\n\n### `token_info() -\u003e (String, String, u8, u64)`\nReturns the token's metadata:\n- Token name\n- Symbol\n- Decimal places\n- Total supply\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayleexx%2Ficp-token-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayleexx%2Ficp-token-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayleexx%2Ficp-token-wallet/lists"}