Skip to content

Commit 0b7d25c

Browse files
Leo Weesegitbook-bot
authored andcommitted
GITBOOK-501: change request with no subject merged in GitBook
1 parent 0c8fcab commit 0b7d25c

File tree

1 file changed

+112
-78
lines changed

1 file changed

+112
-78
lines changed

lightning-network-tools/taproot-assets/taproot-assets-channels.md

Lines changed: 112 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -41,98 +41,132 @@ Unless you are running `litd` on any other network than mainnet, you will have t
4141

4242
For example:
4343

44-
`litcli --network=testnet status`
44+
`litcli --network=signet status`
4545

4646
In all following example commands, this detail is omitted for simplicity.
4747

4848
[Read more: Debugging Tapd](debugging-tapd.md)
4949

5050
## Open channels <a href="#docs-internal-guid-726c810f-7fff-a475-78a5-501c81d0113e" id="docs-internal-guid-726c810f-7fff-a475-78a5-501c81d0113e"></a>
5151

52-
To open a channel, we will identify the asset that we would like to deposit into our channel. We can get the asset ids of the Taproot Assets we hold using `tapcli assets list`. To open the channel, we will need the `asset_id` and how many of these tokens we want to deposit into our channel.
52+
To open a channel, we will identify the asset that we would like to deposit into our channel. We can get the group keys of the Taproot Assets we hold using `tapcli assets list`. To open the channel, we will need the `tweaked_group_key` and how many of these assets we want to deposit into our channel.
5353

5454
Specifying a fee rate for the channel opening transaction helps getting the transaction confirmed in time. We will need to find a peer that supports Taproot Assets. Ideally you or this peer is willing to act as an edge node, meaning they are willing to swap the asset in question for satoshis on the Lightning Network.
5555

5656
[Learn more: Edge nodes](../../the-lightning-network/taproot-assets/edge-nodes.md)
5757

58-
`litcli ln fundchannel --node_key 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b --sat_per_vbyte 16 --asset_amount 1000 --asset_id 36f682ff98bcf240a1daa5287f9c030bc6808e24ff75e594c0b42ebf82b75d75`
58+
`litcli ln fundchannel --node_key 03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b --sat_per_vbyte 16 --asset_amount 1000 --group_key 2875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782`
5959

6060
As the channel is opening, you will see the channel `txid`. You should be able to immediately see the channel details with `lncli pendingchannels` and once confirmed, with `lncli listchannels`:
6161

6262
```
63-
{
64-
"active": true,
65-
"remote_pubkey": "03e347d089c071c27680e26299223e80a740cf3e3fc4b4237fa219bb67121a670b",
66-
"channel_point": "3596bc22e11333b5c06ea9b4b05ced089acd545df4d1125dca8346b1b5fc64b5:0",
67-
"chan_id": "3152442773369192448",
68-
"capacity": "100000",
69-
"local_balance": "96920",
70-
"remote_balance": "0",
71-
"commit_fee": "2750",
72-
"commit_weight": "614",
73-
"fee_per_kw": "2500",
74-
"unsettled_balance": "0",
75-
"total_satoshis_sent": "0",
76-
"total_satoshis_received": "0",
77-
"num_updates": "0",
78-
"pending_htlcs": [],
79-
"csv_delay": 144,
80-
"private": true,
81-
"initiator": true,
82-
"chan_status_flags": "ChanStatusDefault",
83-
"local_chan_reserve_sat": "1000",
84-
"remote_chan_reserve_sat": "1062",
85-
"static_remote_key": false,
86-
"commitment_type": "SIMPLE_TAPROOT",
87-
"lifetime": "25",
88-
"uptime": "25",
89-
"close_address": "",
90-
"push_amount_sat": "0",
91-
"thaw_height": 0,
92-
"local_constraints": {
93-
"csv_delay": 144,
94-
"chan_reserve_sat": "1000",
95-
"dust_limit_sat": "354",
96-
"max_pending_amt_msat": "99000000",
97-
"min_htlc_msat": "1",
98-
"max_accepted_htlcs": 483
99-
},
100-
"remote_constraints": {
101-
"csv_delay": 144,
102-
"chan_reserve_sat": "1062",
103-
"dust_limit_sat": "354",
104-
"max_pending_amt_msat": "99000000",
105-
"min_htlc_msat": "1",
106-
"max_accepted_htlcs": 483
107-
},
108-
"alias_scids": [
109-
"17592186044416000004"
110-
],
111-
"zero_conf": false,
112-
"zero_conf_confirmed_scid": "0",
113-
"peer_alias": "VelasCommerce-Testnet",
114-
"peer_scid_alias": "17592186044416000150",
115-
"memo": "",
116-
"custom_channel_data": {
117-
"assets": [
118-
{
119-
"asset_utxo": {
120-
"version": 1,
121-
"asset_genesis": {
122-
"genesis_point": "7468e34998fe93c909334b307926b2f805d1780cfaabfeb9f92a0f0aabc767bb:1",
123-
"name": "beefbux0708b",
124-
"meta_hash": "1b206639244dae9875be0db3babd9c326e9ffe319f9a913c56b765c8e80b6299",
125-
"asset_id": "1d98fdb40cab6edfd23480403210d8c48a714d9f693893bb09dde025980df830"
126-
},
127-
"amount": 90000,
128-
"script_key": "0250aaeb166f4234650d84a2d8a130987aeaf6950206e0905401ee74ff3f8d18e6"
129-
},
130-
"capacity": 90000,
131-
"local_balance": 90000,
132-
"remote_balance": 0
133-
}
134-
]
135-
}
63+
{
64+
"channels": [
65+
{
66+
"active": true,
67+
"remote_pubkey": "0312bddcf146394bf0805feef967e8485b8648c66065fe7345c4bc97eac8312df7",
68+
"channel_point": "4cc78d1220c5547cf8321120471e3c5022a9d06c0df1bcfa1559a9a8e023d79b:0",
69+
"chan_id": "9bd723e0a8a95915fabcf10d6cd0a922503c1e47201132f87c54c520128dc74c",
70+
"scid": "278301786179043328",
71+
"scid_str": "253114x399x0",
72+
"capacity": "100000",
73+
"local_balance": "98122",
74+
"remote_balance": "0",
75+
"commit_fee": "1548",
76+
"commit_weight": "614",
77+
"fee_per_kw": "1259",
78+
"unsettled_balance": "0",
79+
"total_satoshis_sent": "0",
80+
"total_satoshis_received": "0",
81+
"num_updates": "0",
82+
"pending_htlcs": [],
83+
"csv_delay": 144,
84+
"private": true,
85+
"initiator": true,
86+
"chan_status_flags": "ChanStatusDefault",
87+
"local_chan_reserve_sat": "1000",
88+
"remote_chan_reserve_sat": "1062",
89+
"static_remote_key": false,
90+
"commitment_type": "SIMPLE_TAPROOT_OVERLAY",
91+
"lifetime": "3418",
92+
"uptime": "3418",
93+
"close_address": "",
94+
"push_amount_sat": "0",
95+
"thaw_height": 0,
96+
"local_constraints": {
97+
"csv_delay": 144,
98+
"chan_reserve_sat": "1000",
99+
"dust_limit_sat": "354",
100+
"max_pending_amt_msat": "99000000",
101+
"min_htlc_msat": "1",
102+
"max_accepted_htlcs": 83
103+
},
104+
"remote_constraints": {
105+
"csv_delay": 144,
106+
"chan_reserve_sat": "1062",
107+
"dust_limit_sat": "354",
108+
"max_pending_amt_msat": "99000000",
109+
"min_htlc_msat": "1",
110+
"max_accepted_htlcs": 83
111+
},
112+
"alias_scids": [
113+
"17592186044416000018"
114+
],
115+
"zero_conf": false,
116+
"zero_conf_confirmed_scid": "0",
117+
"peer_alias": "Hannahs-2nd-Signet-Node",
118+
"peer_scid_alias": "17592186044416000010",
119+
"memo": "",
120+
"custom_channel_data": {
121+
"funding_assets": [
122+
{
123+
"version": 1,
124+
"asset_genesis": {
125+
"genesis_point": "d31420284ed707c98af9b35de1c87966bb449ee0a3d2aafb5eff52172decbeb0:1",
126+
"name": "Stablesigs",
127+
"meta_hash": "76cc761e50db8f655449ec7e5ff60be23ce45611ed362aed2242b8e265fc672f",
128+
"asset_id": "c28399c74ffbbfa0166428cb91bf7b196e827d5b4bfec6117433353aa2129d5c"
129+
},
130+
"amount": 10000000000,
131+
"script_key": "023e65e41a9f04a63968a17e3b2cfd8742b4ffaf0d39e535c5eee227fcb137990b",
132+
"decimal_display": 6
133+
},
134+
{
135+
"version": 1,
136+
"asset_genesis": {
137+
"genesis_point": "ac7b4bc6efdde36261850b4a8e61c49385a7be8b7c4c31da07ac9caa1a32842d:2",
138+
"name": "Stablesigs",
139+
"meta_hash": "76cc761e50db8f655449ec7e5ff60be23ce45611ed362aed2242b8e265fc672f",
140+
"asset_id": "c5dc35d9ffa03abcbd22d2d2801d10813970875029843039bf4f99d543d15fef"
141+
},
142+
"amount": 8997750,
143+
"script_key": "02a207ba37828ba9f9aaacddcd2da3cdf30c1d6e2c2c74cdc620f4198088691334",
144+
"decimal_display": 6
145+
}
146+
],
147+
"local_assets": [
148+
{
149+
"asset_id": "c28399c74ffbbfa0166428cb91bf7b196e827d5b4bfec6117433353aa2129d5c",
150+
"amount": 10000000000
151+
},
152+
{
153+
"asset_id": "c5dc35d9ffa03abcbd22d2d2801d10813970875029843039bf4f99d543d15fef",
154+
"amount": 8997750
155+
}
156+
],
157+
"remote_assets": [],
158+
"outgoing_htlcs": [],
159+
"incoming_htlcs": [],
160+
"capacity": 10008997750,
161+
"group_key": "02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782",
162+
"local_balance": 10008997750,
163+
"remote_balance": 0,
164+
"outgoing_htlc_balance": 0,
165+
"incoming_htlc_balance": 0
166+
}
167+
}
168+
]
169+
}
136170
137171
```
138172

@@ -144,15 +178,15 @@ To be able to generate invoices, you must have a channel with a remote balance f
144178

145179
The invoice generation format follows that of LND.
146180

147-
`litcli ln addinvoice --memo "my first taproot asset transfer" --asset_id 1d98fdb40cab6edfd23480403210d8c48a714d9f693893bb09dde025980df830 --asset_amount 10`
181+
`litcli ln addinvoice --memo "my first taproot asset transfer" --group_key 02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782 --asset_amount 10000000`
148182

149183
`lntb100n1pngas7zpp587tawysmkje0nn3ky924kn6uqrah3kg3r74fy0dxlld9cm3x6wgqdpjd4ujqenfwfehggr5v9c8ymm0wssxzumnv46zqarjv9h8xen9wgcqzzsxqzpurzjqwkt9dep6spnj6j675lwsnkqw29cq4l4apsjgdvaqp3utu6tcq3r6e3ctdznnjyxpsqqqqlgqqqqqqgq2qsp5gfvdzsac6nn869ldzljaruwnzkn4mgjfgef6t7hnka3urvgxjtss9qxpqysgqwsdtk928g7a5dcnw52nd5vp5u062h2puncsepj6w43yh4cxly9sk3fm8vqtykd6sc4hs0452kf6mh5dwe8knryz3sz5e5w7wh2uze2qp69s94y`
150184

151185
## Make payments <a href="#docs-internal-guid-f17bd41b-7fff-f2ab-303f-0f18de7a70b4" id="docs-internal-guid-f17bd41b-7fff-f2ab-303f-0f18de7a70b4"></a>
152186

153187
You can make the payment by passing the invoice to `litcli` on the sender’s node. The invoice needs to be passed together with the asset ID.
154188

155-
`litcli ln payinvoice --pay_req lntb100n1pngas7zpp587tawysmkje0nn3ky924kn6uqrah3kg3r74fy0dxlld9cm3x6wgqdpjd4ujqenfwfehggr5v9c8ymm0wssxzumnv46zqarjv9h8xen9wgcqzzsxqzpurzjqwkt9dep6spnj6j675lwsnkqw29cq4l4apsjgdvaqp3utu6tcq3r6e3ctdznnjyxpsqqqqlgqqqqqqgq2qsp5gfvdzsac6nn869ldzljaruwnzkn4mgjfgef6t7hnka3urvgxjtss9qxpqysgqwsdtk928g7a5dcnw52nd5vp5u062h2puncsepj6w43yh4cxly9sk3fm8vqtykd6sc4hs0452kf6mh5dwe8knryz3sz5e5w7wh2uze2qp69s94y --asset_id 1d98fdb40cab6edfd23480403210d8c48a714d9f693893bb09dde025980df830`
189+
`litcli ln payinvoice --pay_req lntb100n1pngas7zpp587tawysmkje0nn3ky924kn6uqrah3kg3r74fy0dxlld9cm3x6wgqdpjd4ujqenfwfehggr5v9c8ymm0wssxzumnv46zqarjv9h8xen9wgcqzzsxqzpurzjqwkt9dep6spnj6j675lwsnkqw29cq4l4apsjgdvaqp3utu6tcq3r6e3ctdznnjyxpsqqqqlgqqqqqqgq2qsp5gfvdzsac6nn869ldzljaruwnzkn4mgjfgef6t7hnka3urvgxjtss9qxpqysgqwsdtk928g7a5dcnw52nd5vp5u062h2puncsepj6w43yh4cxly9sk3fm8vqtykd6sc4hs0452kf6mh5dwe8knryz3sz5e5w7wh2uze2qp69s94y --group_key 02875ce409b587a6656357639d099ad9eb08396d0dfea8930a45e742c81d6fc782`
156190

157191
You will notice that as the payment succeeds, a small amount of satoshis also gets pushed to the remote side. Satoshis are needed to anchor the taproot asset in an [HTLC](../../the-lightning-network/multihop-payments/hash-time-lock-contract-htlc.md). In a testing environment it may make sense to balance the bitcoin in the channel using keysend in order to be able to send and receive smoothly.
158192

0 commit comments

Comments
 (0)