-
Notifications
You must be signed in to change notification settings - Fork 1
Introducing the new mywallet
#3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .vscode | ||
| dist | ||
| node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,75 +1,75 @@ | ||
| # Cardano Wallet | ||
|
|
||
| This project is a reference implementation for a simple Cardano wallet | ||
| interacting with Mynth. It consists of a CLI written in TypeScript | ||
| illustrating basic functions such as sending transactions with embedded | ||
| encrypted messages. | ||
|
|
||
| A Cardano wallet is a critical tool for interacting with Cardano, | ||
| allowing users to store, send, receive, and stake tokens. The foundation | ||
| of a Cardano wallet is the **seed phrase** (also known as a recovery | ||
| phrase or mnemonic phrase). This is a series of 12, 15, or 24 words | ||
| generated when the wallet is created. Every wallet has a unique seed | ||
| phrase. The seed phrase is the master key to the wallet, allowing the | ||
| user to recover the associated private keys and, therefore, all funds | ||
| and staking rights. | ||
|
|
||
| A Cardano wallet consists of two main types of private keys: | ||
|
|
||
| 1. **Payment Private Key:** Used for transactions, such as sending or | ||
| receiving tokens. | ||
| 2. **Staking Private Key:** Used for delegating ADA to a staking pool | ||
| or managing staking rewards. | ||
|
|
||
| From each private key, a corresponding **public key** is derived. The | ||
| public key is then used to generate a **Cardano address**, which others | ||
| can use to send tokens to your wallet. | ||
| # Mynth Wallet | ||
|
|
||
| A simple CLI-based multi-chain wallet for interacting with Mynth wallets | ||
| (intents). | ||
|
|
||
| ## About Mynth | ||
|
|
||
| Mynth is an intent-based, multi‑chain, layer zero protocol designed to | ||
| simplify and secure cross‑chain token transfers. By encoding user | ||
| intentions (or “intents”) into on‑chain contracts, Mynth enables | ||
| seamless value movement between disparate blockchains without requiring | ||
| trust in centralized bridges or custodians. Key characteristics of Mynth | ||
| include: | ||
|
|
||
| - **Protocol‑level Intents**: Users express desired transfers as | ||
| intents, which are recorded in a contract and can be fulfilled or | ||
| canceled according to protocol rules. | ||
| - **Decentralized Execution**: Executors monitor and fulfill intents on | ||
| behalf of users, unlocking funds only upon valid proof of execution. | ||
| - **Secure Key Exposure**: When an intent is fulfilled or expired, the | ||
| associated private key is revealed in a verifiable way, ensuring that | ||
| only authorized parties can claim funds. | ||
| - **Multi‑Chain Interoperability**: Mynth operates agnostically across | ||
| chains, enabling transfers between any compatible network. | ||
|
|
||
| ## Purpose | ||
|
|
||
| `mywallet` is a CLI companion utility for interacting with multi-chain | ||
| wallets. When a user wants to perform a swap between two blockchains, | ||
| Mynth encodes an intent within a contract, and these contracts act as | ||
| wallets that are controlled by the Mynth Lizard network. Once an intent | ||
| is fulfilled, it can be unlocked by an executor. If an intent expires, | ||
| it can be canceled by its owner. In either case of unlocking or | ||
| cancellation, the associated private key is exposed. To obtain this | ||
| private key, a user must verify that they have the authority to request | ||
| it. | ||
|
|
||
| One of the functionalities of the `mywallet` tool is to allow a user to | ||
| sign an intent to verify that they are one of the authorized | ||
| representatives for interacting with that intent. This signed | ||
| verification enables communicating with the Lizard network to retrieve | ||
| the underlying private key. Once the private key is obtained, `mywallet` | ||
| can be used to withdraw funds, transfer funds, or retrieve the addresses | ||
| associated with the intent. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| To use this project, ensure you have the following installed: | ||
|
|
||
| - **Node.js** (v18.8 or later) | ||
| - **npm** (Node Package Manager) | ||
| - [Node.js](https://nodejs.org/en/download) | ||
| - [pnpm](https://pnpm.io/) | ||
|
|
||
| ## Installation | ||
|
|
||
| To install and set up the Cardano Wallet CLI project, follow these | ||
| steps: | ||
|
|
||
| 1. **Clone the repository:** | ||
|
|
||
| ``` bash | ||
| git clone https://github.com/MynthAI/wallet.git | ||
| ``` | ||
| To install and set up the `mywallet`, follow these steps: | ||
|
|
||
| 2. **Navigate to the project directory:** | ||
|
|
||
| ``` bash | ||
| cd wallet | ||
| ``` | ||
|
|
||
| 3. **Install the dependencies:** | ||
|
|
||
| ``` bash | ||
| npm install | ||
| ``` | ||
| ``` bash | ||
| git clone https://github.com/MynthAI/wallet.git | ||
| cd wallet | ||
| pnpm install | ||
| pnpm build | ||
| pnpm link | ||
| ``` | ||
|
|
||
| After completing these steps, the Cardano Wallet CLI should be ready for | ||
| use. You can test this by running: | ||
| After completing these steps, the `mywallet` should be ready for use. | ||
| You can test this by running: | ||
|
|
||
| ``` bash | ||
| npx wallet | ||
| mywallet --help | ||
| ``` | ||
|
|
||
| ## License | ||
|
|
||
| This project is licensed under the MIT License. By using or contributing | ||
| to this project, you agree to the terms and conditions of MIT. | ||
|
|
||
| ## Support | ||
|
|
||
| If you encounter any issues or have questions, feel free to reach out | ||
| for support. | ||
|
|
||
| Happy encrypting and decrypting\! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| import path from "path"; | ||
| import { fileURLToPath } from "url"; | ||
| import { FlatCompat } from "@eslint/eslintrc"; | ||
| import js from "@eslint/js"; | ||
| import tsPlugin from "@typescript-eslint/eslint-plugin"; | ||
| import parser from "@typescript-eslint/parser"; | ||
| import importPlugin from "eslint-plugin-import"; | ||
|
|
||
| const here = path.dirname(fileURLToPath(import.meta.url)); | ||
| const base = path.join(here, process.argv[2] || ""); | ||
SynthLuvr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| const compat = new FlatCompat({ | ||
| baseDirectory: base, | ||
| recommendedConfig: js.configs.recommended, | ||
| }); | ||
|
|
||
| export default [ | ||
| { | ||
| ignores: ["dist", "eslint.config.js"], | ||
| }, | ||
| ...compat.extends( | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:import/errors", | ||
| "plugin:import/warnings", | ||
| "plugin:import/typescript", | ||
| ), | ||
| { | ||
| files: ["**/*.{ts,tsx,mjs,cjs,js}"], | ||
| languageOptions: { | ||
| parser, | ||
| parserOptions: { | ||
| project: path.resolve(base, "tsconfig.json"), | ||
| tsconfigRootDir: base, | ||
| sourceType: "module", | ||
| ecmaVersion: "latest", | ||
| }, | ||
| }, | ||
| plugins: { | ||
| "@typescript-eslint": tsPlugin, | ||
| import: importPlugin, | ||
| }, | ||
| settings: { | ||
| "import/resolver": { | ||
| typescript: { | ||
| project: path.resolve(base, "tsconfig.json"), | ||
| alwaysTryTypes: true, | ||
| resolveFullPaths: true, | ||
| }, | ||
| }, | ||
| }, | ||
| rules: { | ||
| "@typescript-eslint/explicit-function-return-type": "off", | ||
| "@typescript-eslint/no-explicit-any": "warn", | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| varsIgnorePattern: "^\\$|_", | ||
| argsIgnorePattern: "^_", | ||
| ignoreRestSiblings: true, | ||
| }, | ||
| ], | ||
| "no-empty": "off", | ||
| }, | ||
| }, | ||
| ]; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.