Fermah Pay - T1 Walkthrough — Transcript
Full transcript
- 0:00Hey, I'm Maxi, Rust protocol engineer at
- 0:02Firma, and this is a quick walkthrough
- 0:04of Trans 1 from Obelus Teller.
- 0:06Trans 1 was the prepaid ledger. It's a
- 0:10sovereign contract where a buyer
- 0:12deposits USDC 1s, and a seller charges
- 0:15small amounts against that balance.
- 0:18On top of it, there's a gateway that
- 0:20sends every transaction and pays the
- 0:22network fees. So, the buyer never pays a
- 0:25fee. This is the contract on testnet.
- 0:29Um down here, you can see its activity,
- 0:31deposits, charge, batches, and
- 0:34withdrawals.
- 0:36It shows three versions because we
- 0:38upgraded it in place, so the hash here
- 0:41is the current one. But, the address and
- 0:44the balance stay the same.
- 0:46This is a deposit. Up here, the source
- 0:49account is ours. It's the account that
- 0:52sends the transaction, and this one is
- 0:54the fee source account. It's a separate
- 0:57one um
- 0:59that paid the fee for this transaction
- 1:01through a fee bump, so the buyer paid
- 1:04nothing.
- 1:05Here is the deposit call. This address
- 1:10right here is the the buyer, and this is
- 1:13the amount. It's point um
- 1:1603 USDC
- 1:18since USDC has seven decimals here.
- 1:22In the details right here, you can see
- 1:24the USDC coming out of the buyer's
- 1:27wallet and going into our treasury.
- 1:31And here, um
- 1:33the contract
- 1:35credits the buyer's balance in the
- 1:37ledger, which is what the seller charges
- 1:39against.
- 1:41The USDC transfer only happens with the
- 1:44buyer's authorization, and this is the
- 1:47line. Um the buyer's signed
- 1:50authorization gets used up with the with
- 1:53this nonce, so nobody can replay it.
- 1:56Now here, in signatures, there's only
- 1:58our key. That's because the buyer never
- 2:00signed this transaction itself. They
- 2:02just signed that one authorization for
- 2:04the deposit once. So, next, a charge.
- 2:08Um here is the charge call.
- 2:10As you can see, it's the same buyer. Um
- 2:13this is the charge ID.
- 2:16And
- 2:17this is the amount. It's .01 USDC, and
- 2:21this last number is the latest ledger it
- 2:24can settle in. So, a charge can sit
- 2:26there and forever.
- 2:28Charges need the operator roles
- 2:31authorization, and this is it.
- 2:34Um the operator's nonce getting used up.
- 2:37As you can see here, um
- 2:40the event at the end has a zero.
- 2:43Right here. Um which in the contract
- 2:46means charge it.
- 2:48And um here
- 2:51the
- 2:52the buyer's balance in the ledger goes
- 2:54down. Um no USDC moves in that charge.
- 2:58It's just the ledger moving the amount
- 3:00the amount from the buyer's um balance
- 3:02to the seller's revenue.
- 3:06>> [snorts]
- 3:06>> And lastly, this right here, as you can
- 3:10see,
- 3:12um
- 3:13this line's the important one for the
- 3:16next part because the contract
- 3:19um keeps a record of every charge ID
- 3:21with with its um outcome. So, the same
- 3:25charge can never be taken twice.
- 3:28Now the duplicate. Um this is a batch of
- 3:3298 charges that had already been um
- 3:37settled.
- 3:38We sent it a second time on purpose.
- 3:41It's the same setup as before, as you
- 3:43can see.
- 3:45Um each entry is a buyer, a charge ID,
- 3:49an amount, and the last ledger. The same
- 3:51shape as the single charge before, just
- 3:5398 of them in one transaction.
- 3:57Um the transaction um
- 4:01goes through,
- 4:02but this error is um what the contract
- 4:06returned. One result uh per charge.
- 4:09Every single one is free, which in the
- 4:11contract means uh duplicate because
- 4:13those um charge IDs were already
- 4:16recorded.
- 4:18>> [snorts]
- 4:18>> And if you send a single duplicate
- 4:20charge straight um to the contract, it's
- 4:23refused before it even reached the the
- 4:26chain. So, there's no transaction at
- 4:28all. So, this is the CI. This runs on
- 4:32every change to main.
- 4:34It's an end-to-end test against testnet
- 4:37that goes through the gateway API, the
- 4:39same way a real seller would use it.
- 4:42This is the
- 4:44the shop summary list.
- 4:46Um as you can see, it lists every step
- 4:50with its um transaction.
- 4:53First, it creates uh a new buyer. It
- 4:56funds it with testnet USDC.
- 4:59It deposits with one buyer signature, um
- 5:03and it settles free charges.
- 5:06Then, it checks the
- 5:09the duplicate both ways. Um our retry
- 5:13charge through the API just returns the
- 5:15original one, and the same charge sent
- 5:18um straight to the contract gets refused
- 5:21before submission.
- 5:23And at the end, um
- 5:26it checks that the gateway's balance
- 5:28match the the contract's to the to the
- 5:31unit.
- 5:32>> [snorts]
- 5:33>> Every hash um links to the explorer, so
- 5:37anyone can check it themselves, as you
- 5:39can see,
- 5:40right here. Trench two builds on top of
- 5:43it with four pieces.
- 5:45First is recurring
- 5:48um charges,
- 5:50which is the buyer authorize a monthly
- 5:53charge once and the seller can charge
- 5:55each period without asking again until
- 5:58the mandate expires.
- 6:01Second is
- 6:03um settlement interface compatible with
- 6:06um X402.
- 6:09So, any third-party facilitator can
- 6:12check a buyer's balance and settle
- 6:15against it.
- 6:17Third
- 6:18um is on-chain monitoring with um
- 6:22with alerts for each risk we identify we
- 6:25identify and so on. And fourth, it's a
- 6:28testnet integration with um ecosystem
- 6:31partner.
- 6:33Well, so the first two already run here
- 6:36on every change to main and we are
- 6:38closing the the other two now.
About this transcript
This page contains the full transcript of Fermah Pay - T1 Walkthrough by Fermah, generated from the public captions YouTube serves with the video. The transcript has 867 words across 153 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.