Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export crypto package #11

Open
roccomuso opened this issue Sep 30, 2020 · 1 comment
Open

export crypto package #11

roccomuso opened this issue Sep 30, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@roccomuso
Copy link

roccomuso commented Sep 30, 2020

Would be useful to extract all the siacoin related crypto fns in a separate package.

Is there any doc available around that show how to encode a siacoin address and create and sign a tx?

@n8maninger
Copy link
Contributor

n8maninger commented Sep 30, 2020

I agree, the WASM code is pretty poorly architected and a major source of maintenance issues. The frontend handles a lot of the structure and management of wallets right now, something I'd like to move away from.

I have started to restructure and shift management fully into a separate package with the goal being a single open source package with simple "lite" non-custodial support of multiple currencies: SC, HNS, BTC, ETH, etc. Ideally they would be fairly independent so wrappers could be created for use outside of browsers.

Since the important crypto functions are written in Go a lot of the Siacoin logic and types are imported directly from gitlab.com/NebulousLabs/Sia. The only places where this is not true is where there were dependencies that would not work in WASM like BBolt.

How addresses are encoded:
https://gitlab.com/NebulousLabs/Sia/-/blob/master/types/signatures.go#L181

For building a transaction, there is no great documentation I'm aware of. The closest thing is probably looking at the official Sia Ledger support article. It covers the basic structure of building a transaction towards the bottom.

https://support.sia.tech/article/1tteqxvgh0-sia-ledger
https://gitlab.com/NebulousLabs/nanos-app-sia/-/blob/master/sialedger.go

Another good place is Luke's Walrus server and Walrus-CLI. It's similar, but takes a different approach to how keys are managed.

https://github.com/lukechampine/walrus
https://github.com/lukechampine/walrus-cli

@n8maninger n8maninger added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants