on master help sign in
Add Extending Bitcoin Provider API apprenticeship (#1354)

* Add Extending Bitcoin Provider API apprenticeship * Fix date and formatting * Add more deliverable detail

commit5054fdbcc928c2ca6af7c9cc6c19e43b2fa039ac authormikeosborne <mike@urbit.org> dateFri 4 Mar 2022, 10:58 (5 years ago) parentdbadb7e
1 file changed+73
content/grants/apprenticeship-extending-bitcoin.md+73
content/grants/apprenticeship-extending-bitcoin.mdnew file+73
@@ -0,0 +1,73 @@
1++++
2+title = "Extending the Bitcoin Provider API"
3+date = "2022-03-03"
4+
5+[taxonomies]
6+grant_type = [ "Apprenticeship" ]
7+grant_category = [ "App Dev", "Other" ]
8+
9+[extra]
10+image = ""
11+description = ""
12+reward = "$8000 in WSTR"
13+mentor = "~dasrun-fadben"
14+assignee = ""
15+completed = false
16+work_request_link = "https://airtable.com/shr4qt9t9kz7RaOIa?prefill_Grant+ID=A0138&prefill_Grant+Name=Extending%20the%20Bitcoin%20Provider%20API"
17++++
18+
19+## Project Description
20+
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.
22+
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.
24+
25+This provider agent accesses the bitcoin daemon and electrs server (a rust electrum implementation) through a proxy server.
26+
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.
28+
29+Our goal in this project is to extend it with a view towards these additional use cases.
30+
31+## Prerequisites
32+
33+- Knows some functional programming and is interested in learning Hoon
34+
35+- Has done backend webdev or otherwise coded against REST APIs
36+
37+- Has experience with or is interested in bitcoin development
38+
39+## Time Estimate
40+
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.
42+
43+## Deliverables
44+
45+- Add support for regtest to the bitcoin codebase
46+
47+ - add %regtest to network type defined in /=bitcoin=/sur/bitcoin.hoon
48+
49+ - modify functions in /=bitcoin=/lib/ to handle this updated type appropriately
50+
51+ - update server.js in RPC repo to support new network configuration
52+
53+ - run some "functional tests", sending and receiving transactions using regtest configuration
54+
55+- Add the following electrum method calls to the proxy server and %btc-provider agent:
56+
57+ - blockchain.block.headers :: fetch headers for a range of heights
58+
59+ - blockchain.transaction.id_from_pos :: get txid for a block height and position
60+
61+ - blockchain.estimatefee :: estimate current feerate for confirmation target
62+
63+ - mempool.get_fee_histogram :: query mempool feerates
64+
65+- Add the following bitcoind method calls to the proxy server and %btc-provider agent
66+
67+ - utxoupdatepsbt :: add utxos to a PSBT
68+
69+Patches should be submitted to:
70+
71+[bitcoin rpc proxy](https://github.com/urbit/urbit-bitcoin-rpc)
72+
73+[bitcoin agents](https://github.com/urbit/urbit)