Update 02.md

This commit is contained in:
brqgoo
2023-01-29 12:43:25 +03:00
committed by GitHub
parent d2a9b14a97
commit 5615802477

14
02.md
View File

@@ -1,3 +1,4 @@
BDS-02
======
@@ -25,3 +26,16 @@ Inconvenient for onboarding new users who have no UTXO possession in the beginni
`Channel addresses`, as seen [here](https://burakkeceli.medium.com/channel-addresses-bd85e9ab8fe1) and [here](https://rubin.io/bitcoin/2021/12/11/advent-14/), make it possible to craft on-chain bitcoin addresses such that whenever funded by someone, becomes a payment channel between the user and the channel partner (LSP), where the channel funds are initially kept on the user's side. Channel address require new additions to the bitcoin scripting system, and planned as a future extension under [BDS-19](https://github.com/bits-wallet/specs/blob/main/19.md).
`Expiring channel addresses` proposes a much more primitive version of channel addresses that can be built on Bitcoin today. If we add to the 2-of-2 musig inner key a single-leaf script path after a relative locktime to the user, similar to pre-segwit timeout channel design, it becomes no longer necessary to craft a refund transaction in advance of funding the output. If the channel partner (LSP) is non-collaborative in exchanging signatures for a refund once the address is funded, the user can exit from the script path after the expiry. Ultimately, it's LSP's responsibility to close the channel shortly before its expiry. While this may seem a bad idea from an on-chain footprint standpoint, we anticipate users to mostly receive funds over silent swaps and only rarely receive on-chain through expiring channel addresses.
- The nostr parent secret key _nsec_: a 32-byte array.
- The nostr parent public key _npub_: _cbytes(int(nsec)⋅G)_.
- The tweak derivation secret _ds_: a 32-byte array.
- Let _ds_ = _hash<sub>BDS-02 dersec</sub>(nsec)_.
- The number _u_ of child keys, _u = 2<sup>32</sup>_.
- For _i = 1 .. u_:
- - The BDS-02 child secret key sk<sub>i</sub>.
- - The BDS-02 child public key pk<sub>i</sub>.
- - pk<sub>i</sub> BIP-340 tweak t<sub>i</sub> : 32-byte array.
- - Let t<sub>i</sub> = hash<sub>BDS-02 tweak</sub>(ds || bytes(32, i)).
- - Let pk<sub>i</sub> = _cbytes(int(npub) + int(t<sub>i</sub>)⋅G)_.
- - Let sk<sub>i</sub> = bytes(32, (_int(nsec) + int(t<sub>i</sub> )) % n)_.