hash time locked contract – How one can examine the final commited transaction in c-lightning?

0
79


Taking part in with c-lightning on regtest I want to see the final legitimate transaction for a channel. The closest associated developer command I discovered to try this was dev-sign-last-tx.
It appears to provide what I would like, for instance if I’ve 4 nodes linked like this:

l1 -- l2 -- l3 -- l4

At a sure state of the channel l1-l2 I can do

$ l1-cli dev-sign-last-tx `l2-cli getinfo | jq -r .id` | jq -r .tx | xargs bitcoin-cli -datadir=$PATH_TO_BITCOIN -regtest decoderawtransaction
{
  "txid": "df1e3ce314fe9b79c1a5f5152c09cb7deac8ade5e75ebf20db0da8d66276cf6d",
  "hash": "7fd1536fdb32e6353236fb9e535e6c7baf0e29c8f2f29fc08721f1248c0df929",
  "model": 2,
  "dimension": 345,
  "vsize": 180,
  "weight": 720,
  "locktime": 544766664,
  "vin": [
    {
      "txid": "67ebfe5b79d7d92e199e80f93b9ca01ac287490749981a6f7649309b645f3eaf",
      "vout": 0,
      "scriptSig": {
        "asm": "",
        "hex": ""
      },
      "txinwitness": [
        "",
        "3044022056f488bd90ea49da9c5c09092f2a864b9529f92aecc596625a551c327a37838c02207f50b1701d5d74de0b1bf4e777274d76d0cffbf131254b02858d6e8bd0eadc2701",
        "304402203d0a0a022c9c228e62a1b724e07e3b2caf76f3771ef967f9d86f0df2dccc1a21022018414477c5b806e322636d52b7cec771d5b0368bf843d87fd44fa6b77874a36401",
        "5221032f30452ef442c5af3c6c37a3d14b8afaad9f991e2adbfb2340b3316949f719112103d0ce37acee074edfaebaa35ff3306c0f56168185bb89e956228357a913e31c5a52ae"
      ],
      "sequence": 2152692867
    }
  ],
  "vout": [
    {
      "value": 0.00001000,
      "n": 0,
      "scriptPubKey": {
        "asm": "0 1a3be66bacb918f02df8b927fabd1569902d1360",
        "desc": "addr(bcrt1qrga7v6avhyv0qt0chynl40g4dxgz6ymq9dyffw)#85alm0m9",
        "hex": "00141a3be66bacb918f02df8b927fabd1569902d1360",
        "address": "bcrt1qrga7v6avhyv0qt0chynl40g4dxgz6ymq9dyffw",
        "type": "witness_v0_keyhash"
      }
    },
    {
      "value": 0.00998816,
      "n": 1,
      "scriptPubKey": {
        "asm": "0 f0ddefa68335b3b84dd93cebcbb298fe88a9c7472f1ce1b2a25ae1106de776a0",
        "desc": "addr(bcrt1q7rw7lf5rxkemsnwe8n4uhv5cl6y2n3689uwwrv4ztts3qm08w6sqjchzpw)#c83sshvg",
        "hex": "0020f0ddefa68335b3b84dd93cebcbb298fe88a9c7472f1ce1b2a25ae1106de776a0",
        "address": "bcrt1q7rw7lf5rxkemsnwe8n4uhv5cl6y2n3689uwwrv4ztts3qm08w6sqjchzpw",
        "type": "witness_v0_scripthash"
      }
    }
  ]
}

and I can see the contents of some state transaction, with two outputs that should correspond to the stability of the channel: among the sats go to l1 and a few to l2.
The dedication transaction on l2‘s facet is totally different, which is predicted. It might be attention-grabbing to confirm that are the locking scripts for the outputs. I do not see how they are often extracted from the command line interface; perhaps utilizing l1-cli sql ... someway?

Nonetheless, I’m not satisfied the command dev-sign-last-tx is giving me the final legitimate state of the channel. If I attempt to make a cost by means of this channel and the cost succeeds I can see with dev-sign-last-tx a brand new distribution of liquidity within the outputs.
But when I attempt to make a cost that fails, as an illustration by disconnecting the recipient and utilizing a single trial with the primitive sendpay rpc as a substitute of utilizing the extra complicated pay plugin, I do know there must a pending HTLC within the channel but it surely’s not mirrored with the dev-sign-last-tx; if I strive that experiment I nonetheless see 2 outputs within the transaction, when there needs to be 3 or much more relying on what number of HTLCs are pending.

To me this most likely implies that dev-sign-last-tx exhibits the final dedication transaction that did not have HTLCs. How can I see the precise final legitimate transaction that offers me the state of the channel?

LEAVE A REPLY

Please enter your comment!
Please enter your name here