0

I am trying to find out the relation among dependent transactions in the mempool. I have already used the "depends" field and tracked the transaction ids to go through. But I still can not clearly figure out how and when this field is modified or updated to show the dependencies. I am looking for a scenario for that as well.

Thanks

0

getrawmempool

getrawmempool(true)

Returns all transaction ids in memory pool as a json array of string transaction ids. If we use verbose as 'true' it returns more than just transaction ids and one of the result is 'depends'.

"depends" : [(json array) unconfirmed transactions used as inputs for this transaction "hex",(string) parent transaction id]

Example:

"2004b140d4b4eb1048cdb7def895a211c279711e47cc402c64f91f1c0d20f0dc": {
    "fees": {
      "base": 0.00000446,
      "modified": 0.00000446,
      "ancestor": 0.00000892,
      "descendant": 0.00000446
    },
    "vsize": 142,
    "weight": 565,
    "fee": 0.00000446,
    "modifiedfee": 0.00000446,
    "time": 1598036451,
    "height": 1807966,
    "descendantcount": 1,
    "descendantsize": 142,
    "descendantfees": 446,
    "ancestorcount": 2,
    "ancestorsize": 284,
    "ancestorfees": 892,
    "wtxid": "4e680766ede2535b53e868c95d1483a443f9ab7f8b9d9ef4fcb355a768faba16",
    "depends": [
      "8b72e7045466d79a60ea13c9700b268ae0d695a7666008fc0c454775d7d95561"
    ],
    "spentby": [
    ],
    "bip125-replaceable": false
  }
}

Child transaction:

Child tx

Parent transaction which had Unconfirmed input in above case:

Parent tx

Both transactions got confirmed in block 1807995.

7
  • Thank you for your answer.
    – Motiv
    Aug 21 '20 at 19:44
  • Can I realize the "child pays for parent" scenario tracking this field?
    – Motiv
    Aug 21 '20 at 19:45
  • Yes if a transaction is dependent on other transaction and both get confirmed in the same block most probably because child tx used higher fee rate then its CPFP. Else its just one transaction dependent on another and can get confirmed in different blocks but be in the mempool at the same time for a while.
    – Prayank
    Aug 21 '20 at 19:54
  • Perfect. Many Thanks
    – Motiv
    Aug 21 '20 at 20:05
  • Hi, I have a follow-up question in this regard. Thank you in advance for helping me figure out my question. I would like to know how the mentioned fee rate will be calculated? From my point of view, it should be something to show the miner's incentive such as transaction fee/transaction size? The higher the fee and the smaller the transaction size is more appealing from a miner point of view. For considering CPFP scenario, should I consider transaction size or transaction weight for calculating fee rate or something else can be more applicable? Thank you for your time and attention.
    – Motiv
    Dec 31 '20 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.