grants-program icon indicating copy to clipboard operation
grants-program copied to clipboard

CB-2Q23-03.1 : sBTC Bridge: API Continuation

Open will-corcoran opened this issue 1 year ago • 12 comments

Discussed in https://github.com/stacksgov/Stacks-Grant-Launchpad/discussions/847

Originally posted by will-at-stacks March 17, 2023

Introduction:

sBTC is a SIP-010 fungible token on the Stacks blockchain that can be used in DeFi protocols, NFT marketplaces, DAOs, governance, and several other use-cases. The sBTC Bridge is a trustless two-way mechanism that allows users to wrap and unwrap BTC as sBTC. The sBTC Bridge is also a key component to sBTC operations. The development of an initial prototype for the sBTC Bridge has been led by @radicleart , you can review the sBTC Bridge repo here.

Critical Bounty Mission Statement:

The purpose of this Critical Bounty is to champion the continued development of the sBTC Bridge API is the focus of this Critical Bounty. Required development improvements include: Unfinished Work:

  1. Filtering and Sorting
  2. Caching
  3. Replacing 3rd party service with a 1st party Bitcoin API, such as Bitcoin-sync or ElectrumX

Functionality / Deliverables (shall include, but not be limited to):

Statement on remaining work from original development plan: This component is a stateless, open API whose primary purpose is to make the sbtc-bridge application fast.

  • It will achieve this by pre-reading and aggregating sBTC related blockchain and smart contract state into a Mongo database.
  • Secondary purpose to provide additional metrics and business intelligence for SBTC.
  • This component can be readily extended via Websocket API.
  • Product 'roadshow', feedback, and improvements: All recipients will be responsible for demonstrating functionality, championing early adoption, gathering feedback, and making one to two rounds of high-impact, feedback-based improvements.
  1. API application deployed via docker, provides;    - access to bitcoin rpc and stacks node rpc    - reads/caches contract event data on schedule    - NodeJS / Typescript application
  2. Mongodb deployed via docker
  3. Deployment on GCP k8 Cluster
  4. Features
  5. Read and index sbtc peg in txids
  6. Read and index sbtc peg out txids
  7. Rest API calls to return these txids

Precise feature list is forthcoming. The estimate time to completion for a working prototype deployed on testnet implementing the minimal feature set above is 20-23 days.

Required Knowledge / Skills:

  • Understanding of Stacks and Bitcoin blockchain transaction structure.
  • RPC API development using NodeJS
  • Tools: Typescript, NodeJS, MongoDB, Docker, Kubernetes, Google Cloud for deployment

References:

  1. sBTC Whitepaper
  2. Stacks Nakamoto Release Whitepaper
  3. sBTC project dashboard
  4. Clarinet Docs (reference for design system req’d for Typescript applications wrapped within a Rust application)
  5. TM Repo (code & documentation standard)
  6. sBTC Bridge Project Document

Critical Bounty Fee:

  • Maximum Fee: $20,000

Reviewers / Advisors:

Igor Sylvester, Core Engineering Lead, Trust Machines Sergey Shandar, Core Engineer, Trust Machines Mike Cohen, EcosystemDAO Jesse Wiley, Integration and Security Lead, Stacks Foundation Kenny Rogers, Developer Advocate, Stacks Foundation Will Corcoran, Grants Lead, Stacks Foundation

Additional Comments:

Recipient will be expected to attend sBTC Core Engineering Working Group calls while the bounty is in development and provide weekly updates.

APPLY HERE


NOTES ABOUT CRITICAL BOUNTIES:

If you have thoughts, questions, or comments on the rough outline for this Critical Bounty above, please comments below.

Please note, all 2023 Q2 Critical Bounties that have funding approved for them will be moved to the Issues page (here) on Tuesday 03/21/2023.

Some procedural items to keep in mind with 2023 Q2 Critical Bounties:

  1. Each Critical Bounty will have a pre-approved minimum and maximum budget listed within the issue.
  2. All applications will be submitted via a BlockSurvey which will be linked within the Issue.
  3. Applications will be open from 03/21/2023 to 04/03/2023.
  4. Critical Bounty applications will be reviewed by relevant members of the sBTC Core Engineering Team and technical staff from the Stacks Foundation.
  5. The selected recipient will be the low, qualified bidder (in the eyes of the reviewers).
  6. Selected Critical Bounty recipients will be announced on 04/07/2023 and will be expected to start work immediately and attend sBTC Core Engineering meetings to provide weekly updates on their work.

will-corcoran avatar Mar 21 '23 20:03 will-corcoran

👋 @will-at-stacks Thanks for your application! We will do a pre-review and let you know if we have any immediate questions. In the mean time please refer to our review schedule here for a detailed timeline and response dates. Best, Will

stacks-foundation avatar Mar 21 '23 20:03 stacks-foundation

Congrats on being awarded this Critical Bounty @mijoco for $18k

Supplementary funding is also going to @macxim for UX/UI services for $4,480

Congrats to you both.

More information on this Critical Bounty can be found here

will-corcoran avatar Apr 18 '23 14:04 will-corcoran

Thank you @will-at-stacks and @stacks-foundation .

Look forward to working you @Macxim !

mijoco-btc avatar Apr 18 '23 14:04 mijoco-btc

@radicleart please post your original application for the Critical Bounty here for public awareness.

Thanks, Will

will-corcoran avatar Apr 19 '23 16:04 will-corcoran

Bounty Application: sBTC Bridge API

CB-2Q23-03.1 : sBTC Bridge: API Continuation #872

The sBTC Bridge API is missing some important features. This proposal addresses the needs of Bounty #872 by providing estimates for the delivery of features needed to turn sBTC Bridge API into an enterprise class restful application.

This proposal further develops the existing sBTC Bridge API which is openly available in github;

Features & Costs

sBTC Bridge API

Filtering, paging and sorting (8 days);

  1. Ability to filter API results intuitively using path/query string parameters
  2. Ability to sort API results intuitively using path/query string parameters
  3. Ability to page API results intuitively using path/query string parameters

Caching (4 days)

  1. Intelligent caching of API data - where applicable.

Websockets (4 days)

  1. Integrate websocket endpoints into the API.
  2. Consume websockets;
    1. Demonstrate ability for clients to subscribe to user and signer requests and fulfilments

3rd Party Independence (12 days)

  1. Investigation of Bitcoin indexing solutions; Bitcoin-sync and ElectrumX
  2. Integration of indexing solution
  3. Handling of CI and deployment issues

Documentation & Deployment (2 days)

  1. Documentation of end points using Swagger.
  2. Deployment on GCP k8 Cluster

Delivery includes presenting regular progress reports at SIP Community Calls and sBTC public meetings. We will ensure high levels of adoption and opportunities for feedback on the tools delivered via the Bitcoin Builders Discord channel.

Costs

Figures in 8 hour person days at 75 USD per hour.

Total 30 days: $18,000

mijoco-btc avatar Apr 19 '23 16:04 mijoco-btc

This grant is completed - see GitBook for details.

Work on the Bridge is ongoing @will-at-stacks I submitted an application for continued funding for the work to support the alpha release and for supporting sBTC Mini. Can't see this application in the bounty list - is it in the system ?

mijoco-btc avatar Jun 26 '23 11:06 mijoco-btc

@radicleart yep! the grant request is on my radar

This grant is completed - see GitBook for details.

Work on the Bridge is ongoing @will-at-stacks I submitted an application for continued funding for the work to support the alpha release and for supporting sBTC Mini. Can't see this application in the bounty list - is it in the system ?

will-corcoran avatar Jun 29 '23 00:06 will-corcoran

Update 5 Jul.

sbtc-bridge-api

23 Pull Requests completed to date

  1. PR 44 is the back end work for the two API apps (testnet and mainnet) to connect to testnet/mainnet bitcoin nodes on the staging (linode) servers.
  2. PR 35 keeping the api docs up to date

sbtc-bridge-web

121 Pull Requests have been completed!

  1. PR 167 means the staging application https://bridge.stx.eco can now connect to both testnet and mainnet Bitcoin nodes.
  2. PR 152 implements Maximes design system and brings the bridge to life.
  3. PRs 170, 169, 168 provide substantial UI/UX improvements.

Work is ongoing responding to feedback from various stake holders with several enhancements planned via Issues in Github. See GitBook for regular updates.

mijoco-btc avatar Jul 05 '23 10:07 mijoco-btc

July 25th

PR 193 Several days debugging byte array and hex strings with @netrome. hard work paid off - led to first successfuly sBTC Alpha withdrawal: https://twitter.com/radicleart/status/1683801378668396545

July 18th

Testing and improvements of the withdrawal for op_return see discord and Issue 187 Currency support - see PR 185

attn: @will-at-stacks

mijoco-btc avatar Jul 25 '23 12:07 mijoco-btc

Very cool @radicleart !!!

will-corcoran avatar Jul 26 '23 00:07 will-corcoran

July 26th

See PR 53 covers work needed to support Coordinator development around agreement on wire format for deposit and withdrawal payloads and especially on building embedded signature for the withdrawal payload.

mijoco-btc avatar Jul 26 '23 10:07 mijoco-btc

August 7th

PR 202 Separate sBTC alpha deployment PR 200 Currency support in UI PR 59 Separate sBTC alpha deployment PR 56 Feat/55 signer api microservice PR 53 Withdrawal and deposit payloads for sBTC Alpha

mijoco-btc avatar Aug 07 '23 14:08 mijoco-btc