Git Product home page Git Product logo

gonuts's Introduction

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.

Don't be reckless: This project is in early development, it does however work with real sats! Always use amounts you don't mind losing.

gonuts

Cashu wallet and mint implementation in Go.

Cashu is a free and open-source Chaumian ecash system built for Bitcoin. You can read more about it here.

Supported NUTs

Implemented NUTs:

Installation

With Go installed, you can run the following command to install the wallet:

go install github.com/elnosh/gonuts/cmd/nutw@latest

Warning: By default, the wallet will be setup with the mint https://8333.space:3338. That is a public test mint for demonstration purposes and could vanish at any moment.

To setup the wallet with a different mint, create a .env file at ~/.gonuts/wallet/.env and setup your preferred mint.

Using the wallet

Check balance

nutw balance

Create a Lightning invoice to receive ecash

nutw mint 100

This will get an invoice from the mint which you can then pay and use to mint new ecash.

invoice: lnbc100n1pja0w9pdqqx...

Redeem the ecash after paying the invoice

nutw mint --invoice lnbc100n1pja0w9pdqqx...

Send tokens

nutw send 21

This will generate a Cashu token that looks like this:

cashuAeyJ0b2tlbiI6W3sibW...

This is the ecash that you can then send to anyone.

Receive tokens

nutw receive cashuAeyJ0b2tlbiI6W3...

Request the mint to pay a Lightning invoice

nutw pay lnbc100n1pju35fedqqsp52xt3...

Development

Requirements

Wallet

  • cd cmd/nutw
  • create .env file and fill in the values
  • go build -v -o nutw nutw.go

Run mint

  • cd cmd/mint

  • you'll need to setup a lightning regtest environment with something like Polar and fill in the values in the .env file

  • go build -v -o mint mint.go

  • ./mint

Contribute

All contributions are welcome.

If you want to contribute, please open an Issue or a PR.

gonuts's People

Contributors

elnosh avatar findingsov avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.