Check a batch of Decred ticket hashes without downloading the live pool

When a service tracks a few hundred ticket purchases, querying membership for its own hashes is cheaper than repeatedly transferring the full live-ticket list. The compact reply needs deliberate decoding.

Preserve the request order

Place the ticket purchase transaction hashes in TICKET_A and TICKET_B. Send a JSON array and retain its exact order in the caller. The node returns a hexadecimal bitset of membership results rather than a JSON array of booleans.

hashes=$(jq -cn --arg first "$TICKET_A" --arg second "$TICKET_B" '[$first,$second]')
dcrctl existslivetickets "$hashes"

Test the decoder with a known member

Compare one test batch against a livetickets snapshot at the same tip. Check mixed membership as well as all-zero results before using the bitset in a dashboard. A ticket absent from the live set might be immature, voted, missed or expired. This method alone cannot assign its lifecycle stage.

github.com existslivetickets · github.com livetickets