معرفی شرکت ها


cashu-0.4.2


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Ecash wallet and mint with Bitcoin Lightning support
ویژگی مقدار
سیستم عامل OS Independent
نام فایل cashu-0.4.2
نام cashu
نسخه کتابخانه 0.4.2
نگهدارنده []
ایمیل نگهدارنده []
نویسنده Calle
ایمیل نویسنده calle@protonmail.com
آدرس صفحه اصلی https://github.com/callebtc/cashu
آدرس اینترنتی https://pypi.org/project/cashu/
مجوز MIT
# cashu **Cashu is a Chaumian Ecash wallet and mint with Bitcoin Lightning support.** <a href="https://pypi.org/project/cashu/"><img alt="Release" src="https://img.shields.io/pypi/v/cashu?color=black"></a> <a href="https://pypi.org/project/cashu/"><img alt="Coverage" src="https://img.shields.io/pypi/dm/cashu"></a> <a href="https://app.codecov.io/gh/callebtc/cashu"><img alt="Coverage" src="https://img.shields.io/codecov/c/gh/callebtc/cashu"></a> *Disclaimer: The author is NOT a cryptographer and this work has not been reviewed. This means that there is very likely a fatal flaw somewhere. Cashu is still experimental and not production-ready.* Cashu is an Ecash implementation based on David Wagner's variant of Chaumian blinding. Token logic based on [minicash](https://github.com/phyro/minicash) ([description](https://gist.github.com/phyro/935badc682057f418842c72961cf096c)) which implements a [Blind Diffie-Hellman Key Exchange](https://cypherpunks.venona.com/date/1996/03/msg01848.html) scheme written down by Ruben Somsen [here](https://gist.github.com/RubenSomsen/be7a4760dd4596d06963d67baf140406). The database mechanics and the Lightning backend uses parts from [LNbits](https://github.com/lnbits/lnbits-legend). <p align="center"> <a href="#cashu-client-protocol">Cashu client protocol</a> · <a href="#easy-install">Quick Install</a> · <a href="#hard-install-poetry">Manual install</a> · <a href="#configuration">Configuration</a> · <a href="#using-cashu">Using Cashu</a> · <a href="#running-a-mint">Run a mint</a> </p> ## Cashu client protocol There are ongoing efforts to implement alternative Cashu clients that use the same protocol such as a [Cashu Javascript wallet](https://github.com/motorina0/cashu-js-wallet). If you are interested in helping with Cashu development, please see the [docs](docs/) for the notation and conventions used. ## Easy Install The easiest way to use Cashu is to install the package it via pip: ```bash pip install cashu ``` To update Cashu, use `pip install cashu -U`. If you have problems running the command above on Ubuntu, run `sudo apt install -y pip pkg-config`. On macOS, you might have to run `pip install wheel` and `brew install pkg-config`. You can skip the entire next section about Poetry and jump right to [Using Cashu](#using-cashu). ## Hard install: Poetry These steps help you install Python via pyenv and Poetry. If you already have Poetry running on your computer, you can skip this step and jump right to [Install Cashu](#poetry-install-cashu). #### Poetry: Prerequisites ```bash sudo apt install -y build-essential pkg-config libffi-dev libpq-dev zlib1g-dev libssl-dev python3-dev # on mac: brew install postgres # install python using pyenv curl https://pyenv.run | bash # !! follow the instructions of pyenv init to setup pyenv !! pyenv init # restart your shell (or source your .rc file), then install python: pyenv install 3.9.13 # install poetry curl -sSL https://install.python-poetry.org | python3 - echo export PATH=\"$HOME/.local/bin:$PATH\" >> ~/.bashrc source ~/.bashrc ``` #### Poetry: Install Cashu ```bash # install cashu git clone https://github.com/callebtc/cashu.git cd cashu pyenv local 3.9.13 poetry install ``` #### Poetry: Update Cashu To update Cashu to the newest version enter ```bash git pull && poetry install ``` #### Poetry: Using Cashu Cashu should be now installed. To execute the following commands, activate your virtual Poetry environment via ```bash poetry shell ``` If you don't activate your environment, just prepend `poetry run` to all following commands. ## Configuration ```bash mv .env.example .env # edit .env file vim .env ``` To use the wallet with the [public test mint](#test-instance), you need to change the appropriate entries in the `.env` file. #### Test instance *Warning: this instance is just for demonstration only. Currently, only Lightning deposits work but not withdrawals. The server could vanish at any moment so consider any Satoshis you deposit a donation. I will add Lightning withdrawals soon so unless someone comes up with a huge inflation bug, you might be able to claim them back at a later point in time.* Change the appropriate `.env` file settings to ```bash MINT_HOST=8333.space MINT_PORT=3338 ``` # Using Cashu ```bash cashu info ``` Returns: ```bash Version: 0.4.2 Debug: False Cashu dir: /home/user/.cashu Wallet: wallet Mint URL: https://8333.space:3338 ``` #### Get Cashu info ```bash cashu balance ``` #### Check balance ```bash cashu balance ``` #### Generate a Lightning invoice This command will return a Lightning invoice that you need to pay to mint new ecash tokens. ```bash cashu invoice 420 ``` Returns: ```bash Pay this invoice to mint 420 sat: Invoice: lnbc4200n1p3nfk7zsp522g8wlsx9cvmhtyuyuae48nvreew9x9f8kkqhd2v2umrdtwl2ysspp5w2w6jvcnz4ftcwsxtad5kv3yev62pcp5cvq42dqqrmwtr2k6mk8qdq4vdshx6r4ypjx2ur0wd5hgxqyjw5qcqpjrzjqfe5jlwxmwt4sa4s8mqjqp8qtreqant6mqwwkts46dtawvncjwvhczurxgqqvvgqqqqqqqqnqqqqqzgqyg9qyysgqzaus4lsfs3zzk4ehdzrkxzv8ryu2yxppxyjrune3nks2dgrnua6nv7lsztmyjaf96xp569tf7rxdmfud5q45zmr4xue5hjple6xhcrcpfmveag Execute this command if you abort the check: cashu invoice 420 --hash 729da933131552bc3a065f5b4b3224cb34a0e034c3015534001edcb1aadadd8e Checking invoice ... ``` The client will check every few seconds if the invoice has been paid. If you abort this step but still pay the invoice, you can use the command `cashu invoice <amount> --hash <hash>` as described above. #### Pay a Lightning invoice ```bash cashu pay lnbc120n1p3jfmdapp5r9jz... ``` Returns: ```bash Balance: 351 sat (Available: 351 sat in 7 tokens) Balance: 339 sat (Available: 339 sat in 8 tokens) ``` #### Send tokens To send tokens to another user, enter ```bash cashu send 69 ``` You should see the encoded token. Copy the token and send it to another user such as via email or a messenger. The token looks like this: ```bash W3siYW1vdW50IjogMSwgIkMiOiB7IngiOiAzMzg0Mzg0NDYzNzAwMTY1NDA2MTQxMDY3Mzg1MDg5MjA2MTU2NjQxMjM4Nzg5MDE4NzAzODg0NjAwNDUzNTAwNzY3... ``` You can now see that your available balance has dropped by the amount that you reserved for sending if you enter `cashu balance`: ```bash Balance: 420 sat (Available: 351 sat in 7 tokens) ``` #### Receive tokens To receive tokens, another user enters: ```bash cashu receive W3siYW1vdW50IjogMSwgIkMiOi... ``` You should see the balance increase: ```bash Balance: 0 sat (Available: 0 sat in 0 tokens) Balance: 69 sat (Available: 69 sat in 3 tokens) ``` #### Burn tokens The sending user needs to burn (invalidate) their tokens from above, otherwise they will try to double spend them (which won't work because the server keeps a list of all spent tokens): ```bash cashu burn W3siYW1vdW50IjogMSwgIkMiOi... ``` Returns: ```bash Balance: 420 sat (Available: 351 sat in 7 tokens) Balance: 351 sat (Available: 351 sat in 7 tokens) ``` Use `cashu burn -a` to burn all used tokens or `cashu burn -f` to force a spent recheck on all tokens and burn them is they are used. This command is safe to use, it won't burn unspent tokens. #### Check pending tokens ```bash cashu pending ``` Returns ```bash Amount: 64 sat Sent: 2022-09-28 06:53:03 ID: 33025ade-3efa-11ed-9096-16a10f0dbf61 W3siYW1vdW50Ijog... Amount: 64 sat Sent: 2022-09-28 06:57:25 ID: cf588354-3efa-11ed-b5ec-16a10f0dbf61 W3siYW1vdW50Ijog... Amount: 128 sat Sent: 2022-09-28 09:57:43 ID: fef371fa-3f13-11ed-b31a-16a10f0dbf61 W3siYW1vdW50Ij... Balance: 1234 sat (Available: 1234 sat in 7 tokens) ``` You can either burn these tokens manually when the receiver has redeemed them, or you can receive them yourself if you want to cancel a pending payment. # Running a mint This command runs the mint on your local computer. Skip this step if you want to use the [public test mint](#test-instance) instead. ```bash python -m cashu.mint ``` You can turn off Lightning support and mint as many tokens as you like by setting `LIGHTNING=FALSE` in the `.env` file.


نیازمندی

مقدار نام
==5.0.0 importlib-metadata
==3.9.0 zipp
==1.26.12 urllib3
==3.6.2 anyio
==22.1.0 attrs
==1.2.0 bech32
==3.1.9 bitstring
==2022.9.24 certifi
==1.15.1 cffi
==2.0.12 charset-normalizer
==8.0.4 click
==0.18.0 ecdsa
==9.5.0 environs
==0.83.0 fastapi
==0.12.0 h11
==3.4 idna
==1.1.1 iniconfig
==0.6.0 loguru
==3.18.0 marshmallow
==1.2.0 outcome
==21.3 packaging
==1.0.0 pluggy
==1.11.0 py
==2.21 pycparser
==1.10.2 pydantic
==3.0.9 pyparsing
==0.19.0 pytest-asyncio
==7.1.3 pytest
==0.11.2 python-bitcoinlib
==0.21.0 python-dotenv
==1.6.0.post0 represent
==2.27.1 requests
==0.14.0 secp256k1
==1.16.0 six
==1.3.0 sniffio
==0.17.0 sqlalchemy-aio
==1.3.24 sqlalchemy
==0.19.1 starlette
==2.0.1 tomli
==4.4.0 typing-extensions
==0.18.3 uvicorn
==0.4.5 colorama
==1.1.0 win32-setctime


زبان مورد نیاز

مقدار نام
>=3.7 Python


نحوه نصب


نصب پکیج whl cashu-0.4.2:

    pip install cashu-0.4.2.whl


نصب پکیج tar.gz cashu-0.4.2:

    pip install cashu-0.4.2.tar.gz