This guide defines the compatibility, deprecation, release, and pull request rules for the SDK. The package exposes cryptographic chain modules, so contributors should treat API shape, exported types, package entry points, and cryptographic behavior as part of the public contract.
Use semantic versioning for every release:
- Major versions are for breaking changes that require users to change code, data assumptions, or deployment configuration.
- Minor versions are for backward-compatible features, new chain support, and additive exports.
- Patch versions are for backward-compatible fixes, documentation corrections, and internal-only changes.
| Change | Version bump | Examples |
| ----------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| New chain module | Minor | Adding @wraith-protocol/sdk/chains/hedera is minor because existing imports keep working. Adding chains/stellar helpers while preserving current Stellar exports is also minor. |
| New function exported from a chain module | Minor | Exporting validateMetaAddress() from chains/stellar is minor. Exporting buildAnnouncementMemo() from chains/evm is minor. |
| Function signature changed | Major | Changing scanAnnouncements(announcements, viewingKey, spendingPubKey, spendingKey) to accept one options object is major. Changing generateStealthAddress() to return renamed fields is major. |
| Function removed | Major | Removing deriveStealthPrivateKey() from EVM is major. Removing decodeStealthMetaAddress() from any chain module is major. |
| Crypto behavior changed | Major | Changing a domain-separation prefix is major. Changing the view-tag derivation scheme is major. |
| Type tightened | Major | Changing string to `0x${string}` for an accepted user input is major. Changing Uint8Array input to a fixed-length branded type is major unless the previous type still works. |
| Type loosened | Minor | Accepting ReadonlyArray<Announcement> where Announcement[] worked before is minor. Accepting HexString | Uint8Array is minor if existing callers still type-check. |
| Bundler config or exports changed | Major or patch | Removing a package subpath from exports is major. Adding a missing CommonJS condition for an existing subpath is patch if no import path changes. |
| Dependency major bumped | Major or minor | Bumping @noble/curves from 1 to 2 is major if it changes public types or runtime support. It can be minor if the SDK API and supported runtimes are unchanged. |
| Default network or RPC URL changed | Major or minor | Changing a default from mainnet to testnet is major. Rotating to an equivalent healthy RPC endpoint is minor if behavior is unchanged. |
| Bug fix that changes buggy behavior | Patch or major | Fixing an invalid checksum calculation is patch if it makes documented behavior work. Changing accepted malformed meta-addresses to throw is major if users may rely on parsing them. |
When a change is ambiguous, choose the larger bump and document why in the changelog.
Deprecated exports remain available for one major version after the replacement ships.
- Mark deprecated symbols with
@deprecatedJSDoc that names the replacement and target removal version. - Emit a runtime warning from deprecated functions when they are called. Avoid warnings merely from importing a module, because that can surprise bundlers and tests.
- Document every deprecation in
CHANGELOG.md. - Add migration steps to
MIGRATING.mdwhen the replacement requires more than a one-line import change.
Examples:
- If
deriveStealthPrivateScalar()is replaced byderiveStealthPrivateKeyMaterial()in1.5.0, keep the old export through all1.xreleases and remove it in2.0.0. - If
encodeStealthMetaAddress(pubA, pubB)gains a clearerencodeStealthMetaAddress({ spendingPubKey, viewingPubKey })replacement, ship the object form first, mark the positional overload deprecated, and add a migration note before removing it in the next major.
Only maintainers with npm access may publish @wraith-protocol/sdk. Contributors prepare release-ready changes, but maintainers own version bumps, tags, and publication.
Pre-publish checklist:
- Run
pnpm test. - Run
pnpm build. - Run
pnpm format:check. - Update the version according to the semver policy.
- Update
CHANGELOG.md. - Check bundle output for every exported entry point.
- Tag the release as
vX.Y.Z. - Publish to npm.
Release cadence target:
- Patch releases: every two weeks when fixes are queued.
- Minor releases: monthly when additive features are ready.
- Major releases: quarterly at most, unless a security or cryptography correctness issue requires faster action.
Examples:
- A patch release that fixes Stellar transaction signing should run the Stellar tests, update
CHANGELOG.md, tagv1.4.6, and publish after review. - A minor release adding a Solana helper should include tests, docs, an additive changelog entry, tag
v1.5.0, and verify the./chains/solanaexport in the built package.
Use Conventional Commits for PR titles and commit messages where practical:
feat(stellar): add payment memo helperfix(evm): reject malformed stealth meta-address checksumsdocs: document semver policy
Prefer squash merging so each PR becomes one coherent commit on main. Maintainers may use a merge commit for long-running branches when preserving branch history is useful.
Required review:
- At least one maintainer review for docs, examples, and non-crypto internal changes.
- At least two maintainer reviews for cryptography, key derivation, package exports, or cross-chain conformance changes.
Examples:
- A README typo can be a
docs:PR with one maintainer review and no release note unless it changes user-visible setup instructions. - A change to
scanAnnouncements()should include tests, a semver note in the PR body, and two maintainers because it affects recipient fund discovery.
A new chain module should match the same shape as the existing EVM, Stellar, Solana, and CKB modules.
Checklist:
- Implement the conformance contract described in issue #8.
- Add
src/chains/<chain>/index.tswith the public exports. - Add key derivation, meta-address encoding/decoding, stealth address generation, scan, and spend helpers where the chain model supports them.
- Add unit tests and at least one end-to-end-style test matching the existing
test/chains/*structure. - Add examples under
examples/<chain>/. - Add the chain to the package build and
exportsmatrix. - Document the new entry point in
README.md.
Examples:
- Adding
chains/hederashould includesrc/chains/hedera/*, tests undertest/chains/hedera, examples underexamples/hedera, and a README entry point table row. - Adding a chain that cannot support private spend derivation should still expose the compatible parts of the conformance contract and document the unsupported operations explicitly.