Skip to content

Instantly share code, notes, and snippets.

@ben221199
Last active January 8, 2025 09:33
Show Gist options
  • Save ben221199/697bc47d4d8ee110eb650390793c1ab6 to your computer and use it in GitHub Desktop.
Save ben221199/697bc47d4d8ee110eb650390793c1ab6 to your computer and use it in GitHub Desktop.
LBRY

LBRY Database

Prefix Row Prefix Key Key Parameters Value Value parameters Conditions
ClaimToSupportPrefixRow K ClaimToSupportKey claim_hash,tx_num,position ClaimToSupportValue amount PUT: every output with support claim and matching normalized name
SupportToClaimPrefixRow L SupportToClaimKey tx_num,position SupportToClaimValue claim_hash PUT: every output with support claim and matching normalized name
ClaimToTXOPrefixRow E ClaimToTXOKey claim_hash ClaimToTXOValue tx_num,position,root_tx_num,root_position,amount,activation,channel_signature_is_valid,name
TXOToClaimPrefixRow G TXOToClaimKey tx_num,position TXOToClaimValue claim_hash,name
ClaimToChannelPrefixRow I ClaimToChannelKey claim_hash,tx_num,position ClaimToChannelValue signing_hash
ChannelToClaimPrefixRow J ChannelToClaimKey signing_hash,name,tx_num,position ChannelToClaimValue claim_hash
ClaimShortIDPrefixRow F ClaimShortIDKey normalized_name,partial_claim_id,root_tx_num,root_position ClaimShortIDValue tx_num,position
BidOrderPrefixRow D BidOrderKey normalized_name,effective_amount,tx_num,position BidOrderValue claim_hash
ClaimExpirationPrefixRow O ClaimExpirationKey expiration,tx_num,position ClaimExpirationValue claim_hash,normalized_name
ClaimTakeoverPrefixRow P ClaimTakeoverKey normalized_name ClaimTakeoverValue claim_hash,height
PendingActivationPrefixRow Q PendingActivationKey height,txo_type,tx_num,position PendingActivationValue claim_hash,normalized_name
ActivatedPrefixRow R AcitvationKey txo_type,tx_num,position ActivationValue height,claim_hash,normalized_name
ActiveAmountPrefixRow S ActiveAmountKey claim_hash,txo_type,activation_height,tx_num,position ActiveAmountValue amount
RepostPrefixRow V RepostKey claim_hash RepostValue reposted_claim_hash
RepostedPrefixRow W RepostedKey reposted_claim_hash,tx_num,position RepostedValue claim_hash
UndoPrefixRow M UndoKey height,block_hash - Raw data
TouchedOrDeletedPrefixRow Y TouchedOrDeletedClaimKey height TouchedOrDeletedClaimValue touched_claims,deleted_claims
TXPrefixRow B TxKey tx_hash TxValue raw_tx PUT: every transaction
BlockHashPrefixRow C BlockHashKey height BlockHashValue block_hash PUT: every block
BlockHeaderPrefixRow H BlockHeaderKey height BlockHeaderValue header PUT: every block
TXNumPrefixRow N TxNumKey tx_hash TxNumValue tx_num PUT: every transaction
TxCountPrefixRow T TxCountKey height TxCountValue tx_count PUT: every block
TXHashPrefixRow X TxHashKey tx_num TxHashValue tx_hash PUT: every transaction
UTXOPrefixRow u UTXOKey hashX,tx_num,nout UTXOValue amount DELETE: every non-generation input

PUT: every output
HashXUTXOPrefixRow h HashXUTXOKey short_tx_hash,tx_num,nout HashXUTXOValue hashX DELETE: every non-generation input

PUT: every output
HashXHistoryPrefixRow x HashXHistoryKey hashX,height - Array of tx_num (unsigned int32)
DBStatePrefixRow s - - DBState genesis,height,tx_count,tip,utxo_flush_count,wall_time,bit_fields,db_version,hist_flush_count,comp_flush_count,comp_cursor,es_sync_height,hashX_status_last_indexed_height
ChannelCountPrefixRow Z ChannelCountKey channel_hash ChannelCountValue count
SupportAmountPrefixRow a SupportAmountKey claim_hash SupportAmountValue amount
BlockTxsPrefixRow b BlockTxsKey height BlockTxsValue tx_hashes PUT: every block
TrendingNotificationPrefixRow c TrendingNotificationKey height,claim_hash TrendingNotificationValue previous_amount,new_amount
MempoolTXPrefixRow d MempoolTxKey tx_hash MempoolTxValue raw_tx
TouchedHashXPrefixRow e TouchedHashXKey height TouchedHashXValue touched_hashXs PUT: every block
HashXStatusPrefixRow f HashXStatusKey hashX HashXStatusValue status
HashXMempoolStatusPrefixRow g HashXStatusKey hashX HashXStatusValue status
RepostedCountPrefixRow j RepostedCountKey claim_hash RepostedCountValue reposted_count
EffectiveAmountPrefixRow i EffectiveAmountKey claim_hash EffectiveAmountValue activated_sum,activated_support_sum
FutureEffectiveAmountPrefixRow k FutureEffectiveAmountKey claim_hash FutureEffectiveAmountValue future_effective_amount
HashXHistoryHasherPrefixRow l HashXHistoryHasherKey hashX HashXHistoryHasherValue hasher

LBRY Protocols

Name Default Port LBRY-specific Port Description
Blob 3333/TCP
4444/TCP
Yes
DHT 4444/UDP Yes
SDK RPC 5279 Yes Localhost RPC to talk to the SDK. Used by LBRY Desktop to get all claim info.
SDK Media 5280 Yes Localhost media/streaming server. Used by LBRY Desktop to get all media files.
Reflector Upload 5566 Yes
Reflector Download 5567 Yes
BitTorrent Local Discovery 6771 No
Blockchain RPC 9245 Yes RPC to talk to the blockchain. Used by the hub to synchronize the database.
Blockchain P2P 9246 Yes Protocol between the blockchain nodes.
Tracker 9252 Yes
Reflector Cluster 17946/TCP Yes -
Hub Ping 50001/UDP No
Hub 50001/TCP No BIP 40 compatible SPV server with LBRY extensions. Used by the SDK to get all claim info.
Hub SSL 50002/TCP No Same as Hub, but over SSL/TLS.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment