I've recently opened a payment channel in the Bitcoin testnet LN.
The funding TX ded9fc8b1ee5506037e057a37057a598c362c4b698a40076e75ea88e2ae8a2a2 decoded:
{
"txid": "ded9fc8b1ee5506037e057a37057a598c362c4b698a40076e75ea88e2ae8a2a2",
"hash": "4357b13721588eae4979c6f2814be14bad60535ce284b495f089b3eb68c24e03",
"version": 2,
"size": 405,
"vsize": 243,
"weight": 972,
"locktime": 0,
"vin": [
{
"txid": "9d25bdb718e534d6ada203c1291c123a64e96b9cfa9c0c50041499a60034cc0b",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"30440220064b2596e29dd361e76839bc2aa9c3f98690a6b181bfa7809aaddd6faa656ae602201882cc8b29fe2e5e2cdbfd42dbdaa432e69d38fd4b0a018878b4f04d284d70ba01",
"02aaf68be77ecf046ba50f6aa04f7feca52ca10f8e9a728962d47dabc590170b70"
],
"sequence": 4294967294
},
{
"txid": "cf4e8553b976f05e3dba2189c50a682c3e8801d6cc8506b90eba35aefb915aa8",
"vout": 0,
"scriptSig": {
"asm": "001473b9bbe0a9c3753c77e0e2a75ea80284c0573568",
"hex": "16001473b9bbe0a9c3753c77e0e2a75ea80284c0573568"
},
"txinwitness": [
"304402207b325f4a5f4dae4fdae611826b8358845f5393322814d564e4d87fd40563eff702203dcb12991ff0207d2855b088221ee79d65f034636eb285317a67aa6b1642120101",
"03d4926529290be91f2290b017b5dbf0f2bcf9d33a2bf0c90ed86138ceeb1d4970"
],
"sequence": 4294967294
}
],
"vout": [
{
"value": 0.01188846,
"n": 0,
"scriptPubKey": {
"asm": "0 3d8f9974dc89ea3ad4b7306c6820ff64083bf4d1",
"hex": "00143d8f9974dc89ea3ad4b7306c6820ff64083bf4d1",
"reqSigs": 1,
"type": "witness_v0_keyhash",
"addresses": [
"tb1q8k8ejaxu384r449hxpkxsg8lvsyrhax3xh2lsc"
]
}
},
{
"value": 0.01400000,
"n": 1,
"scriptPubKey": {
"asm": "0 00c3e38f885b98f1d536bfc9f3e6c4b15bbe3879094e191936b8c5d792de6252",
"hex": "002000c3e38f885b98f1d536bfc9f3e6c4b15bbe3879094e191936b8c5d792de6252",
"reqSigs": 1,
"type": "witness_v0_scripthash",
"addresses": [
"tb1qqrp78rugtwv0r4fkhlyl8ekyk9dmuwrep98pjxfkhrza0yk7vffqpzuhga"
]
}
}
]
}
and to closing TX a867d06e9841b8c60318554bb4efc9bcf050dae4789f63403737597adc864af8 decoded:
{
"txid": "a867d06e9841b8c60318554bb4efc9bcf050dae4789f63403737597adc864af8",
"hash": "dde0cc812f55df3a3163de5963bf74ba5cc51e1fbc0a5bd568eb3cf9fc10b28f",
"version": 2,
"size": 304,
"vsize": 139,
"weight": 553,
"locktime": 0,
"vin": [
{
"txid": "ded9fc8b1ee5506037e057a37057a598c362c4b698a40076e75ea88e2ae8a2a2",
"vout": 1,
"scriptSig": {
"asm": "",
"hex": ""
},
"txinwitness": [
"",
"3045022100fb500b4d35fe0e64aca0bd5311e58182aaec09345eba79b470d7985a7f5824cb022044a98de94465c520a06b9e4084f5d2b92d3e042bf51e603f8b8e1d318e23e09e01",
"3044022050a97294e904033fc32b313db771c7fa81c96a2cd51f868b1d35ec100224bc5a02207e8528e2ba002a127ed9ca85fc35804c1bbd98f106e6ab0920b08af794b5b4bf01",
"5221025fce122008fae0295572467c5f28ae5c2dda9653be88038b85fc70e501be062b2103db50a4a1c290e2570ba36317709cc5ea6f9d94d43532581f9c8da945f7baeba852ae"
],
"sequence": 4294967295
}
],
"vout": [
{
"value": 0.01399770,
"n": 0,
"scriptPubKey": {
"asm": "OP_HASH160 f75a397c32f4bb83df13f684cc34d9a51bd98b4a OP_EQUAL",
"hex": "a914f75a397c32f4bb83df13f684cc34d9a51bd98b4a87",
"reqSigs": 1,
"type": "scripthash",
"addresses": [
"2NFo6yaTxo78vvCHe3bk6gGVngRyp2Psvnk"
]
}
}
]
}
I am having a hard time to figure out how I can know the receiving address ("2NFo6yaTxo78vvCHe3bk6gGVngRyp2Psvnk") prior to the closing of the channel? Is it an address in the outputs of the funding transaction? Because I can't find this address there. So, how did the building of the closing transaction take place? I'll be happy to understand more about the funding and closing tx scripts / process.