Commit bbd89a2
committed
Support holder funding key rotation during splicing
We introduce a scalar tweak that can be applied to the base funding key
to obtain the channel's funding key used in the 2-of-2 multisig. This is
used to derive additional keys from the same secret backing the base
funding_pubkey, as we have to rotate keys for each successful splice
attempt.
The tweak is computed similar to existing tweaks used in
[BOLT-3](https://github.com/lightning/bolts/blob/master/03-transactions.md#key-derivation):
1. We use the txid of the funding transaction the splice transaction is
spending instead of the `per_commitment_point` to guarantee
uniqueness.
2. We include the private key instead of the public key to guarantee
only those with knowledge of it can re-derive the new funding key.
tweak = SHA256(splice_parent_funding_txid || base_funding_secret_key)
tweaked_funding_key = base_funding_key + tweak
While the use of this tweak is not required (signers may choose to
compute a tweak of their choice), signers must ensure their tweak
guarantees the two properties mentioned above: uniqueness and derivable
only by one or both of the channel participants.1 parent 7188d5b commit bbd89a2
File tree
11 files changed
+241
-63
lines changed- lightning/src
- chain
- ln
- sign
- util
11 files changed
+241
-63
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1359 | 1359 | | |
1360 | 1360 | | |
1361 | 1361 | | |
| 1362 | + | |
1362 | 1363 | | |
1363 | | - | |
| 1364 | + | |
1364 | 1365 | | |
1365 | 1366 | | |
1366 | 1367 | | |
| |||
1369 | 1370 | | |
1370 | 1371 | | |
1371 | 1372 | | |
1372 | | - | |
| 1373 | + | |
1373 | 1374 | | |
1374 | 1375 | | |
1375 | 1376 | | |
| |||
5417 | 5418 | | |
5418 | 5419 | | |
5419 | 5420 | | |
| 5421 | + | |
5420 | 5422 | | |
5421 | 5423 | | |
5422 | 5424 | | |
| |||
5669 | 5671 | | |
5670 | 5672 | | |
5671 | 5673 | | |
| 5674 | + | |
5672 | 5675 | | |
5673 | 5676 | | |
5674 | 5677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1352 | 1352 | | |
1353 | 1353 | | |
1354 | 1354 | | |
| 1355 | + | |
1355 | 1356 | | |
1356 | 1357 | | |
1357 | 1358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
608 | | - | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
609 | 622 | | |
610 | 623 | | |
611 | 624 | | |
| |||
617 | 630 | | |
618 | 631 | | |
619 | 632 | | |
620 | | - | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
621 | 647 | | |
622 | 648 | | |
623 | 649 | | |
| |||
629 | 655 | | |
630 | 656 | | |
631 | 657 | | |
632 | | - | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
633 | 672 | | |
634 | 673 | | |
635 | 674 | | |
| |||
641 | 680 | | |
642 | 681 | | |
643 | 682 | | |
644 | | - | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
645 | 697 | | |
646 | 698 | | |
647 | 699 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
880 | 880 | | |
881 | 881 | | |
882 | 882 | | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
883 | 894 | | |
884 | 895 | | |
885 | 896 | | |
| |||
963 | 974 | | |
964 | 975 | | |
965 | 976 | | |
| 977 | + | |
966 | 978 | | |
967 | 979 | | |
968 | 980 | | |
| |||
985 | 997 | | |
986 | 998 | | |
987 | 999 | | |
| 1000 | + | |
988 | 1001 | | |
989 | 1002 | | |
990 | 1003 | | |
| |||
998 | 1011 | | |
999 | 1012 | | |
1000 | 1013 | | |
| 1014 | + | |
1001 | 1015 | | |
1002 | 1016 | | |
1003 | 1017 | | |
| |||
1010 | 1024 | | |
1011 | 1025 | | |
1012 | 1026 | | |
| 1027 | + | |
1013 | 1028 | | |
1014 | 1029 | | |
1015 | 1030 | | |
| |||
1028 | 1043 | | |
1029 | 1044 | | |
1030 | 1045 | | |
| 1046 | + | |
1031 | 1047 | | |
1032 | 1048 | | |
1033 | 1049 | | |
| |||
1154 | 1170 | | |
1155 | 1171 | | |
1156 | 1172 | | |
| 1173 | + | |
1157 | 1174 | | |
1158 | 1175 | | |
1159 | 1176 | | |
| |||
1953 | 1970 | | |
1954 | 1971 | | |
1955 | 1972 | | |
1956 | | - | |
1957 | 1973 | | |
1958 | 1974 | | |
1959 | | - | |
1960 | | - | |
1961 | | - | |
1962 | | - | |
| 1975 | + | |
| 1976 | + | |
1963 | 1977 | | |
1964 | 1978 | | |
1965 | 1979 | | |
1966 | 1980 | | |
1967 | 1981 | | |
1968 | 1982 | | |
| 1983 | + | |
1969 | 1984 | | |
1970 | 1985 | | |
1971 | 1986 | | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
1972 | 1992 | | |
1973 | 1993 | | |
1974 | 1994 | | |
| |||
0 commit comments