@@ -0,0 +1,73 @@
2+title = "Extending the Bitcoin Provider API"
6+grant_type = [ "Apprenticeship" ]
7+grant_category = [ "App Dev", "Other" ]
12+reward = "$8000 in WSTR"
13+mentor = "~dasrun-fadben"
16+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=A0138&prefill_Grant+Name=Extending%20the%20Bitcoin%20Provider%20API"
19+## Project Description
21+The blockchain is large, and networked storage can be expensive. We want to run bitcoin-enabled applications on urbit, but not everyone on the network will want to run a full node.
23+The solution so far has to been to create "provider" nodes that peers can subscribe to for access to the blockchain network. This is similar to the "SPV" approach.
25+This provider agent accesses the bitcoin daemon and electrs server (a rust electrum implementation) through a proxy server.
27+However, the initial API was limited to the basic functionality necessary for the first urbit bitcoin wallet. It needs to be extended for other apps, including lightning.
29+Our goal in this project is to extend it with a view towards these additional use cases.
33+- Knows some functional programming and is interested in learning Hoon
35+- Has done backend webdev or otherwise coded against REST APIs
37+- Has experience with or is interested in bitcoin development
41+For someone with zero familiarity with urbit and bitcoin APIs, and working 10 hours a week or less, I would estimate 3-4 weeks.
45+- Add support for regtest to the bitcoin codebase
47+ - add %regtest to network type defined in /=bitcoin=/sur/bitcoin.hoon
49+ - modify functions in /=bitcoin=/lib/ to handle this updated type appropriately
51+ - update server.js in RPC repo to support new network configuration
53+ - run some "functional tests", sending and receiving transactions using regtest configuration
55+- Add the following electrum method calls to the proxy server and %btc-provider agent:
57+ - blockchain.block.headers :: fetch headers for a range of heights
59+ - blockchain.transaction.id_from_pos :: get txid for a block height and position
61+ - blockchain.estimatefee :: estimate current feerate for confirmation target
63+ - mempool.get_fee_histogram :: query mempool feerates
65+- Add the following bitcoind method calls to the proxy server and %btc-provider agent
67+ - utxoupdatepsbt :: add utxos to a PSBT
69+Patches should be submitted to:
71+[bitcoin rpc proxy](https://github.com/urbit/urbit-bitcoin-rpc)
73+[bitcoin agents](https://github.com/urbit/urbit)