Inspiration

Current PoX contract maintains onchain mapping of STX addresses to BTC addresses. Wouldn't it be nice to convert this on-chain?

What it does

provides library for converting public keys to bitcoin addresses

How we built it

using clarity smart contract functions that can be called by other smart contracts

Challenges we ran into

manipulating buffers without dynamic loop constructs in clarity language

Accomplishments that we're proud of

successfully implementing p2pkh, p2sh & p2sh-p2wpkh conversions

What we learned

details of various btc address formats and base58check encoding implementing buffer manipulation

What's next for pub2btc

  • add support for bech32 encoding
  • add taproot address support
  • add sample contracts using on-chain functions from pub2btc

Built With

Share this project:

Updates