From 6aa6f8a65ae75f85186d96ef06801d124928efd8 Mon Sep 17 00:00:00 2001 From: brqgoo <100725376+brqgoo@users.noreply.github.com> Date: Sun, 29 Jan 2023 14:43:20 +0300 Subject: [PATCH] Update 02.md --- 02.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/02.md b/02.md index 70c74fc..f86d1f8 100644 --- a/02.md +++ b/02.md @@ -30,8 +30,8 @@ Inconvenient for onboarding new users who have no UTXO possession in the beginni - 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. + - The number _u_ of child keys _232_. - Let _ds_ = _hashBDS-02 dersec(nsec)_. - - The number _u_ of child keys, _u = 232_. - For _i = 1 .. u_: - - The BDS-02 child secret key _ski_. - - The BDS-02 child public key _pki_. @@ -39,3 +39,17 @@ Inconvenient for onboarding new users who have no UTXO possession in the beginni - - Let _ti_ = _hashBDS-02 tweak(ds || bytes(32, i))_. - - Let _pki_ = _cbytes(npub + int(ti)⋅G)_. - - Let _ski_ = _bytes(32, (int(nsec) + int(ti )) mod n)_. + +- For _i = 1 < u< 232_: +- - The _to_self_ : 32-byte x-only child public key. +- - The _ex_ : a 2-byte minimally encoded channel expiry as relative locktime. +- - The _ts_ : a 39-byte raw tapscript for a non-interactive refund closure. +- - The _chanpubkey_ : tweaked 2-of-2 common channel output +- - The _chanaddress_ : expiring channel address +- - Let _to_self_ = _xbytes(pki)_. +- - Let _ex_ = _CScriptNum(26280)_. +- - Let _ts_ = ` OP_CHECKSEQUENCEVERIFY OP_DROP OP_CHECKSIG`. +- - Let _shash_ = _hashTapLeaf(0xc0 || 0x27 || s)_. +- - Let _stweak_ = _hashTapTweak(lift_x(pkagg) || shash)_. +- - Let _chanpubkey_ = _lift_x(pkagg) + int(stweak)⋅G_. +- - Let _chanaddress_ = _Bech32m(0x51 || 0x20 || x_bytes(cpubkey))_.