Skip to content

typescript sdk#2853

Open
UnArbosSix wants to merge 43 commits into
bittensor-core-explorationfrom
bittensor-core-typescript-sdk
Open

typescript sdk#2853
UnArbosSix wants to merge 43 commits into
bittensor-core-explorationfrom
bittensor-core-typescript-sdk

Conversation

@UnArbosSix

@UnArbosSix UnArbosSix commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Add a first-party TypeScript SDK backed by the shared Rust bittensor-core implementation. This avoids reimplementing key handling, SCALE/runtime operations, timelock cryptography, metadata digests, Ledger support, and MEV-shield primitives in JavaScript.

Changes

  • Added sdk/typescript-sdk, including CommonJS and ESM entry points and TypeScript declarations.
  • Added a Node-API native bridge over bittensor-core for keys, runtime metadata and SCALE operations, signed extrinsics, timelock operations, ML-KEM, metadata digests, and Ledger support.
  • Added lossless conversion for bytes, large integers, and maps with non-string keys.
  • Added Polkadot.js, PAPI, and Moonwall-compatible keypair adapters.
  • Updated TypeScript test utilities to use the Rust-backed SDK.
  • Added SDK unit tests and a dev-chain transaction-signing e2e test.
  • Updated the TypeScript e2e workflow to build and distribute the native SDK artifact.

Files of interest

  • sdk/typescript-sdk/native/ — Node-API binding layer
  • sdk/typescript-sdk/src/ — TypeScript API and compatibility adapters
  • sdk/typescript-sdk/test/basic.test.cjs — package-level tests
  • ts-tests/suites/dev/sdk/test-typescript-sdk.ts — chain integration test
  • .github/workflows/typescript-e2e.yml — SDK build and e2e integration

Behavioral impact

TypeScript consumers can use the shared Rust implementation through @bittensor/sdk. Existing e2e helpers now create and use Rust-backed keypairs. This PR does not change on-chain runtime behavior.

Migration and spec version

No storage migration is required. No runtime spec-version bump is required because the runtime is unchanged and the target branch has no network spec-version check.

Testing

CI builds and type-checks the SDK, runs its package tests, and submits a signed transaction through the dev-chain e2e suite.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview, Comment Jul 12, 2026 2:59am

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread sdk/typescript-sdk/src/keys.ts Outdated
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH scrutiny: 10-day-old account with no public repositories, mitigated by repository write permission, matching commit authorship, and no known Gittensor association; bittensor-core-typescript-sdk → bittensor-core-exploration.

No protected AI-review or Copilot instruction files were modified. Static review found no malicious behavior or security vulnerability in the SDK, native key-handling boundaries, locked dependencies, build scripts, or fork-gated CI execution.

Findings

No findings.

Conclusion

The prior wasm-pack supply-chain concern remains resolved, and the current diff introduces no new security findings.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor association UNKNOWN; very new contributor with repository write access, so this large SDK addition received heightened correctness scrutiny.

Description discrepancy

The implementation was renamed, but the PR body still references sdk/typescript-sdk, test-typescript-sdk.ts, and .github/workflows/typescript-e2e.yml. Update these to sdk/bittensor-ts, test-bittensor-ts.ts, and .github/workflows/bittensor-ts-e2e.yml.

No spec-version bump applies to this non-network base branch. The overlapping PRs are complementary rather than duplicates.

Findings

No findings.

Conclusion

The latest compatibility additions preserve the existing typed APIs and have focused coverage. Only the non-blocking stale paths in the PR description remain.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/wire.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread .github/workflows/typescript-e2e.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread .github/workflows/typescript-e2e.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/bittensor-core/Cargo.toml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/scripts/check-native-parity.cjs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant