4 ms·
Show HN: StarkZap – Gasless Bitcoin Payments SDK for TypeScript
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.
- starkience 7mo agoWe wrote a deeper technical breakdown of the architecture here: https://dev.to/akashneelesh/bring-bitcoin-to-your-app-now-in-minutes-39oe 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.
- starkience 7mo agoHappy to answer questions about the trust model, custody assumptions, gas economics, or why Starknet vs other Ethereum layer-2s approaches :)
- lyskey 7mo agoSo this is basically an SDK to remove blockchain complexity and add new revenue streams to an app. Interesting.
- starkience 7mo agoyep, 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
- deleted 7mo ago[deleted]
- vianlad 7mo agoi have never worked on blockchain, can i still be able to use this easily ?
- serum420 7mo agoyes fooshure, i even managed to do it.
- starkience 7mo agoDid you already use it? what did you ship
- serum420 7mo agoamazing stuff
- starkience 7mo agoDid you get to try it out already?
- KodawariTitan 7mo agoWow, it looks very interesting, you are saying that now web2 apps can have crypto functionalities in minutes?
- starkience 7mo agoyeah that's the goal of the sdk. I've seen a couple do it already and it's pretty interesting
- sizero 7mo agoExcited to see this. Is this just for Bitcoin-related assets, or does it also help with e.g. stablecoins?
- starkience 7mo agoIt 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.
- time2buybitcoin 7mo ago[dead]
- starkience 7mo agoyup Bitcoin's UTXO model is fundamentally different, gasless doesn't apply there the same way. To clarify what the Starkzap SDK actually does: it operates on Starknet, which is an account-based L2 that settles on Ethereum. Bitcoin assets on Starknet are bridged representations, not native UTXOs (although Starknet will soon have a trust-minimized bridge with Bitcoin thanks to Alpen, removing trust assumptions) So when we say gasless, we mean the Starknet transaction fees are sponsored via a paymaster. The user doesn't need to hold STRK or ETH to transact. The cost is covered by the app or a paymaster service like AVNU (just like Amazon covers shipping costs). That's a design choice the app builder makes depending on their business model. On the stablecoin side: any stablecoin deployed on Starknet works with the SDK, and the paymaster covers the transaction fees if configured. The technical execution is what matters, and that's what the SDK focuses on. The code is open-source if you want to see how it's handled under the hood.
- raphaelmolly8 7mo ago[dead]
- raphaelmolly8 7mo ago[dead]
- sisyfos 7mo agoNoice! Bitcoin on any app thanks to this SDK!
- starkience 7mo agoyup, very clean sdk !
- wind_rider 7mo agoThat’s awesome!and how long does it take to go from npm install to first working transaction roughly?
- starkience 7mo agoit 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.
- wind_rider 7mo agoThat’s pretty impressive!is there a simple hello world example somewhere? would love to try this tonight
- starkience 7mo agowe have a quick-start here: https://docs.starknet.io/build/starkzap/quick-start https://docs.starknet.io/build/starkzap/quick-start Happy to know how the integration goes, if you have feedback, suggestions, etc.
- wind_rider 7mo agoThanks a lot for sharing this!i will! btw one more question,i’m just getting into blockchain development.does this require a crypto wallet to start testing?
- adithyadinesh 7mo ago[dead]
- adithyadinesh 7mo ago[dead]