mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
19 lines
464 B
Plaintext
19 lines
464 B
Plaintext
:: btc-scratch.hoon
|
|
/- *btc
|
|
/+ bip32, btc
|
|
=+ ecc=secp256k1:secp:crypto
|
|
=, bech32:btc
|
|
|%
|
|
++ bip84
|
|
|_ [network=network:btc xpub=tape]
|
|
++ address
|
|
|= [change=@ index=@]
|
|
^- bech32-address
|
|
?> =("zpub" (tape (scag 4 xpub))) :: only for bip84
|
|
=/ pubkey=@ux
|
|
%- compress-point:ecc
|
|
pub:(derive-public:(derive-public:(from-extended:bip32 xpub) change) index)
|
|
[%bech32 (need (encode-pubkey network pubkey))]
|
|
--
|
|
--
|