What is differences of bitcoin mempool anchestor and descendant? is there a specific explanation about the differences between mempool anchestor dan descendants?

there are RPC commmand for "getmempoolanchestors" and "getmempooldescendents". What is mempool anchestor and decendents it self?

each node may have a different mempool size, but what are the differences of the mempool anchestor dan descendants?
Given a transaction, there are inputs to that transaction which are spent to new outputs. The inputs themselves are outputs from a previous transaction. E.g. in tx 1, person A sends BTC to person B. Then, in tx 2, person B uses those outputs to create another transaction to person C.

A -&gt; B
B -&gt; C

Transaction 1 is an ancestor of transaction 2, because without transaction 1, #2 is not valid (the outputs do not exist). Likewise, transaction 2 is a descendant of transaction 1.
The RPC commands let you list ancestors/descendants of any given transaction, which are in the mempool (have not been mined and included in a block yet).

getmempooldescendants &quot;txid&quot; ( verbose )
If txid is in the mempool, returns all in-mempool descendants.

See getmempooldescendants

getmempoolancestors &quot;txid&quot; ( verbose )

If txid is in the mempool, returns all in-mempool ancestors.
See getmempoolancestors