Inspiration

The inspiration for this project came from a simple but critical question: How can we expect Web3 to be globally adopted if it only works with a perfect internet connection? I was fascinated by the idea of using crypto for everyday payments, but the reality is that connectivity is not a guarantee—whether you're in a subway, at a crowded festival, or in a developing region.

What it does

Kodiak is a decentralized application (dApp) built on Starknet that fundamentally solves Web3's "always-online" problem. It enables users to sign and queue transactions without any internet connection, making crypto payments practical for real-world scenarios like riding the subway, visiting a rural area, or attending a crowded event with poor signal. The core functionality allows a user to fund a special "offline account" while they have an internet connection. Later, they can create and cryptographically sign multiple transactions from this account on their device, completely offline. When connectivity is restored, a single "Sync" action broadcasts all the pre-signed transactions to the blockchain for execution.

How we built it

We built Kodiak using a combination of a Cairo smart contract and a React frontend, deployed on the Starknet Sepolia testnet. Smart Contract (Cairo): The on-chain component is a Cairo contract that serves as the vault and verifier. It securely holds the funds for offline accounts and contains the core logic in its execute_offline_transfer function to verify the cryptographic signatures of transactions submitted by a relayer. Frontend (React & starknet.js): The user interface is a React dApp that uses the powerful starknet.js library for all blockchain interactions. Offline Logic: The dApp generates and manages a local keypair on the user's device. When signing offline, it constructs the transaction data and calculates a Poseidon hash that is guaranteed to be a 1:1 match with the Cairo contract's hashing logic. This hash is then signed with the local private key. Relayer Model: When the user syncs their transactions, their main connected browser wallet (like ArgentX or Braavos) acts as a "relayer." It pays the gas fee to call the smart contract, passing the pre-signed offline transaction data as arguments for verification and execution.

Challenges we ran into

Our biggest challenge was a persistent and elusive Invalid signature error. Overcoming this was a multi-step debugging journey: Our initial attempts failed because we were using provider.callContract (a read-only query) to submit the transaction. We learned we needed to use wallet.account.execute to send a real, state-changing transaction. Even after fixing the execution method, the error remained. We discovered a subtle but critical incompatibility between the client-side hashing function in JavaScript and the PoseidonTrait implementation in Cairo. The hash we were signing on the frontend was not identical to the one the contract was expecting. We solved this by switching to the new hash.Poseidon() class in starknet.js, which allowed us to build the hash sequentially, perfectly mirroring the contract's logic.

Accomplishments that we're proud of

Solving a Real-World Problem: We are happy for building a functional prototype that directly addresses a major barrier to Web3 adoption. Kodiak aspires to be a practical solution for making crypto usable in everyday life. Deep Cryptographic Debugging: Solving the signature error required a deep dive into the cryptographic primitives of Starknet. We successfully diagnosed and fixed a complex, low-level issue that required understanding the hashing implementations on both the client and the smart contract. A Functional Solution: We built a working dApp that handles the entire lifecycle of an offline transaction: secure funding, offline cryptographic signing, and successful on-chain verification and execution.

What we learned

This project was an immense learning experience. Our key takeaways are: Crypto is unforgiving: There is zero margin for error. We learned that the client and contract logic must be in perfect sync, down to the byte, for signature schemes to work. The power of Starknet: This project forced us to understand Starknet's architecture on a deeper level. We now see that our current relayer model is just the beginning, and the true potential lies in Account Abstraction, which is native to Starknet. The value of iterative debugging: We learned how to tackle complex problems by forming a hypothesis, testing it, and using the result—even if it's another error—to build a more informed next step.

What's next for Kodiak

The future of Kodiak is to become the most seamless and accessible payment solution on Starknet. Our roadmap includes: Implementing Account Abstraction: Our top priority is to transition Kodiak from a relayer model to a native Account Abstraction wallet. This will allow each offline account to be its own smart contract that can pay its own gas fees, completely removing the need for a secondary online wallet to sync transactions. Pull Payments: We plan to introduce a feature where merchants can be granted with pull requests, which users can pre-approve offline. This is a safer and more intuitive model for retail transactions. Massive onboarding: To onboard the next wave of users, we will integrate with services like ChipiPay, allowing users to fund their Kodiak wallets directly with local currency and abstracting away the complexities of crypto.

Built With

  • cairo
  • ecdsa
  • poseidon
  • react
  • starknet.js
Share this project:

Updates