Skip to content

πŸš€ wasmpay – The cross-border, cross-language payment solution powered by WebAssembly! πŸŒπŸ’Έ Send transactions seamlessly between banks, no matter the currency or language. Secure, fast, and extensible. Built for the future of finance! 🏦⚑

License

Notifications You must be signed in to change notification settings

cosmonic-labs/wasmpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

wasmpay

wasmpay is a bank-to-bank payments platform built on the CNCF project wasmCloud. It supports processing transactions between banks regardless of currency, language or country.

The wasmpay platform meets bank and regulatory requirements by supporting custom validators. Validators can approve or deny transactions based on custom rules, e.g. to restrict transactions to specific countries, currencies or amounts. Validators can be written in any language that can compile to a WebAssembly Component, even supporting rules that are described with code generated by an LLM.

Platform architecture

Architecture Diagram

Transaction commit sequence

When the transaction manager receives a transaction, it validates the transaction with the wasmpay platform, the origin bank's validator, and the destination bank's validator before committing the transaction.

Sequence Diagram

Detailed component descriptions

  1. The platform harness component wasmpay-platform-harness is the core of the wasmpay platform. It wraps every validator component before deployment via WebAssembly Composition tooling. This allows validators to implement a simple interface and leave the implementation of a message bus and HTTP to the platform harness. This component can be updated and upgraded without changing the validator at all.
  2. The api-gateway which fronts the HTTP API and serves static web assets for the wasmpay frontend.
  3. The transaction-manager which is responsible for validating a transaction with the wasmpay platform and the origin/destination banks. If banks don't provide their own validator, it's assumed they will allow a transaction to go through.
  4. The wasmpay-validator component which implements wasmpay:platform/validation for extra runtime validation logic which can be changed at runtime.
  5. The nordhaven-validator is a sample validator component which implements wasmpay:platform/validation for a bank that only allows USD transactions.
  6. The icamer-validator is a sample validator component which implements wasmpay:platform/validation for a bank that only allows transactions in the USA and the UK.
  7. The untrusted-validator component which implements wasmpay:platform/validation as generated by an AI model and serves as a template for AI generated components deployed straight to Cosmonic.

Developing with a Platform Harness

Both the icamer-validator (written in Go) and the nordhaven-validator (written in Rust) implement validation rules specific to their bank to approve or deny transactions. These components implement the wasmpay:platform/validation interface, and then are composed with the wasmpay-platform-harness. During composition, the validation function is wrapped by the platform harness to support schema migrations, initial validation, and to implement the HTTP server endpoint.

To make your own changes to one of these validators, run one of the following:

wash dev --work-dir icamer-validator
wash dev --work-dir nordhaven-validator

Then, send a request to the validator over HTTP:

make test-validate

In a platform harness pattern, developer teams work on user components that use high-level, language-agnostic APIs for common functionality like in-memory filesystem access or environment variables, without worrying about exactly how that functionality will be fulfilled.

Running wasmpay

wasmCloud

You can run wasmpay with published versions or locally built components.

Published versions

Prerequisites:

# Run the ledger service (external bank database)
docker run \
    -p 8080:8080 \
    -v ./:/app ghcr.io/cosmonic-labs/wasmpay/ledger:0f82ed36c5916af7ccd07dbb826f7674098b0e92 \
    -bind-addr 0.0.0.0:8080 \
    -db-store /app/data.db
# In a different terminal window
# Run wasmpay
wash app deploy ./app.wadm.yaml
# Validate it deploys successfully
wash app status wasmpay
# Test transaction support and validation
make test-validate
make test-validate-invalid

Local built

Prerequisites:

# Run the ledger service (external bank database)
go run ./ledger -db-store ledger.db
# In a different terminal window
# Build and run wasmpay
make build
wash up -d
wash app deploy ./local.wadm.yaml
# Validate it deploys successfully
wash app status wasmpay
# Test transaction support and validation
make test-validate
make test-validate-invalid

About

πŸš€ wasmpay – The cross-border, cross-language payment solution powered by WebAssembly! πŸŒπŸ’Έ Send transactions seamlessly between banks, no matter the currency or language. Secure, fast, and extensible. Built for the future of finance! 🏦⚑

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors 5