The task
Base, the network built by Coinbase, published an open brief: build an app on top of their tokenized stocks and wire in Builder Code, a tag that lets Base see which transactions came from your app. One rule from the brief: do not show trading to US users, because Coinbase stocks are not available to them.
For us it was also a test of whether we can ship an on-chain product end to end: our own smart contract, a mainnet deployment, real money, other people’s wallets. Here a mistake costs money, not just a bug on screen. And a portfolio piece anyone can open and verify on the blockchain, not a mockup.
Why, and what the idea was
Gifting a stock today is awkward. The giver needs a brokerage account, the recipient needs one too, then a transfer between them, and with a child or a friend abroad it is nearly impossible. A store gift card is simpler, but that is just money locked to one shop.
A tokenized stock lives in a wallet, so it can be handed over any way you like. The idea: the link is the gift. The giver locks a slice of a share in a contract under the hash of a secret. The secret sits in the link after the # sign, a part the browser never sends to the server. We do not store it and cannot resend it, and the site says so plainly. Whoever opens the link with their wallet keeps the share. You can set a date before which nobody can open the gift, not even the giver.
The contract has no owner, no pause, no admin and no upgrade path. That is deliberate: nobody has to trust us, the code holds the shares.
How it went
| When | What happened |
|---|---|
| Evening of day 1 | Next.js skeleton, contract and tests, deployment to Base mainnet. All 13 tickers checked for a live market: 4 work. Spread measured on amounts up to $20,000 |
| Morning of day 2 | Gift and claim work on mainnet. Half a day investigating why Builder Code did not reach the chain on purchases |
| Day 2 | Video: four screen recordings, stitched by an ffmpeg script, three versions. In the third the “opens in 2027” episode moved to the end |
| 5 days later | Tweet with the video and the @buildonbase tag, submission form filled in with time to spare |
The main fork came at the end of day 2. The Builder Code tag was getting lost on purchases, and the only real fix was our own swap adapter contract. We did the math: half a day of work, a new contract that other people’s money would flow through, five days before the deadline, for a field the brief did not require. We stopped and instead show the user on screen, honestly, whether the tag made it or not.
Tools and method
The StockGift.sol contract in Solidity 0.8.28, about 140 lines. The giver locks shares under the hash of a secret; whoever knows the secret can claim them, and only after the opening date. Reentrancy protection, a check of how many tokens actually arrived. If nobody claims the gift, the giver can take it back, but not sooner than 30 days after the opening date, so a gift cannot be pulled out from under the recipient. 9 Hardhat tests: cannot claim early, cannot claim twice, a stranger cannot reclaim, a wrong secret is rejected.
Purchase: our own Next.js API asks the LI.FI aggregator for an ETH-to-stock route, and LI.FI picks 1inch, Kyberswap, Aerodrome or others on its own. We only build the transaction; the user’s wallet signs it, our server never holds funds. The amount cap is $25,000, the largest volume we actually tested ($20,000 into Apple went through with a 0.31% spread).
Builder Code, per the ERC-8021 standard, is appended to the transaction data on the server, in one place you can check with plain curl. For smart wallets that wrap the call in their own operation, the tag goes in a separate field per EIP-5792. After a purchase the site re-reads the transaction from the chain and prints in green “Builder code confirmed in the mined transaction”, or in red that the wallet rebuilt the transaction and dropped the tag.
Site: Next.js 16, React 19, wagmi + viem, hosted on Vercel. Country comes from a hosting header; visitors from the US see “Not available where you are”. The whole codebase is about 1,300 lines including the contract and tests. The contract on Base mainnet: 0x0535…5a88 on Basescan.
Result
The live site is stockgift-pi.vercel.app. The storefront lists the 13 companies Coinbase issued on Base; 4 can be bought (Apple, Nvidia, Alphabet, Meta), the other 9 are greyed out with “no market yet”. That is not a guess: for every ticker we requested a real swap route at $5 and $15 with 1% and 3% slippage, and nine had no market. When a market appears they switch on without any rework, the list is already in the code.
Every flow was run on mainnet with real money: a $5 Nvidia purchase via Kyberswap at a 0.06% spread, a gift of 0.01 Nvidia share, a claim from a different browser and a different wallet, and a second gift set to open in 2027. All of it is in the 1 min 28 s video and on Basescan.
The Builder Code tag was verified link by link, not by eye:
| Link in the chain | How it was checked | Outcome |
|---|---|---|
| Server returns transaction data with the tag | curl against the live API | present |
| Page received it with the tag | green line on screen | present |
| Router and network keep the tag | our own test transaction | present |
| Purchase through a wallet | 5 purchases on chain | tag missing |
| Gift, a call to our contract | 2 times on chain | present |
A weak spot we left in: on purchases through some wallets the tag is lost. The site does not hide it, it prints it in red. A second weak spot the contract names in its own comment: at claim time the secret is briefly visible in the transaction queue and could in theory be intercepted. The damage is limited to one gift; the giver’s balance is never at risk.
Infrastructure cost nothing: Vercel and the LI.FI API without a key. The Builder Code experiment cost $0.15 from the deployer wallet; gas for a purchase in the video is about $0.01. What we do not know yet: the outcome of the brief. Base emails the winners, no public announcement was promised.
Mistakes and what we took from them






