Standard Grant: HTLC Upgrade for Sia for use in Atomic Swaps

As per our SoW document a demonstration of “Information Wallet Functionality” was expected to be delivered today.

However, due to previous blockers regarding ‘Index mode,’ development focus shifted from the HTTP client within the Komodo DeFi Framework to furthering the progress of the Sia Rust implementation. Significant progress has been made on the porting of relevant Sia Go types to our rust codebase. This work was originally planned further along into the stated timeline in our SoW.

We will provide an addendum to our SoW document detailing of our efforts thus far and timelines going forward alongside the monthly update July 2.

What progress was made on your grant this month?

  • Requested and received a script from Nate to generate an “Event” of each type. This is useful for developing the API client within the DeFi Framework.

  • Implemented all remaining data types necessary for V1 and V2 functionality. Work remains on implementing decoding and deserialization for some types involving file contracts and SiaFunds.

  • Significant effort was spent porting the “Event” type to Rust as this involves a complex Go interface and custom serialization.

  • Significant effort was spent testing and porting the parser of the miniscript-like SpendPolicy serialization. Testing was performed to analyze the security of the UnlockConditions backwards compatibility code within v2 consensus. Some feedback regarding this was provided to Nate via DM.

  • A bug in the serialization of the PolicyTypeUnlockConditions Go type was reported to Nate. The bug was fixed here: Change unlock conditions policy encoding to be unambiguous by n8maninger · Pull Request #173 · SiaFoundation/core · GitHub

  • The basic “Tier Nolan” atomic swap protocol has been adapted to Sia’s SpendPolicy idioms.

  • Many additional unit tests were published for both Go and Rust implementations.

  • An addendum to the original SoW document for the grant has been published detailing the current overall progress and new timelines for upcoming tasks.

Summarize any problems that you ran into this month and how you’ll be solving them.

  • Encountered undefined behaviors in various encoding methods in Sia core. These instances have been reported to the Sia development team. The Sia Rust encoding must be refactored. Previously we followed the assumption that encoding of a Transaction object will always succeed. We must now refactor this encoding to return Rust Results.

  • We identified the lack of a critical Walletd API endpoint. This was communicated to Nate. We requested and received the api/events/:id API endpoint enabling the DeFi Framework to check confirmations of arbitrary transactions.

  • A refactor of the UnlockKey type within Sia Rust was required to account for PR#173. Previously it was an acceptable assumption that any UnlockKey encountered over the API would be ed25519 and therefore have a 32 byte public key. The refactor was required to account for arbitrary length public keys and arbitrary algorithm Specifiers.

Links to repos worked on this month:

Working branch:

Demonstration of undefined behavior within Sia Go encoding:

Go unit tests:

SpendPolicy adaptation of Tier Nolan atomic swap protocol:

SoW Addendum:

What will you be working on next?

The team will shift focus almost entirely to the remaining work for the “Sia Rust” library in the coming month. This will enable us to rapidly integrate any remaining endpoints into the DeFi Framework’s Walletd API client.

1 Like

Hello @alrighttt

Thank you for your progress report!

Regards,
Kino on behalf of the Sia Foundation and Grants Committee

Hello @alrighttt,

This is a reminder that your progress report is due.

Please be sure to follow the Progress Report Template and submit your progress report by the 2nd of each month. Thanks!

Regards,
Kino on behalf of the Sia Foundation and Grants Committee

Progress Report Form
What progress was made on your grant this month?

Summarize any problems that you ran into this month and how you’ll be solving them.
Please summarize your issues into a few sentences or bullet points:

  • SpendPolicy parser whitespace handling proved an ongoing issue. This is now fully remedied by walletd API allowing JSON serialization of the SpendPolicy type.

Links to repos worked on this month:

What will you be working on next?
Please summarize your development goals into a few sentences or bullet points:

  • HD wallet support within the DeFi Framework API. Seed generation and path derivation inline with BIP39.

  • Transaction creation helpers and finalizing wallet operations support.

The item detailed in the SoW Addendum, “Interactive Wallet Functionality”, will be included alongside our monthly report on September 2. We aren’t satisfied with the level of completion for this task, and we prefer to give a more polished demonstration than we are capable of providing as of today.

Progress Report Form
What progress was made on your grant this month?

Sia Rust now acts a standalone Walletd client capable of running fully within a browser via WASM.

The Komodo Wallet frontend now supports activating SIA, viewing transaction history, sending and receiving funds.

A persistent public testnet has been established with a public indexer node hosted at https://sia-wallet.komodo.earth
GitHub - KomodoPlatform/walletd at komodo-testnet must be used to sync this testnet

We are prepping a public demo of a Komodo Wallet instance with Sia integrated. This will be made available shortly.

Summarize any problems that you ran into this month and how you’ll be solving them.
Please summarize your issues into a few sentences or bullet points:

  • No major technical hurdles.

  • This past month involved introducing additional team members to Sia for the first time. Our Frontend developers and QA team members have now begun significant efforts in each of their departments.

  • Some minor feedback regarding Walletd was provided resulting in Walletd pull requests #168, #170 and #172. Thanks, Nate!

Links to repos worked on this month:

1 Like

Hello, we are working on making the demo publicly available. We have identified issues with our HTTP client within the WASM version of Sia rust, and we are refactoring a major portion of it.

Progress can be tracked at the above repos. If any team members would like a technical overview of our current progress, please reach out here or on discord.

1 Like

Hello @alrighttt

Thank you for your Progress Report!

Regards,
Kino on behalf of the Sia Foundation and Grants Committee

Progress Report Form
What progress was made on your grant this month?

Summarize any problems that you ran into this month and how you’ll be solving them.

Links to repos worked on this month:

What will you be working on next?
Please summarize your development goals into a few sentences or bullet points:

Final delivery of the grant including release candidates of sia-rust and Komodo DeFi Framework with Sia fully integrated.