Kadena On-Chain Key-Value Reader (Pact / Web3 spike)
Overview
A minimal browser build that reads data straight off the Kadena blockchain. A static HTML page calls a Pact smart-contract key-value store via pact-lang-api, fetches a value keyed by the URL hash, and renders the (base64-decoded) result directly into the page.
Why It Exists
A spike to learn the Kadena/Pact stack and prove that arbitrary content can be stored on-chain and served to a browser with no backend, effectively using the blockchain itself as a tiny content host.
What We Built
Three small HTML files. The core page generates an ephemeral keypair, builds a Pact local command invoking (free.kvs.get "<key>") with appropriate gas/meta parameters against Kadena mainnet chain 8, and posts it to the public Chainweb API. The returned data is base64-decoded and written into the document, so the page content is whatever lives at that key on-chain, selected by the URL fragment.
Technologies & Approach
pact-lang-api (loaded from a CDN) handles keypair generation, command construction and the local read call against Chainweb’s mainnet REST endpoint. Using a local (read-only) call means no gas is actually spent and no backend is required.
Outcome / Impact
Demonstrated end-to-end interaction with a real Pact smart contract from a plain webpage, reading live on-chain state and rendering it, validating Kadena/Pact fundamentals and the “blockchain-as-content-store” idea.
Capabilities Demonstrated
- Browser-to-blockchain interaction with no backend
- Pact smart-contract read calls via Chainweb’s public API
- Practical Web3 fundamentals on the Kadena stack