diff --git a/app/btc-bridge.hoon b/app/btc-bridge.hoon index 26b5b5e23d..0f8b9cfe1c 100644 --- a/app/btc-bridge.hoon +++ b/app/btc-bridge.hoon @@ -43,7 +43,7 @@ ?+ q.vase (on-poke:def mark vase) %status :_ this - ~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%get-block-count ~])]] + ~[[%pass / %agent [our.bowl %btc-node-hook] %poke %btc-node-hook-action !>([%ping ~])]] == == :: diff --git a/lib/btc-scratch.hoon b/lib/btc-scratch.hoon index fed4758455..7bf28d5d44 100644 --- a/lib/btc-scratch.hoon +++ b/lib/btc-scratch.hoon @@ -1,10 +1,9 @@ :: btc-scratch.hoon +/- *btc /+ bip32, btc =+ ecc=secp256k1:secp:crypto =, bech32:btc |% -+$ bech32-address $%([%bech32 tape]) -+$ address ?(@uc bech32-address) ++ bip84 |_ [network=network:btc xpub=tape] ++ address diff --git a/lib/btc.hoon b/lib/btc.hoon index 914cee3725..06d38c2c59 100644 --- a/lib/btc.hoon +++ b/lib/btc.hoon @@ -1,5 +1,5 @@ +/- *btc |% -+$ network ?(%main %testnet) ++ hash-160 |= pubkey=@ux ^- @ux @@ -154,5 +154,6 @@ %+ encode-raw u.prefix (weld ~[0] (convert:bits 8 5 (hash-160 pubkey))) -- + :: -- diff --git a/sur/btc-bridge.hoon b/sur/btc-bridge.hoon index 28e1b973b7..3c510181f1 100644 --- a/sur/btc-bridge.hoon +++ b/sur/btc-bridge.hoon @@ -1,14 +1,15 @@ +/- *btc |% -+$ address ?(@uc [%bech32 @t]) +$ tx @ +$ credentials [rpc-url=@t rpc-user=@t rpc-password=@t] -+$ bio $: mode=?(%remote %local) - =credentials :: for connecting to btc-provider - clients=(set ship) :: allowed clients for this node - == ++$ status + $: [%host connected=? clients=(set ship)] + [%client connected=? host=ship] + == +$ action - $% [%connect =credentials] - [%status ~] + $% [%connect-as-host =credentials] + [%connect-as-client host=ship] + [%check-status ~] [%balance =address] [%transactions =address] [%broadcast-tx =tx] diff --git a/sur/btc.hoon b/sur/btc.hoon new file mode 100644 index 0000000000..67990da6ff --- /dev/null +++ b/sur/btc.hoon @@ -0,0 +1,5 @@ +|% ++$ network ?(%main %testnet) ++$ bech32-address $%([%bech32 tape]) ++$ address ?(@uc bech32-address) +--