Tap Faucet Endpoint

Learn how to dispense satoshis from your Droplit instance.

Tap Faucet Endpoint

This endpoint allows you to "tap" the droplit, dispensing a pre-configured amount of satoshis to a specified Bitcoin SV address. This functionality is only available if the droplit has been configured with a drop_sats value greater than 0.

  • Endpoint: POST /faucet/{droplitName}/tap
    • Replace {droplitName} with the name of your Droplit.
  • Authentication: Required (see Authentication)

Conditional Availability

The "Tap" functionality depends on the Droplit's configuration. If drop_sats is not set or is zero, this endpoint will likely return an error or indicate that tapping is not enabled. The satoshis value in the request body should match the Droplit's configured drop_sats amount.

Request Body

The request body must be a JSON object with the following structure:

{
  "recipient_address": "your_bsv_address",
  "satoshis": 1000 // This should match the Droplit's configured tap amount
}
  • recipient_address: The Bitcoin SV address to which the satoshis will be sent.
  • satoshis: The amount of satoshis to dispense. This must match the drop_sats value configured for the Droplit.

Example: JavaScript with BRC-103/104

import { AuthFetch, PrivateKey, ProtoWallet } from "@bsv/sdk";

async function tapDroplitFaucet() {
	const droplitName = "your-droplit-name";
	const wallet = new ProtoWallet(
		PrivateKey.fromWif(process.env.DROPLIT_SIGNER_WIF),
	);
	const client = new AuthFetch(wallet);
	const response = await client.fetch(
		`${process.env.DROPLIT_API_URL}/faucet/${droplitName}/tap`,
		{
			method: "POST",
			headers: { "Content-Type": "application/json" },
			body: JSON.stringify({
				recipient_address: "1...",
				satoshis: 1000,
			}),
		},
	);

	if (!response.ok) throw new Error(await response.text());
	console.log("Tap successful:", await response.json());
}

await tapDroplitFaucet();

For Sigma-hosted app flows, use Sigma signing directly and avoid storing WIFs in your application.

Success Response

On success, the API returns a JSON object containing the transaction ID (txid) of the Bitcoin transaction that paid the recipient.

{
  "txid": "abcdef123456..."
}

Error Responses

Common errors include:

  • 400 Bad Request: Invalid request body, parameters (e.g., satoshis amount mismatch), or recipient address.
  • 401 Unauthorized: BRC-103/104 authentication failed.
  • 403 Forbidden or 422 Unprocessable Entity: Tapping not enabled for the Droplit, or insufficient funds.
  • 500 Internal Server Error: Server-side issue.

The error response body will typically contain a JSON object with an error or message field.