Developer Guide
This guide explains how to properly create and submit transactions through Shield.
Creating Shield-Compatible Transactions
1. Get Payment Information
First, query the /info
endpoint to retrieve the current Shield payment address and fee rates:
This returns the payment address and several fee options with corresponding hashrate estimates.
2. Add Shield Output
Add an output to your transaction that pays the Shield payment address provided in the /info response. The amount can be 1 sat for now.
2. Calculate Required Fee
Choose a fee tier based on your confirmation urgency:
Higher fee tiers connect to more hashrate, increasing the chance of quick confirmation
The
estimated_hashrate
value (0-1) represents the approximate percentage of Bitcoin hashrate that will accept your transaction
Calculate your total fee by multiplying your transaction size in vbytes by your chosen fee rate:
3. Include the Shield Fee Output Value
Modify the output you created in your transaction to pay the calculated fee to the Shield payment address provided in the /info
response.
Example using Bitcoin Core:
4. Submit the Transaction
Submit your transaction using the /rpc
endpoint:
Best Practices
Always query current fees: Fee requirements may change based on network conditions
Use P2WPKH outputs: Native SegWit outputs (bech32) are more efficient and cheaper
Consider transaction size: Larger transactions require higher total fees
Choose appropriate fee rates: Balance confirmation speed with cost based on your needs
Test transactions: For high-value transactions, consider testing with small amounts first
Last updated