stacksgov / critical-bounties

Critical Bounties are RFP-based grants for key Stacks infrastructure. Addressing ecosystem needs through targeted funding.
https://stacks.org/grants
1 stars 0 forks source link

Stacks.rs (Stacks Library for Rust) #4

Closed will-corcoran closed 5 months ago

will-corcoran commented 1 year ago

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

Originally posted by **will-at-stacks** March 17, 2023 ### Introduction: While sBTC is currently the mission-critical project within the Stacks ecosystem, it is important to also support the development of Stacks Libraries and SDKs. By doing so, developers fluent in various languages will be more compelled to contribute to Stacks projects. ### Critical Bounty Mission Statement: This Critical Bounty aims to support the development of a Stacks Rust Library. Its development will need to be done in conjunction with the Stacks Rust Library (also a 2023 Q2 Critical Bounty). The Stacks Rust Library should comply with either the Apache2 or MIT permissive licensing. Additionally, it cannot depend on any reference implementation for Stacks that is GPL-licensed. ### Functionality / Deliverables (shall include, but not be limited to): - target WebAsm, in this case we can use the library in JavaScript, for example in stacks.js. - consistent serialization/deserialization Rust and JS ClarityValues into string (Clarity lang). - Rust library matching functionality of both microstacks and stacks.js. - Developer documentation deployed to docs.rs - Crate deployed to crates.io - 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. ### Required Knowledge / Skills: - Experience developing libraries in Rust. - Familiarity with Javascript and stacks.js ### References: 1. [Clarinet Docs](https://github.com/hirosystems/clarinet) (reference for design system req’d for Typescript applications wrapped within a Rust application) 2. [TM Repo](https://github.com/Trust-Machines/core-eng/tree/main/stacks-signer) (code & documentation standard) 3. [Stacks.rs Discussion](https://github.com/Trust-Machines/core-eng/issues/64#issuecomment-145878615) 4. https://crates.io/crates/pyo3 5. https://pypi.org/ ### Critical Bounty Fee: - Maximum Fee: $16,000 ### Reviewers / Advisors: [Igor Sylvester](https://github.com/igorsyl), Core Engineering Lead, Trust Machines [Mårten Blankfors](https://github.com/netrome), Core Engineer, Trust Machines [Sergey Shandar](https://github.com/sergey-shandar), Core Engineer, Trust Machines [Jesse Wiley](https://github.com/wileyj), Integration and Security Lead, Stacks Foundation [Kenny Rogers](https://github.com/kenrogers), Developer Advocate, Stacks Foundation [Will Corcoran](https://github.com/will-at-stacks), 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](https://stx.is/5kVQbn)** ---- 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](https://github.com/stacksgov/Stacks-Grant-Launchpad/issues?q=is%3Aopen+is%3Aissue+label%3A%22CRITICAL+BOUNTY%22)) 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. 6. The selected recipient will be the low, qualified bidder (in the eyes of the reviewers). 7. 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.
stacks-foundation commented 1 year ago

👋 @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

diwakergupta commented 1 year ago

@will-at-stacks @igorsyl I'm still not sure I understand exactly what is in scope for such a library, especially relative to something like https://github.com/hirosystems/stacks-encoding-native-js -- is there a more detailed scope description somewhere?

igorsyl commented 1 year ago

@diwakergupta sBTC needs a Rust library with no js dependencies.

diwakergupta commented 1 year ago

@diwakergupta sBTC needs a Rust library with no js dependencies.

I get that, I was asking more about exactly what's the scope of this Rust library. Is there a doc that covers the required functionality?

igorsyl commented 1 year ago

Yes, it's in this issue description.

will-corcoran commented 1 year ago

@rswol Congrats on being awarded this Critical Bounty for $16k

More information on this Critical Bounty can be found here

will-corcoran commented 1 year ago

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

Thanks, Will

lgalabru commented 1 year ago

I'm also having a hard time understanding the scope of this lib. Have you tried using https://crates.io/crates/clarity-vm? This crate is being produced by this PR, that we should definitely wrap-up: https://github.com/stacks-network/stacks-blockchain/pull/3478.

will-corcoran commented 1 year ago

I'm also having a hard time understanding the scope of this lib. Have you tried using https://crates.io/crates/clarity-vm? This crate is being produced by this PR, that we should definitely wrap-up: stacks-network/stacks-blockchain#3478.

@rswol thoughts?

igorsyl commented 1 year ago

sBTC team needs to use stacks.js primitives from Rust and we rather not run an embedded JS VM.

BowTiedDeployer commented 1 year ago

Degens team would also find this helpful. With methods to call following the same way as the stacks.js library, both for read-only and smart contract calls it would be easier and more efficient to develop.

The conversion to and from clarity values to the pramming language used ( js/rust ) is also very important. It is very straightforward to convert using stacks.js, by having well defined conversion methods. At the moment in rust it is a process in itself to find how to process the information to do the wanted operations and get the needed values in the right format.

diwakergupta commented 5 months ago

@will-corcoran is this actually completed? If yes, can you include pointers to the deliverables (the Rust create, link to docs, GH repo etc)?