GithubHelp home page GithubHelp logo

alexk111 / one-time-address Goto Github PK

View Code? Open in Web Editor NEW
65.0 5.0 6.0 335 KB

๐Ÿท A better way to share your Bitcoin address.

License: MIT License

JavaScript 37.79% Handlebars 62.21%
bitcoin bitcoin-payment bitcoin-address payments

one-time-address's Introduction

One-Time Address

A better way to share your Bitcoin address


One-Time Address is a self-hosted, open-source service which turns your Bitcoin wallets into webpages and embeddable widgets that instantly provide an address with a QR code whenever someone wants to send you Bitcoin.

One-Time Address never shows the same address twice and thus helps to prevent address reuse. You should not reuse addresses because it abuses the privacy and security of the participants of the transactions as well as future holders of their value.

Note #1: If the same visitor requests an address multiple times within a short period, he might see an address generated for him last time instead of a new one. This prevents wallets from bloating with repetitive requests.

Note #2: It is not intended for use in e-commerce or when it's needed to trigger execution of other processes after the payment is done. One-Time Address provides the instant access to a one-time Bitcoin address and nothing else. If you need more features, then consider using BTCPay Server.

Live Demo

Demo webpage: https://donate.alexkaul.com/one-time-address

Installing

# clone repo
git clone https://github.com/alexk111/One-Time-Address

# navigate to it
cd One-Time-Address

# install dependencies
yarn install

# add env variables
cp .env.prod .env

# add wallets config
cp wallets.js.sample wallets.js

Edit .env:

  • Update SERVER_HOST and SERVER_PORT if needed

Edit wallets.js:

  • Enter info for your wallets

Checking wallets

# check if your BTC wallet is generating the same addresses
yarn run check my-wallet

Running

# running http server
yarn start

Getting stats

# get stats on how many addresses have been already used
yarn run stats my-wallet

Address Cache

One-Time Address keeps generated addresses and visitor IPs in the cache for up to N minutes (5 by default). If the same visitor refreshes the same wallet page within the interval, an address will be returned from the cache instead of generating a new one. This prevents wallets from being bloated with repetitive or automated requests. The interval can be edited with addrIPCacheMins in wallets.js file. Set 0 to disable the cache.

Gap Limit Issue

Since One-Time Address provides every visitor with a new Bitcoin address, you might find yourself in a situation where more than 20 addresses in a row will have zero transactions. This will cause an Account Discovery issue when received funds don't appear in your Bitcoin wallet. Available workarounds:

Using HD Wallet Scanner

HD Wallet Scanner finds all used addresses in your Bitcoin HD wallets bypassing gap limits. Then you might use Bitcoin Core + HWI (if you use a hardware wallet) to import child keys derived with their indexes.

Using Electrum wallet

Electrum wallet allows increasing Gap Limit. Open the Console tab and use the following commands at prompt: wallet.change_gap_limit(200) and press enter at your keyboard, wallet.storage.write() and press enter again. Then restart the client. To view/verify the current gap limit, type the following in the console: wallet.gap_limit.

Using Wasabi wallet

If you are showing bech32 addresses, then you might use Wasabi wallet. It also allows increasing Gap Limit. The wallet file can be modified from File/Open/Wallet Folder. To change the gap limit, update MinGapLimit json property in the wallet file.

Backers ๐Ÿ’

Backer Backer Backer Backer Backer Backer Backer Backer Backer Backer

Thank you for your support! ๐Ÿ™Œ [Donate]

License

MIT ยฉ Alex Kaul

one-time-address's People

Contributors

alexk111 avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

one-time-address's Issues

RE Note #2. Why not?

Cool work.

I've used BTCPayServer. Wasn't in love with it. Clunky to deploy and limited in customization.

Found this as a possible module for a larger but lean modular JS/TS BTC payment gateway. Would need a bitcoind node plus a NodeJS interface to manage wallets, customers, invoice lifecycles, webhooks, etc. Then some sort of wrapper maybe electron, docker or just package into executable.

Thoughts?

Add documentation around the gap limit

The README states

One-Time Address never shows the same address twice

Without looking at the code, it is not clear how the gap limit is handled. If the derivation index is simply incremented on each page load, the gap can become arbitrarily big, or higher than the wallet owner might expect.

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.