Skip to content

Instantly share code, notes, and snippets.

@yyforyongyu
Created October 15, 2019 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yyforyongyu/d2870b422c86f62930790e1c64f8689a to your computer and use it in GitHub Desktop.
Save yyforyongyu/d2870b422c86f62930790e1c64f8689a to your computer and use it in GitHub Desktop.
A trimmed log on how Alice and Bob opened a channel in the lightning network
Alice's log
================================================================================================
2019-09-10 22:34:36.711 [DBG] PEER: Sending MsgOpenChannel(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, chain=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206, csv=144, amt=0.01 BTC, push_amt=0 mSAT, reserve=0.0001 BTC, flags=1) to 021fb0e0d877ef5c4c8aeb7dc931a58ed1d15e402bfe60228135d5a5573a1438e1@172.19.0.6:9735
2019-09-10 22:34:36.741 [DBG] PEER: Received MsgAcceptChannel(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, reserve=0.0001 BTC, csv=144, num_confs=3) from 021fb0e0d877ef5c4c8aeb7dc931a58ed1d15e402bfe60228135d5a5573a1438e1@172.19.0.6:9735
2019-09-10 22:34:36.741 [INF] FNDG: Recv'd fundingResponse for pendingID(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368)
2019-09-10 22:34:36.746 [DBG] LNWL: Funding tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) generated: (*wire.MsgTx)(0xc000a66200)({
Version: (int32) 1,
TxIn: ([]*wire.TxIn) (len=1 cap=15) {
(*wire.TxIn)(0xc000752420)({
PreviousOutPoint: (wire.OutPoint) 3fc35542baab3064f355d1a621d03a279e30fa052fa28baa08dfefb692756c78:0,
SignatureScript: ([]uint8) (len=23 cap=500) {
00000000 16 00 14 d6 4d 3e ec a5 0e 04 4f a7 5f a7 3e 65 |....M>....O._.>e|
00000010 e2 2a f3 b0 30 9c b5 |.*..0..|
},
Witness: (wire.TxWitness) (len=2 cap=2) {
([]uint8) (len=71 cap=144) {
00000000 30 44 02 20 2c c3 63 41 01 f5 4e c0 4a de 18 c3 |0D. ,.cA..N.J...|
00000010 d3 49 33 31 8a 1f ed e2 2c f4 9d 1a e0 bd a6 d6 |.I31....,.......|
00000020 aa 3a a6 1c 02 20 60 c3 93 f0 54 5a 59 52 da 34 |.:... `...TZYR.4|
00000030 b5 15 f1 82 d8 30 30 16 97 e1 da e3 87 8c 69 6c |.....00.......il|
00000040 1a d7 c7 ff b1 b6 01 |.......|
},
([]uint8) (len=33 cap=33) {
00000000 03 ef b0 cd f7 00 82 49 81 4b a6 55 e3 51 b1 85 |.......I.K.U.Q..|
00000010 00 d7 60 0b cd 95 bc 64 fc 1c 73 5c d3 5d 1a f3 |..`....d..s\.]..|
00000020 0a |.|
}
},
Sequence: (uint32) 4294967295
})
},
TxOut: ([]*wire.TxOut) (len=2 cap=15) {
(*wire.TxOut)(0xc000a9abc0)({
Value: (int64) 1000000,
PkScript: ([]uint8) (len=34 cap=500) {
00000000 00 20 1f e9 5c 12 ce 6b 31 3b 29 e9 81 01 42 cf |. ..\..k1;)...B.|
00000010 5d 02 c8 85 c4 af 31 bf e9 92 f0 4a c9 5c 83 d5 |].....1....J.\..|
00000020 6f 61 |oa|
}
}),
(*wire.TxOut)(0xc000a08760)({
Value: (int64) 1248991213,
PkScript: ([]uint8) (len=22 cap=500) {
00000000 00 14 48 2e df 4c 3b ad fa a9 9a 49 74 54 6a b7 |..H..L;....ItTj.|
00000010 45 b9 41 1a 6e f3 |E.A.n.|
}
})
},
LockTime: (uint32) 0
})
2019-09-10 22:34:36.750 [DBG] LNWL: Local commit tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0): (*wire.MsgTx)(0xc0007ef980)({
Version: (int32) 2,
TxIn: ([]*wire.TxIn) (len=1 cap=15) {
(*wire.TxIn)(0xc00076e780)({
PreviousOutPoint: (wire.OutPoint) ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0,
SignatureScript: ([]uint8) <nil>,
Witness: (wire.TxWitness) <nil>,
Sequence: (uint32) 2147860162
})
},
TxOut: ([]*wire.TxOut) (len=1 cap=15) {
(*wire.TxOut)(0xc000288800)({
Value: (int64) 990950,
PkScript: ([]uint8) (len=34 cap=500) {
00000000 00 20 5d 46 75 0b b4 66 aa c3 5e 37 3c 94 ae 80 |. ]Fu..f..^7<...|
00000010 cc 51 14 1d 77 f9 59 85 70 c3 9b 9e b1 56 df 76 |.Q..w.Y.p....V.v|
00000020 34 47 |4G|
}
})
},
LockTime: (uint32) 542431327
})
2019-09-10 22:34:36.770 [DBG] LNWL: Remote commit tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0): (*wire.MsgTx)(0xc0007ef9c0)({
Version: (int32) 2,
TxIn: ([]*wire.TxIn) (len=1 cap=15) {
(*wire.TxIn)(0xc00076e7e0)({
PreviousOutPoint: (wire.OutPoint) ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0,
SignatureScript: ([]uint8) <nil>,
Witness: (wire.TxWitness) <nil>,
Sequence: (uint32) 2147860162
})
},
TxOut: ([]*wire.TxOut) (len=1 cap=15) {
(*wire.TxOut)(0xc000288820)({
Value: (int64) 990950,
PkScript: ([]uint8) (len=22 cap=500) {
00000000 00 14 4b 4a d0 09 8e c4 c9 78 7c 3b cf 44 da 1d |..KJ.....x|;.D..|
00000010 3d 19 4e 46 a1 78 |=.NF.x|
}
})
},
LockTime: (uint32) 542431327
})
2019-09-10 22:34:36.777 [INF] FNDG: pendingChan(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368): remote party proposes num_confs=3, csv_delay=144
2019-09-10 22:34:36.785 [DBG] FNDG: Remote party accepted commitment constraints: (channeldb.ChannelConstraints) {
DustLimit: (btcutil.Amount) 0.00000573 BTC,
ChanReserve: (btcutil.Amount) 0.0001 BTC,
MaxPendingAmount: (lnwire.MilliSatoshi) 990000000 mSAT,
MinHTLC: (lnwire.MilliSatoshi) 1000 mSAT,
MaxAcceptedHtlcs: (uint16) 483,
CsvDelay: (uint16) 144
}
2019-09-10 22:34:36.785 [DBG] FNDG: Creating chan barrier for ChanID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed)
2019-09-10 22:34:36.788 [INF] FNDG: Generated ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) for pendingID(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368)
2019-09-10 22:34:36.788 [DBG] PEER: Sending MsgFundingCreated(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, chan_point=ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) to 021fb0e0d877ef5c4c8aeb7dc931a58ed1d15e402bfe60228135d5a5573a1438e1@172.19.0.6:9735
2019-09-10 22:34:36.830 [DBG] PEER: Received MsgFundingSigned(chan_id=e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed) from 021fb0e0d877ef5c4c8aeb7dc931a58ed1d15e402bfe60228135d5a5573a1438e1@172.19.0.6:9735
2019-09-10 22:34:36.839 [INF] FNDG: Broadcasting funding tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0): (*wire.MsgTx)(0xc000a66200)[full tx omitted]
2019-09-10 22:34:36.840 [INF] LNWL: Inserting unconfirmed transaction ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6
2019-09-10 22:34:36.881 [DBG] LNWL: Marked address bcrt1qfqhd7npm4ha2nxjfw32x4d69h9q35mhnqk4huh used
...
2019-09-10 22:34:36.956 [INF] FNDG: Waiting for funding tx (ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6) to reach 3 confirmations
...
2019-09-10 22:39:32.877 [DBG] LNWL: Filtering block 501 (6b57a1e9d4d5d851bfbbd42501297460add2027a44f3659fe5768ce11a37fcc0) with 2 transactions
...
2019-09-10 22:39:32.877 [INF] LNWL: Marking unconfirmed transaction ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6 mined in block 501
...
2019-09-10 22:39:32.974 [INF] UTXN: Attempting to graduate height=501: num_kids=0, num_babies=0
2019-09-10 22:39:32.977 [DBG] LNWL: Filtering block 502 (0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b) with 1 transactions
...
2019-09-10 22:39:33.044 [DBG] SWPR: New block: height=502, sha=0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b
2019-09-10 22:39:33.044 [INF] UTXN: Attempting to graduate height=502: num_kids=0, num_babies=0
...
2019-09-10 22:39:33.070 [DBG] LNWL: Filtering block 503 (0141bac95194a27351291f41cb5d0e07709d35d25670c82a6841ef94467e0470) with 1 transactions
...
2019-09-10 22:39:33.140 [INF] NTFN: New block: height=503, sha=0141bac95194a27351291f41cb5d0e07709d35d25670c82a6841ef94467e0470
2019-09-10 22:39:33.140 [INF] NTFN: Dispatching 3 confirmation notification for txid=ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6
2019-09-10 22:39:33.146 [INF] FNDG: ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) is now active: ChannelID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed)
...
2019-09-10 22:39:33.140 [INF] UTXN: Attempting to graduate height=503: num_kids=0, num_babies=0
...
2019-09-10 22:39:33.205 [DBG] FNDG: Channel with ShortChanID 550855325581312 now confirmed
Bob's log
================================================================================================
2019-09-10 22:34:36.712 [DBG] PEER: Received MsgOpenChannel(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, chain=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206, csv=144, amt=0.01 BTC, push_amt=0 mSAT, reserve=0.0001 BTC, flags=1) from 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
2019-09-10 22:34:36.718 [INF] FNDG: Recv'd fundingRequest(amt=0.01 BTC, push=0 mSAT, delay=144, pendingId=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368) from peer(025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4)
2019-09-10 22:34:36.735 [INF] FNDG: Requiring 3 confirmations for pendingChan(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368): amt=0.01 BTC, push_amt=0 mSAT
2019-09-10 22:34:36.735 [INF] FNDG: Sending fundingResp for pendingID(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368)
2019-09-10 22:34:36.736 [DBG] FNDG: Remote party accepted commitment constraints: (channeldb.ChannelConstraints) {
DustLimit: (btcutil.Amount) 0.00000573 BTC,
ChanReserve: (btcutil.Amount) 0.0001 BTC,
MaxPendingAmount: (lnwire.MilliSatoshi) 990000000 mSAT,
MinHTLC: (lnwire.MilliSatoshi) 1000 mSAT,
MaxAcceptedHtlcs: (uint16) 483,
CsvDelay: (uint16) 144
}
2019-09-10 22:34:36.736 [DBG] PEER: Sending MsgAcceptChannel(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, reserve=0.0001 BTC, csv=144, num_confs=3) to 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
...
2019-09-10 22:34:36.789 [DBG] PEER: Received MsgFundingCreated(temp_chan_id=cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368, chan_point=ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) from 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
2019-09-10 22:34:36.790 [INF] FNDG: completing pendingID(cfc031525216624c40d52d7c4add59d2f1b1ef8651d77089b685fe727a8dd368) with ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0)
2019-09-10 22:34:36.792 [DBG] LNWL: Local commit tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0): (*wire.MsgTx)(0xc000994480)({
Version: (int32) 2,
TxIn: ([]*wire.TxIn) (len=1 cap=15) {
(*wire.TxIn)(0xc0004673e0)({
PreviousOutPoint: (wire.OutPoint) ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0,
SignatureScript: ([]uint8) <nil>,
Witness: (wire.TxWitness) <nil>,
Sequence: (uint32) 2147860162
})
},
TxOut: ([]*wire.TxOut) (len=1 cap=15) {
(*wire.TxOut)(0xc000be2860)({
Value: (int64) 990950,
PkScript: ([]uint8) (len=22 cap=500) {
00000000 00 14 4b 4a d0 09 8e c4 c9 78 7c 3b cf 44 da 1d |..KJ.....x|;.D..|
00000010 3d 19 4e 46 a1 78 |=.NF.x|
}
})
},
LockTime: (uint32) 542431327
})
2019-09-10 22:34:36.793 [DBG] LNWL: Remote commit tx for ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0): (*wire.MsgTx)(0xc0009944c0)({
Version: (int32) 2,
TxIn: ([]*wire.TxIn) (len=1 cap=15) {
(*wire.TxIn)(0xc000467680)({
PreviousOutPoint: (wire.OutPoint) ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0,
SignatureScript: ([]uint8) <nil>,
Witness: (wire.TxWitness) <nil>,
Sequence: (uint32) 2147860162
})
},
TxOut: ([]*wire.TxOut) (len=1 cap=15) {
(*wire.TxOut)(0xc000be2880)({
Value: (int64) 990950,
PkScript: ([]uint8) (len=34 cap=500) {
00000000 00 20 5d 46 75 0b b4 66 aa c3 5e 37 3c 94 ae 80 |. ]Fu..f..^7<...|
00000010 cc 51 14 1d 77 f9 59 85 70 c3 9b 9e b1 56 df 76 |.Q..w.Y.p....V.v|
00000020 34 47 |4G|
}
})
},
LockTime: (uint32) 542431327
})
...
2019-09-10 22:34:36.821 [DBG] PEER: Sending MsgFundingSigned(chan_id=e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed) to 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
...
2019-09-10 22:34:36.873 [INF] FNDG: Waiting for funding tx (ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6) to reach 3 confirmations
...
2019-09-10 22:39:32.877 [DBG] LNWL: Filtering block 501 (6b57a1e9d4d5d851bfbbd42501297460add2027a44f3659fe5768ce11a37fcc0) with 2 transactions
2019-09-10 22:39:32.886 [INF] CRTR: Pruning channel graph using block 6b57a1e9d4d5d851bfbbd42501297460add2027a44f3659fe5768ce11a37fcc0 (height=501)
2019-09-10 22:39:32.928 [DBG] NTFN: Found initial confirmation of txid=ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6: height=501, hash=6b57a1e9d4d5d851bfbbd42501297460add2027a44f3659fe5768ce11a37fcc0
...
2019-09-10 22:39:32.956 [INF] UTXN: Attempting to graduate height=501: num_kids=0, num_babies=0
...
2019-09-10 22:39:32.977 [DBG] LNWL: Filtering block 502 (0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b) with 1 transactions
2019-09-10 22:39:32.982 [INF] CRTR: Pruning channel graph using block 0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b (height=502)
2019-09-10 22:39:32.990 [INF] CRTR: Block 0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b (height=502) closed 0 channels
2019-09-10 22:39:33.064 [INF] NTFN: New block: height=502, sha=0979fdf40e8386d1392956f02a5d2e09ca83de277e1bd2bfe0cedbb8ca24fe3b
...
2019-09-10 22:39:33.202 [INF] NTFN: New block: height=503, sha=0141bac95194a27351291f41cb5d0e07709d35d25670c82a6841ef94467e0470
2019-09-10 22:39:33.203 [INF] NTFN: Dispatching 3 confirmation notification for txid=ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6
2019-09-10 22:39:33.206 [INF] FNDG: ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) is now active: ChannelID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed)
...
2019-09-10 22:39:33.241 [DBG] LNWL: ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0), starting local commitment...
...
2019-09-10 22:39:33.298 [DBG] FNDG: ChannelID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed) is now fully confirmed!
2019-09-10 22:39:33.352 [DBG] FNDG: Sending FundingLocked for ChannelID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed) to peer 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4
2019-09-10 22:39:33.316 [DBG] PEER: Received FundingLocked(chan_id=e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed, next_point=0235ed6b6d535b595d196cea00acb8e5f839982dcae705b80658dd15bb2d572aa6) from 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
2019-09-10 22:39:33.356 [DBG] FNDG: Received FundingLocked for ChannelID(e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed) from peer 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4
2019-09-10 22:39:33.355 [DBG] PEER: Sending FundingLocked(chan_id=e6b8813da188239612c5c3efd690d9749b8c6ca14416ff0650d4d420b4ba16ed, next_point=02eb46ca0ab23589692b9f129c616e8e7aaa4c7b538c9676d226b7ac4bc175863c) to 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
2019-09-10 22:39:33.373 [DBG] PEER: Received ChannelUpdate(chain_hash=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206, short_chan_id=550855325581312, mflags=00000001, cflags=00000001, update_time=2019-09-10 22:39:33 +0000 UTC) from 025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4@172.19.0.5:48184
...
2019-09-10 22:39:33.438 [INF] PEER: New channel active ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) with NodeKey(025118eb10d7c7c44b748ef93d014e8b81fac1f8394008d70565dc841f85a9b4d4)
2019-09-10 22:39:33.451 [DBG] FNDG: Will announce channel 550855325581312 after ChannelPoint(ed16bab420d4d45006ff1644a16c8c9b74d990d6efc3c512962388a13d81b8e6:0) has gotten 6 confirmations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment