Posted on

lnbits-captcha-faucet, WordPress bitcoin faucet

Easily add a bitcoin faucet to your WordPress pages and posts!

This image has an empty alt attribute; its file name is EIXu1AIWwAEHNsR.pngI created the Sinclair Faucet back in late 2019. A simple form where you could charge a faucet and share as an lnurl QR code.  Within a few weeks people had created a range of scripts to repeatedly hit the faucets (amilking).

Later we created the LNURLw extension in LNbits, an easy way for people to create their own lnurl-withdraw links/faucets. We tried to counter amilking by adding a “unique” option. The “unique” variable meant each withdraw of the withdraw-link created a unique lnurl/QR code.  However people soon managed to bot their way around this one as well.

Clearly these bots needed a captcha!This image has an empty alt attribute; its file name is image-1.png

lnbits-captcha-faucet easy to add WordPress shortcode, that requires the completion of a captcha, which then hashes and checks the users IP. All this is made possible as LNURLw now has another endpoint so people can relate an withdraw-link with a hash before fetching, in this shortcodes case, the hash sent is the users hashed IP.

Installation

This image has an empty alt attribute; its file name is image-3.png

 
Upload the files/folders to your WordPress theme
 
Add include(‘lnbits_faucet_shortcode’); to the bottom of your themes functions.php
 
To use in a post/page use the shortcode:
faucet server=”https://lnbits.com” lnurl=”0m34g34gLNKM” key=”asrgeasrgserg453s45hg45h”
  • server: an LNbits server
  • key: LNbits wallet invoice key attached to lnurl-withdraw
  • lnurl: lnurl-withdraw id generated in LNbits

This image has an empty alt attribute; its file name is image-4.png

Important! ~ Change the $secret_key in lnbits_faucet_shortcode as this is the string that is used to encrypt data to pass through the front-end of your captcha.