Transcript: WasmPay Demo: The Wasm Component Model for Cross-Language Payments
wasmCloud Weekly Community Call — Wed, Apr 2, 2025 · 12 minutes
Speakers: Brooks Townsend
Transcript
Brooks Townsend 00:32
Hey everybody, welcome to the wasmCloud community meeting for Wednesday, April 2. We're here live with Florian and many other wasmCloud maintainers and contributors here at KubeCon right now — the wasmCloud booth in the CNCF Project Pavilion. Taylor is just down the road at the CNCF TAG Runtime booth. Oh, hey, Taylor's here now, and Bailey was running around for a little bit, and some of the folks like Liam are stuck at the Cosmonic booth for a little bit, but it's been a great conference so far. Getting to see a couple of folks in person is really cool, and we have a bunch of talks that have been going on.
Brooks Townsend 01:05
So just a quick agenda for today. I figured what I could do is point you all at the blog post. It shows where we are speaking, so if anybody wants to come show up and take a look at some of our talks. Under the wasmCloud community agenda we have a link to — I believe this is on the wasmCloud blog — all of the talks that we are going to be at and where we are at the Project Pavilion. So if you're here at KubeCon, please come hang out. Come meet us in person.
Brooks Townsend 01:55
There have been a couple of talks so far, but the ones that are left — tomorrow, I'm going to be doing a talk on wasmCloud and the road to the standards. Some of you have been following the project for a long time and may recognize a lot of the content, but it's a good look back at wasmCloud leading up to 1.0 last year, so it should be a fun time. Jonas from Cosmonic, and Colin Murphy, who's an org maintainer of wasmCloud and is also at Adobe, is going to be talking about SPIFFE and workload identity for Wasm workloads in wasmCloud, which is going to be a super exciting talk. And Liam is going — wow, looks like at the exact same time — on WebAssembly and Kubernetes, and the maintenance implications of that, which is a really big Wasm think piece: why does wasmCloud exist, all that fun stuff. So again, if you're here at KubeCon, definitely check these out. If not, the CNCF always publishes them to YouTube, I don't know, like two weeks or so after the fact. So I think that's all that I had on the KubeCon front.
Brooks Townsend 03:20
I guess if folks are interested, I could share the demo that we've been doing while we've been here. I guess we got the time — I'm just going to take silence as acceptance that I should do it. So, everybody, you can take a look — we've been running a demo at the wasmCloud and the Cosmonic booths to show what it's like to build a platform with wasmCloud. What we really wanted to show is that process, because it's what most people do when they deploy applications with wasmCloud: they build up this platform and then deploy applications that use a variety of capabilities. That's what we've seen people do in a couple of scenarios. And we wanted to show something that you just cannot do with Kubernetes and containers. So we built a platform called WasmPay. WasmPay is a cross-language, cross-country payment processing platform. What this is really built to do is take transactions from different banks and facilitate sending money back and forth. The actual domain of the application being banking, you know, high security and all that stuff — but we're not trying to reinvent the wheel when it comes to transactions. What really is interesting here is the way that we're using Wasm.
Brooks Townsend 04:30
So we have a front end that interacts with an API gateway, which is written in Go. This is kind of the HTTP front for all of the interactions from the UI. Then, when a transaction occurs between two banks, we have a transaction manager that's written in Rust, compiled to Wasm, that does some basic validation of the transaction. But really, all of these different banks have their own customer rules, regulations, country rules and regulations. So we wanted to provide a platform for them to be able to give their own validation written in any language of their choice.
Brooks Townsend 05:40
As long as it compiles to WebAssembly, it'll work. So this platform is built around this concept of validators that can be written in any language, compiled to Wasm, and then we can deploy that completely untrusted code because it satisfies this particular validator interface. And then we're actually doing something a little special with all of these validators. We are composing them with a different component, which actually implements the HTTP, the NATS messaging, and a kind of pass-through functionality. So we call this the platform harness pattern — when we were talking about this at Cosmonic. When you're building a platform, you can have a component essentially surround all of the interaction this validator has with the outside world, and then as soon as the transaction passes all of that, we can store it in a legacy banking database. This is where we would normally reach out to a Stripe API or something.
Brooks Townsend 06:50
So I'll go ahead and show you how it works. It's actually a very simple application. I have it deployed here on my machine, but this is WasmPay. You are actually able to select different banks and communicate with them. We actually use an LLM behind the scenes to do translation and currency conversion, but it just says simple stuff. I think even locally I just have the simple mock version here, right? But this is just features of the application. The real power comes from sending and requesting money. So I'm logged in — I'm a member of this North Haven Financial, which is a US bank, so I can send some money to this European bank, say $50, since it's coming from mine, and that'll work out fine. My account balance has changed because of that.
Brooks Townsend 08:10
But if I try to request money from this bank, you can see that this actually fails validation, because the British pound is not a supported currency. As a payments platform, we want to support all currencies. But this was actually something that the — oh, come on, no — this is actually something that North Haven, the US bank, has specifically programmed into their component. So this validate logic is simply: if the currency is the US dollar, then we'll approve the transaction, and if it's unsupported, then we'll reject the transaction and return a reason — say, "hey, we don't support that currency for the North Haven bank." So what's super powerful about this is that the interface for this is super simple. Banks get all the information about a transaction, including the origin, the destination, the currency, the country, and they can make a decision whether they think the transaction should go through. On the other end, the European bank, which is implemented here in TinyGo, is the same functionality — we pass it a transaction, you can return a validation response, and that bank just makes sure that transactions are non-zero and that the transaction occurs between the USA and Great Britain. So you can have a variety of logic here.
Brooks Townsend 09:30
And all of this — the way that it ends up integrating and being deployed — is being wrapped inside of this platform harness. So this is a super cool pattern, and the way that it works is this WebAssembly component exports the HTTP server, it exports wasmCloud messaging, and it actually exports the validate function as well. But under the hood, we compose that with every validator, and we call the underlying validate function, and that lets us do a couple of cool things, like schema migration inside of this function. We can take care of the serializing, deserializing, replying to a message bus, all kinds of cool things like that. So that is the demo that we've been running at KubeCon. If anybody's interested in taking a look at some of the code, we just have this on the Cosmonic Labs side, so I will send it here.
Brooks Townsend 10:40
Vance — need a bank validator in COBOL. Yes, absolutely. I mean, I'll check with Bailey on whether we can compile COBOL to Wasm, but I know we can do it with Fortran, so we could do a Fortran validator. So we'll take it — every different language works, so tons of different interesting conversations around this pattern. I've had a lot of fun getting this demo together and then showing it off, since it's just such a cool case. And then for some of the scale conversations, we've actually run 10,000 unique validators on one wasmCloud host on my local machine. I took some screenshots of resource utilization and stuff — fun metrics to come back and study for when we get back from the conference. So yeah, I would actually love to do a little bit more of an in-depth demo of WasmPay when I get back from KubeCon. We could do it next week in the community call, just so that I could actually hear you and answer your questions. But I think that's probably it. Bailey's over here — we got some people. Welcome to the wasmCloud community. And yeah, alright folks, well, unless there's anything super pressing that we should go over this week, I think we'll probably just call it for this one and pick it up next week. Alrighty. Well, thank you, folks. Thanks Florian for being here in person joining the community call, and Bailey too. Liam is over there. All right, folks, I'm going to go ahead and stop the screen, and we'll see you next week. Have a lovely wasmCloud day.
