- Typescript - See https://www.typescriptlang.org/docs/home.html for details
- Follow Decred Code Contributions 4 to 6 - See https://github.com/decred/dcrd/blob/master/docs/code_contribution_guidelines.md for details. Summary/Outline:
- 4.1 Share Early, Share Often (Announce plans, share iterations as developed)
- 4.2 Ensure Adequate Testing (Testing should reflect that this is financial software)
- 4.3 Document and Comment (EG. functions should be commented with intended purpose and assumptions)
- 4.4 Git Commit per Message Model (clean commit history with well-formed commit messages, see example in link)
- 5.1 Follow Code Review (establish maintainers/owners and ensure peer review, see specifics in link)
- 5.2 Rework Code (ensure all rework requests from code review are completed)
- 5.3 Code Acceptance (integrate accepted code with the master to keep a clean commit history rather than merge commits)
- 6.1 Contribution Checklist - Follow all steps in code contribution checklist (replace the GO step with Typescript above)
- 6.1 Licensing of Contributions - All contributions must be licensed with the ISC license: https://github.com/decred/dcrd/blob/master/LICENSE
- Create and sign regular transactions.
- Create and sign stake transactions.
- Understand/Generate addresses.
- Work with p2pkh, p2sh and multisig scripts.
- Clean, and versioned, API for consumers.
I would add that the library should be platform agnostic and work under browsers and nodejs. Ideally, the library should optionally accept some crypto routines as injections to allow the wallet to provide accelerated versions of those routines. ie secp256k1, sha256, pbkdf2, and random(). All of these should accept async function injections as native code accelerated functions have to be async in most implementations.
In addition to just creating and signing transactions, I would add parsing of transactions as well.
Also, since most wallets use pre-existing bitcoin libraries for all transaction parsing and creation, I would make sure that the part of Decred that differs from bitcoin be usable as a simple standalone module. ie. some currencies such as Groestlecoin differ by only the hashing algo used for addresses and transaction creation. That hashing algo is made available as a standalone function vs having to use an entire Groestlecoin library to create a tx.