Settings

Theme

Show HN: StarkZap – Gasless Bitcoin Payments SDK for TypeScript

github.com

6 points by starkience 7 days ago · 27 comments · 2 min read

Reader

StarkZap is an open-source TypeScript SDK for adding Bitcoin-backed asset transfers, balances, lending & borrowing and staking to web, mobile, or server apps. The goal is to let developers integrate programmable Bitcoin assets without requiring users to install wallets, manage seed phrases, or hold gas tokens. Under the hood it runs on Starknet and supports WBTC, tBTC, LBTC, SolvBTC, and other Bitcoin-backed ERC20 tokens.

```import { StarkZap, StarkSigner, Amount, fromAddress, getPresets } from "starkzap";

const sdk = new StarkZap({ network: "sepolia" }); const wallet = await sdk.connectWallet({ account: { signer: new StarkSigner("0xYOUR_PRIVATE_KEY") } });

await wallet.ensureReady({ deploy: "if_needed" });

const { STRK } = getPresets(wallet.getChainId()); const balance = await wallet.balanceOf(STRK);

if (balance.gte(Amount.parse("10", STRK))) { const tx = await wallet.transfer(STRK, [ { to: fromAddress("0xRECIPIENT"), amount: Amount.parse("10", STRK) } ]); await tx.wait(); console.log(tx.explorerUrl); } ```

Key properties: - Gas sponsorship via paymaster (users don’t need gas tokens) - Multiple auth strategies (email/social via Privy, passkeys via Cartridge) - Batch transfers and contract calls in a single atomic transaction - Works in Node, browser, and React Native

The SDK abstracts account management, fee handling, and wallet popups. This won’t make sense for every app (e.g., if you only need fiat checkout). It’s for existing apps that want programmable onchain assets without the wallet UX.

Would appreciate feedback on the API design and whether this abstraction makes sense.

starkienceOP 7 days ago

We wrote a deeper technical breakdown of the architecture here: https://dev.to/akashneelesh/bring-bitcoin-to-your-app-now-in...

High-level architecture: Accounts are smart contract wallets on Starknet Fees are covered via a paymaster contract It's meant for any builder, you don't have to be a blockchain expert to build with it. Transactions are batched and submitted atomically, so you keep the UX of your existing app.

starkienceOP 7 days ago

Happy to answer questions about the trust model, custody assumptions, gas economics, or why Starknet vs other Ethereum layer-2s approaches :)

wind_rider 6 days ago

That’s awesome!and how long does it take to go from npm install to first working transaction roughly?

  • starkienceOP 6 days ago

    it really depends on what you're building, but when I tested it out I had a simple webapp that tracks how often I blink, and it took me 30min to everything live and deployed on Starknet.

KodawariTitan 7 days ago

Wow, it looks very interesting, you are saying that now web2 apps can have crypto functionalities in minutes?

  • starkienceOP 7 days ago

    yeah that's the goal of the sdk. I've seen a couple do it already and it's pretty interesting

sizero 7 days ago

Excited to see this. Is this just for Bitcoin-related assets, or does it also help with e.g. stablecoins?

  • starkienceOP 7 days ago

    It actually works with any asset that is listed onchain. So tokens such as ETH and others also work. As long as the token is live on the Starknet network, it can be used. I think the cool thing is that some tokens have interesting yield strategies, so you can cherry-pick the strategies you like the most and want to add to your app.

lyskey 7 days ago

So this is basically an SDK to remove blockchain complexity and add new revenue streams to an app.

Interesting.

  • starkienceOP 7 days ago

    yep, noticed many web2/SaaS devs struggle with blockchain integrations. So it's in Typescript to make it easy to ship. In theory, you can cherry-pick the blockchain features you need for your app (e.g., you're a tradFi stock exchange app and want to add perpetual contracts for index and tradFi assets, so you select the 'perps' module in the SDK) and you don't have to re-design or architect yourself smart-contracts

sisyfos 7 days ago

Noice! Bitcoin on any app thanks to this SDK!

vianlad 7 days ago

i have never worked on blockchain, can i still be able to use this easily ?

serum420 7 days ago

amazing stuff

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection