diff --git a/README.md b/README.md index 76c487e..f782873 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Seedelf - A Cardano Stealth Wallet -**Seedelf** is a stealth wallet that hides the receiver and spender with Schnorr proofs using the BLS12-381 curve. UTxOs inside the wallet are indistinguishable from one-another and it is not possible to deduce the intended receiver assuming that the Elliptic Curve Decisional-Diffie-Hellman (ECDDH) problem is hard. +**Seedelf** is a stealth wallet that hides the receiver and spender using a non-interactive variant of Schnorr's Σ-protocol for the Discrete Logarithm Relation. It is not possible to deduce the intended receiver or spender of UTxOs inside this wallet. The Seedelf [cli](./seedelf-cli/README.md) is available on Linux, Windows, and MacOS. ## What is a Seedelf token? -The wallet name, **Seedelf**, comes from the identifier token used to locate the datum of a UTxO inside the wallet contract. A seedelf allows the root datum to be easily located and provides a personalized touch while maintaining privacy. It is similar to how ADAHandle works but with a slight twist. +The wallet name, **Seedelf**, comes from the prefix of the identifier token used to locate the datum of a UTxO inside the wallet contract. A seedelf allows the root datum to be easily located and provides a personalized touch while maintaining privacy. It is similar to how ADAHandle works but with a slight twist. Its main purpose is for the ease of locating the datum for address generation. Alice can ask Bob to send funds to their seedelf. Bob can find the UTxO that holds the seedelf token and will use that datum to re-randomize a new datum for Alice. Bob will then send funds to the contract with this new randomized datum. @@ -44,7 +44,7 @@ The stealth wallet contract is token agnostic, allowing any NFT to be the locato ## What is a Stealth Wallet? -Below is a quick overview of how the wallet contract works. +A stealth wallet hides the receiver and spender of funds inside the contract. Below is a quick overview of how the wallet contract works. ### Terminology @@ -64,14 +64,14 @@ The register contains the generator and the public key for some UTxO. ```rust pub type Register { - // the generator, # + /// the generator, # generator: ByteArray, - // the public value, # + /// the public value, # public_value: ByteArray, } ``` -A UTxO is spendable if the transaction can provide proof of knowledge of the secret key using a Schnorr proof. A valid Schnorr proof has the form: +A UTxO is spendable if the transaction can provide proof of knowledge of the secret key using a non-interactive zero knowledge Schnorr proof. A valid Schnorr proof has the form: $$ g^{z} = g^r u^c, @@ -92,7 +92,7 @@ $$ ### Stealth Address -A register defines a public address used to produce a private address. A user wishing to create a stealth address for another user will find a public address and re-randomize the register as the new datum of a future UTxO. +A register defines a public address used to produce a private address. A user wishing to create a stealth address for another user will find their public address and re-randomize the register as the new datum of a future UTxO. A user selects a random integer, $d$, and constructs a new register. @@ -146,7 +146,7 @@ This register would become unspendable, resulting in lost funds. Three attacks are known to break the privacy of this wallet. The first attack comes from picking a bad $d$ value. A small $d$ value may be able to be brute-forced. The brute-force attack is circumvented by selecting a $d$ value on the order of $2^{254}$. The second attack comes from not properly destroying the $d$ value information after the transaction. The $d$ value is considered toxic waste in this context. If the $d$ values are known for some users then it becomes trivial to invert the register into the original form thus losing all privacy. The third attack is tainted collateral UTxOs. On the Cardano blockchain, a collateral must be put into a transaction to be taken if the transaction fails when being placed into the block. The collateral has to be on a payment credential which means that the collateral UTxO by definition isn't anonymous and the ownership is known the entire time. This means that an outside user could track a user's actions by simply watching which collaterals were used during transactions. -Privacy is preserved as long as $d$ is large and destroyed after use and the collateral used in the transaction is unconnectable to the original owner. This type of wallet can not be staked. +Privacy is preserved as long as $d$ is large and destroyed after use and the collateral used in the transaction is unconnectable to the original owner. ## Happy Path Testing Scripts @@ -198,8 +198,8 @@ Spendability is always in the hands of the original owner. If two UTxOs are bein ## Defeating The Collateral Problem -- TODO +The `seedelf-cli` uses the [Cardano collateral provider](https://giveme.my/). Every user will share the same collateral UTxO thus defeating the collateral problem. -## The Seedelf Application +## The **seedelf-cli** -- TODO \ No newline at end of file +Users can interact with the wallet protocol via the [seedelf-cli](./seedelf-cli/). \ No newline at end of file diff --git a/RELEASE.md b/RELEASE.md index a810878..4a174bd 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,9 +1,14 @@ # Release -Update version in `aiken.toml` and `seedelf-cli/Cargo.toml`. +Change the version then run the command in the parent folder. ```bash +# set the version version="0.2.2" +# update the toml files +sed -i '0,/^version = ".*"/s//version = "'${version}'"/' aiken.toml +sed -i '0,/^version = ".*"/s//version = "'${version}'"/' seedelf-cli/Cargo.toml +# add, commit, and tag out git add . git commit -m "chore: tagging new release" git push origin main diff --git a/scripts/.env b/happy-path-scripts/.env similarity index 100% rename from scripts/.env rename to happy-path-scripts/.env diff --git a/scripts/.env.mainnet b/happy-path-scripts/.env.mainnet similarity index 100% rename from scripts/.env.mainnet rename to happy-path-scripts/.env.mainnet diff --git a/scripts/.env.preprod b/happy-path-scripts/.env.preprod similarity index 100% rename from scripts/.env.preprod rename to happy-path-scripts/.env.preprod diff --git a/scripts/.env.sancho b/happy-path-scripts/.env.sancho similarity index 100% rename from scripts/.env.sancho rename to happy-path-scripts/.env.sancho diff --git a/scripts/.gitignore b/happy-path-scripts/.gitignore similarity index 100% rename from scripts/.gitignore rename to happy-path-scripts/.gitignore diff --git a/scripts/00_createScriptReferences.sh b/happy-path-scripts/00_createScriptReferences.sh similarity index 100% rename from scripts/00_createScriptReferences.sh rename to happy-path-scripts/00_createScriptReferences.sh diff --git a/scripts/README.md b/happy-path-scripts/README.md similarity index 100% rename from scripts/README.md rename to happy-path-scripts/README.md diff --git a/scripts/all_balances.sh b/happy-path-scripts/all_balances.sh similarity index 100% rename from scripts/all_balances.sh rename to happy-path-scripts/all_balances.sh diff --git a/scripts/create_wallet.sh b/happy-path-scripts/create_wallet.sh similarity index 100% rename from scripts/create_wallet.sh rename to happy-path-scripts/create_wallet.sh diff --git a/scripts/data.file b/happy-path-scripts/data.file similarity index 100% rename from scripts/data.file rename to happy-path-scripts/data.file diff --git a/scripts/data/exe_units.json b/happy-path-scripts/data/exe_units.json similarity index 100% rename from scripts/data/exe_units.json rename to happy-path-scripts/data/exe_units.json diff --git a/scripts/data/path_to_cli.sh b/happy-path-scripts/data/path_to_cli.sh similarity index 100% rename from scripts/data/path_to_cli.sh rename to happy-path-scripts/data/path_to_cli.sh diff --git a/scripts/data/path_to_socket.sh b/happy-path-scripts/data/path_to_socket.sh similarity index 100% rename from scripts/data/path_to_socket.sh rename to happy-path-scripts/data/path_to_socket.sh diff --git a/scripts/data/pointer/metadata.json b/happy-path-scripts/data/pointer/metadata.json similarity index 100% rename from scripts/data/pointer/metadata.json rename to happy-path-scripts/data/pointer/metadata.json diff --git a/scripts/data/pointer/pointer-redeemer.json b/happy-path-scripts/data/pointer/pointer-redeemer.json similarity index 100% rename from scripts/data/pointer/pointer-redeemer.json rename to happy-path-scripts/data/pointer/pointer-redeemer.json diff --git a/scripts/data/wallet/change-wallet-datum.json b/happy-path-scripts/data/wallet/change-wallet-datum.json similarity index 100% rename from scripts/data/wallet/change-wallet-datum.json rename to happy-path-scripts/data/wallet/change-wallet-datum.json diff --git a/scripts/data/wallet/receiver-wallet-datum.json b/happy-path-scripts/data/wallet/receiver-wallet-datum.json similarity index 100% rename from scripts/data/wallet/receiver-wallet-datum.json rename to happy-path-scripts/data/wallet/receiver-wallet-datum.json diff --git a/scripts/data/wallet/wallet-datum.json b/happy-path-scripts/data/wallet/wallet-datum.json similarity index 100% rename from scripts/data/wallet/wallet-datum.json rename to happy-path-scripts/data/wallet/wallet-datum.json diff --git a/scripts/data/wallet/wallet-redeemer.json b/happy-path-scripts/data/wallet/wallet-redeemer.json similarity index 100% rename from scripts/data/wallet/wallet-redeemer.json rename to happy-path-scripts/data/wallet/wallet-redeemer.json diff --git a/scripts/seedelf/.gitignore b/happy-path-scripts/seedelf/.gitignore similarity index 100% rename from scripts/seedelf/.gitignore rename to happy-path-scripts/seedelf/.gitignore diff --git a/scripts/seedelf/00_checkBalance.sh b/happy-path-scripts/seedelf/00_checkBalance.sh similarity index 100% rename from scripts/seedelf/00_checkBalance.sh rename to happy-path-scripts/seedelf/00_checkBalance.sh diff --git a/scripts/seedelf/01_createAddress.sh b/happy-path-scripts/seedelf/01_createAddress.sh similarity index 100% rename from scripts/seedelf/01_createAddress.sh rename to happy-path-scripts/seedelf/01_createAddress.sh diff --git a/scripts/seedelf/02_burnAddress.sh b/happy-path-scripts/seedelf/02_burnAddress.sh similarity index 100% rename from scripts/seedelf/02_burnAddress.sh rename to happy-path-scripts/seedelf/02_burnAddress.sh diff --git a/scripts/seedelf/03_sendToSeedElf.sh b/happy-path-scripts/seedelf/03_sendToSeedElf.sh similarity index 100% rename from scripts/seedelf/03_sendToSeedElf.sh rename to happy-path-scripts/seedelf/03_sendToSeedElf.sh diff --git a/scripts/seedelf/04_spendFunds.sh b/happy-path-scripts/seedelf/04_spendFunds.sh similarity index 100% rename from scripts/seedelf/04_spendFunds.sh rename to happy-path-scripts/seedelf/04_spendFunds.sh diff --git a/scripts/seedelf/backend/.gitignore b/happy-path-scripts/seedelf/backend/.gitignore similarity index 100% rename from scripts/seedelf/backend/.gitignore rename to happy-path-scripts/seedelf/backend/.gitignore diff --git a/scripts/seedelf/backend/__init__.py b/happy-path-scripts/seedelf/backend/__init__.py similarity index 100% rename from scripts/seedelf/backend/__init__.py rename to happy-path-scripts/seedelf/backend/__init__.py diff --git a/scripts/seedelf/backend/bls12_381.py b/happy-path-scripts/seedelf/backend/bls12_381.py similarity index 100% rename from scripts/seedelf/backend/bls12_381.py rename to happy-path-scripts/seedelf/backend/bls12_381.py diff --git a/scripts/seedelf/backend/find.py b/happy-path-scripts/seedelf/backend/find.py similarity index 100% rename from scripts/seedelf/backend/find.py rename to happy-path-scripts/seedelf/backend/find.py diff --git a/scripts/seedelf/backend/requirements.txt b/happy-path-scripts/seedelf/backend/requirements.txt similarity index 100% rename from scripts/seedelf/backend/requirements.txt rename to happy-path-scripts/seedelf/backend/requirements.txt diff --git a/scripts/seedelf/backend/setup.sh b/happy-path-scripts/seedelf/backend/setup.sh similarity index 100% rename from scripts/seedelf/backend/setup.sh rename to happy-path-scripts/seedelf/backend/setup.sh diff --git a/scripts/seedelf/backend/tx_simulation.py b/happy-path-scripts/seedelf/backend/tx_simulation.py similarity index 100% rename from scripts/seedelf/backend/tx_simulation.py rename to happy-path-scripts/seedelf/backend/tx_simulation.py diff --git a/scripts/seedelf/backend/value.py b/happy-path-scripts/seedelf/backend/value.py similarity index 100% rename from scripts/seedelf/backend/value.py rename to happy-path-scripts/seedelf/backend/value.py diff --git a/scripts/seedelf/backend/wallet.py b/happy-path-scripts/seedelf/backend/wallet.py similarity index 100% rename from scripts/seedelf/backend/wallet.py rename to happy-path-scripts/seedelf/backend/wallet.py diff --git a/scripts/seedelf/query.sh b/happy-path-scripts/seedelf/query.sh similarity index 100% rename from scripts/seedelf/query.sh rename to happy-path-scripts/seedelf/query.sh diff --git a/scripts/send_all.sh b/happy-path-scripts/send_all.sh similarity index 100% rename from scripts/send_all.sh rename to happy-path-scripts/send_all.sh diff --git a/scripts/submit_tx.sh b/happy-path-scripts/submit_tx.sh similarity index 100% rename from scripts/submit_tx.sh rename to happy-path-scripts/submit_tx.sh diff --git a/lib/schnorr.ak b/lib/schnorr.ak index 2fa85bf..456320f 100644 --- a/lib/schnorr.ak +++ b/lib/schnorr.ak @@ -8,9 +8,9 @@ use aiken/primitive/bytearray /// The value x is a secret integer used to create the public value from the /// generator. pub type Register { - // the generator, # + /// the generator, # generator: ByteArray, - // the public value, # + /// the public value, # public_value: ByteArray, } @@ -18,11 +18,11 @@ pub type Register { /// computed using the Fiat-Shamir heuristic. The vkh is used as a one time /// pad for the proof to prevent rollback attacks. pub type Proof { - // this is z = r + c * x as a bytearray + /// this is z = r + c * x as a bytearray z_b: ByteArray, - // this is the g^r compressed G1Element + /// this is the g^r compressed G1Element g_r_b: ByteArray, - // this vkh is used as a one time pad + /// this vkh is used as a one time pad vkh: VerificationKeyHash, } diff --git a/seedelf-cli/README.md b/seedelf-cli/README.md index 5efcdca..f460a8c 100644 --- a/seedelf-cli/README.md +++ b/seedelf-cli/README.md @@ -1,26 +1,32 @@ -# Seedelf CLI +# **seedelf-cli** -Seedelf is a stealth wallet that hides the receiver and spender. +The `seedelf-cli` is a rust implementation of the stealth wallet. It uses [Cardano collateral provider](https://giveme.my/), [Koios](https://www.koios.rest/), and [Pallas](https://github.com/txpipe/pallas). The wallet is primarily terminal base but it does use a static HTML web interface for CIP30 funding when required. ## Installation -Installing on path +First, clone the repo and enter the cli subfolder. +```bash +git clone https://github.com/logical-mechanism/Seedelf-Wallet +cd Seedelf-Wallet/seedelf-cli +``` +Installing on path: ```bash cargo install --path . ``` -Building for release +Building for release: ```bash cargo build --release ``` -Locally running it +Running it locally: ```bash cargo build -cargo run -- help ``` +Precompile binaries are available for Linux, Windows, and MacOS. These may be found in the latest release. + ## Using The Seedelf CLI ```bash @@ -51,4 +57,6 @@ Options: Create a Seedelf with the `seedelf-new` command. The Seedelf is funded with the `fund` command. Send funds to another Seedelf with the `transfer` command. Funds can be send to an address with the `sweep` command. Use the `--help` option to see more information. -Some commands will prompt to open a localhost for cip30 wallet interaction. \ No newline at end of file +**Some commands will prompt to open a localhost for cip30 wallet interaction.** + +The wallet will create a secret key file on the local machine inside the home directory under the .seedelf folder. The wallet will prompt the user at first use to name the secrey key file. Keep this file safe! \ No newline at end of file