integrated fingerprint

This commit is contained in:
timlucmiptev 2020-12-08 19:51:14 +02:00 committed by ixv
parent 0774ef65dc
commit d8bd3871b8
5 changed files with 26 additions and 12 deletions

View File

@ -10,14 +10,14 @@ xpub1 is from mnemonic from PRIVATE.scratch
### get address at indices
```
=walt1 (from-xpub:bl xpub1 ~ ~)
=walt1 (from-xpub:bl xpub1 [%4 0x5566.7788] ~ ~ ~)
(~(mk-address wad:bl walt1 %0) 0)
:: gives [%bech32 'bc1q0adfj7ur750hjwufzzlfj5ytqzsnd7fz9fjuzc']
```
### update address data
```
=walt1 (from-xpub:bl xpub1 ~ ~)
=walt1 (from-xpub:bl xpub1 ~ ~ ~)
(~(mk-address wad:bl walt1 %0) 0)
:: gives bc1q0adfj7ur750hjwufzzlfj5ytqzsnd7fz9fjuzc
=walt1 (~(watch-address wad:bl walt1 %0) [%bech32 'bc1q0adfj7ur750hjwufzzlfj5ytqzsnd7fz9fjuzc'] [%0 0 ~])

View File

@ -54,25 +54,31 @@
t(txos [txo txos.t])
::
++ to-psbt
|= w=walt
^- cord
''
:: TODO
:: for each txi, get the pubkey from the hdkey
:: get a list of map:psbt:btc
--
:: wad: door for processing walts (wallets)
:: parameterized on a walt and it's chyg account
:: parameterized on a walt and it's chyg account
::
++ wad
|_ [w=walt =chyg]
++ pubkey
|= =idx:btc
^- btc-byts:btc
=/ pk=@ux
%- compress-point:ecc
pub:(derive-public:(derive-public:wilt.w (@ chyg)) idx)
[(met 3 pk) pk]
::
++ mk-address
|= =idx:btc
^- address:btc
=/ pubkey=@ux
%- compress-point:ecc
pub:(derive-public:(derive-public:wilt.w (@ chyg)) idx)
?: ?=(%bip84 bipt.w)
(need (encode-pubkey:bech32:btc %main pubkey))
(need (encode-pubkey:bech32:btc %main dat:(pubkey idx)))
~|("legacy addresses not supported yet " !!)
:: generates and watches the next available address
::

View File

@ -68,9 +68,15 @@
::
++ psbt
|%
:: +create: make base64 cord of PSBT
::
++ create
|= [=rawtx =txid inputs=(list in:^psbt) outputs=(list out:^psbt)]
^- cord
*cord
::
++ hd-path
|= [pubkey=btc-byts =target:^psbt =hdkey]
|= [pubkey=btc-byts =target:^psbt =hdkey]
^- keyval:^psbt
=/ k=btc-byts
%- to-byts:buffer

View File

@ -26,7 +26,7 @@
:: scan-to
:: max-gap: maximum number of consec blank addresses before wallet stops scanning
:: confs: confirmations required (after this is hit for an address, wallet stops refreshing it)
::
::
+$ walt
$: =xpub
=fprint
@ -74,7 +74,7 @@
:: scanning addresses and monitoring generated addresses
:: batch: indexes to scan for a given chyg
:: scans: all scans underway (batches)
:: piym-watch: any address we've been told has an incoming payment promised
:: piym-watch: any address we've been told has an incoming payment promised
::
+$ batch [todo=(set idx) endpoint=idx has-used=?]
+$ scans (map [xpub chyg] batch)
@ -86,7 +86,7 @@
:: TODO: document
::
+$ action
$% [%add-wallet =xpub scan-to=(unit scon) max-gap=(unit @ud) confs=(unit @ud)]
$% [%add-wallet =xpub =fprint scan-to=(unit scon) max-gap=(unit @ud) confs=(unit @ud)]
[%address-info =xpub =chyg =idx utxos=(set utxo) used=? block=@ud]
[%tx-info =info:tx]
[%generate-address =xpub =chyg =peta]

View File

@ -60,6 +60,8 @@
--
++ psbt
|%
+$ in [pubkey=btc-byts =utxo =rawtx =hdkey]
+$ out [=address hk=(unit hdkey)]
+$ target $?(%input %output)
+$ keyval [key=btc-byts val=btc-byts]
+$ map (list keyval)