Skip to content

Latest commit

 

History

History
88 lines (60 loc) · 2.92 KB

README.md

File metadata and controls

88 lines (60 loc) · 2.92 KB

Twelve Cash

Twelve Cash

This is an attempt to encode bitcoin payment instructions, specifically BOLT 12 offers, into DNS records. For users, this means something that looks like [email protected], but resolves to a BOLT12 offer when a BOLT12 supporting wallet attempts to pay to it.

This is an implementation of BIP-353. Inititally inspired by Bastien Teinturier's post Lightning Address in a Bolt 12 world.

How to Use

Create a User Name

Hit the API endpoint https://twelve.cash/v2/record with a POST request containing the payload:

{
    "domain": "twelve.cash",
    "lno": "lno123...xyz",
    "sp": "sp123...xyz",
    "onChain": "bc1p...xyz",
    "custom": [
        {
            "prefix": "lnurl",
            "value": "lnur123...xyz"
        },
        {
            "prefix": "mystory",
            "value": "Bitcoin ipsum dolor sit amet."
        }
    ]
}

Lookup a User Name

You can verify that this worked by opening a shell and running:

dig txt stephen.user._bitcoin-payment.twelve.cash

The expected output should be:

stephen.user._bitcoin-payment.twelve.cash. 3600 IN TXT "bitcoin:?lno=lno1pgg8getnw3q8gam9d3mx2tnrv9eks93pqw7dv89vg89dtreg63cwn4mtg7js438yk3alw3a43zshdgsm0p08q"

Validate a User Name

For this, we rely on the dnssec-prover tool from TheBlueMatt. This (or something like it) should be built into any tool that facilitates payments to Twelve Cash addresses. However, we have exposed this on our website frontend so you can experiment and validate these addresses.

Roadmap

  • Create API for adding bitcoin payment instructions to DNS records
  • Create Web UI for creating user names
  • Integrate API into popular bitcoin wallet - Zeus
  • Add support for DNSSEC
  • Follow BIP Draft progress and update TwelveCash as the spec matures
  • Create easy way for users to edit/update their Twelve Cash user name

Development

You can use this tool with Cloudflare DNS API.

Cloudflare

  • Setup your domain with DNSSEC - Docs
  • Create an API token in Cloudflare, giving it access to your domain name
  • In the .env file, add your Cloudflare API token and domain ID (which you can find by clicking on your domain name in Cloudflare and scrolling down the page)

Running the Dev Server

Start up the database:

./start-database.sh

Create the Prisma client and push it to the database:

yarn postinstall
yarn db:push

Run the development server:

yarn dev

Open http://localhost:3000 with your browser to see the result.