The application is metadata.
Inside.
Technical annex to the sales pitch: the manifest, the paths of the metadata, the live-change demo, the register/pinpad model and the platform matrix — every claim with its source in the repository.
What an application declares
It is not a configuration file: it is the application. Everything that is code in a terminal app today is a declared section here.
23 node types, 28 top-level keys. The screen manifest is JSON; messaging, protocol templates and flows go in whatever codec suits (JSON, YAML, MessagePack, XML, ISO 8583, BER-TLV). A validator with ~110 rules runs on the terminal at load time and from the command line: 25 catalog manifests, 0 errors. Nothing is mandatory: no forced shift, login, host or policy — the application declares what it needs.
// examples/simple_payment/home.json — trimmed { "background": "#1A1A2E", "endpoints": { "host": { "transport": "tms", "endpoint": "payments/charge", "timeout_ms": 15000 } }, "capability_rules": [ { "when": { "has_not": "card_reader" }, "disable": ["printer", "secondary_display"] } ], "print_rules": [ { "when": { "flavor": "generic" }, "print_size": 24, "print_wrap": 8 } ], "system_routes": { "on_boot": "cobro", "on_error": "error_screen", "on_reading": "leyendo" }, "screens": [ { "id": "cobro", "children": [ { "type": "text", "text": "Card Sale", "align": "center" }, { "type": "input_money", "id": "monto", "hint": "Amount to charge", "currency": "$" }, { "type": "button", "id": "btn_read", "text": "Read card", "on_click": "btn_read_msr", "card_methods": ["mag","ic","rf"], "enable_when_all": [ { "input_id": "monto", "min_cents": 100 } ], "nav_to": "leyendo" } ] } ] }
Same device, same binary. Change the entire application from the TMS — or from the host response.
Each button pushes metadata through a real Adyton channel. The engine runs it through the gate, applies it without reinstalling or recompiling —screens, styles and receipts instantly—, persists it and records where it came from. If the screen fails validation, it repaints the last good one.
Current manifest · zmq_inbox/home.json
Terminal · and what it prints
Channels
Four paths, a single funnel
All metadata —whether it comes from the APK, a file, the TMS or a transaction response— passes through the same function before being applied. That is where it is validated, its provenance recorded and, by scope, a signature required.
- TMS: 9 commands with an ACK per command; fleet selector with 7 criteria — one device, a list, a brand, a model, a prefix or the whole fleet. Today over ZeroMQ PUB/SUB + HTTP; the envelope is transport-agnostic. done
- Host response: the sale comes back with print_layout and the terminal prints that receipt done. Presentation parameters in the response, through the same funnel designed
- Hot apply: gate → apply without restarting → atomic persist → if it fails validation, back to lastGoodLayout. What was pushed survives a restart and overrides the APK. done
- Provenance: origin, timestamp, SHA-256 hash and result of every apply; a declared screen or GET /api/provenance shows it. 29/29 tests. done
- Signature by scope, anti-replay freshness and sealing — hooked into the same gate designed · S2 to S5
- Your TMS: the bridge (PUB + /ack + /forward) is an open protocol that integrates with the customer's TMS; the remote origin via HTTPS pull is already in the precedence chain. APK distribution stays in the manufacturer's or the acquirer's store.
What an analyst declares; what a developer no longer writes
The engine ships with the primitives of a payment terminal. The application combines them: which screen, which validation, which message, which route by response, what to print. No Kotlin, no Java, no C.
23 node types, event-driven navigation, enable_when_all, system routes (on_boot, on_error, on_reading), after_msr_routes by card entry mode, lists from the response or the local database.
request with {{monto.cents}}, {{msr.*}}, {{device.serial}} macros; endpoints inheritance; response_mapping; response routing with 11 operators; message validation before it goes out on the network.
Declarative SAF (on_before_send, post_request), retries, Idempotency-Key, mTLS via keystore, rules by device capability.
Conditions and calculations with declarative rules (@Eq, @And, @StartsWith, @IsEmpty…): if something is missing, the rules engine grows. Code, only embedded and baked into the build, in a form or a print template.
// a charge button: request, response routing and SAF, declared { "type": "button", "id": "btn_pay", "text": "Charge", "on_click": "send_request:btn_pay", "request": { "transport": "http", "url": "https://api.host.ejemplo/charge", "headers": { "X-Terminal": "{{device.serial}}" }, "body": { "amount": "{{monto.cents}}", "card": "{{msr.panMasked}}", "entry": "{{msr.entryMode|map:mag=90,ic=05,rf=07}}" }, "timeout_ms": 10000, "auto_retry_max": 1, "on_before_send": [ { "type": "db_exec", "collection": "SAF", "action": "insert" } ], "response_mapping": [ { "from": "CodigoRespuesta", "to": "result_code" } ], "on_response_route": [ { "when": { "result_code": "00" }, "nav_to": "aprobada", "print": "voucher" }, { "when": { "result_code": "51" }, "nav_to": "sin_fondos" } ], "on_error": { "toast": "No response from host", "nav_to": "cobro" } } }
Multi-protocol by composition, not by rewriting
A message is defined once and read from both sides. Format, transport and dialect are separate layers that compose — adding a new host means declaring its protocol, not porting the application.
Transports
HTTP/HTTPS direct or via TMS · TCP with 5 framers (L2B, L2L, L4A, RAW, CRC16) · TLS/mTLS per request · embedded WebSocket for web ECR · serial and USB to devices (BLE with the mPOS reader) · TMS over ZeroMQ + HTTP with a transport-agnostic envelope. For a legacy network host, the ecosystem pattern: the terminal speaks JSON and AlchemyBridge/AlchemySwitch speak the host's dialect.
Business protocols
ECR ↔ pinpad dialects are data files, not code: how many there are depends on how many get written. Already written: EVO (validated against specification 2.42, 5 defects fixed), Lane3000 and NexGo, FirstData, Topwise mPOS, Verifone P400 and generic STX/ETX, with its RSA variant · an integration HTTP dialect declared and A/B-verified against the hand-written engine (237 values, 3 differences in favor of the declared one) · ISO 8583 by codec, available by configuration · regional banks and acquirers via response_mapping.
It is a file, not a release
JSON or YAML template with framing, commands, parsing, code table and actions per group (PaymentsBase catalog); initiator/responder side inferred from the link; the default falls on the safe side —the unknown never approves—; the linter rejects what a host cannot ask of the terminal. 8 files, 0 errors.
Messages and receipts: the same idea, two outputs
Message template
Device, card, amount and response macros; chainable filters; mapping dictionaries. The same mechanism builds a JSON for a REST host, an ISO 8583 for a switch, or a reply to the ECR.
"body": { "terminal": "{{device.serial}}", "amount": "{{monto.cents}}", "entry": "{{msr.entryMode|map:MAG=90,ICC=05,NFC=07}}", "installments": "{{cuotas.value}}", "stan": "{{now.epoch|pad:6}}" } "response_mapping": [ { "from": "AuthNumber", "to": "auth_code" } ]
Print template
text · row · items · separator · qr · image_base64 blocks, styles, width in columns, per-device rules (print_rules). Thermal printer, or PDF when the device has no printer. And the host can send the already-resolved layout in the response.
"print_layout": { "max_chars": 32, "blocks": [ { "type": "image_base64", "data": "iVBORw0…", "width_dots": 384 }, { "type": "text", "text": "{{header.business_name}}", "style": "header" }, { "type": "separator" }, { "type": "row", "left": "Card", "right": "{{msr.panMasked}}" }, { "type": "items", "array_path": "items", "item_template": "{{item.qty}} x {{upper:item.description}}|{{money:item.total}}" }, { "type": "row", "left": "TOTAL", "right": "{{money:totals.total}}", "style": "total" }, { "type": "qr", "data": "{{qr.data}}", "size": 6 } ] }
The same application is the register… or the pinpad
The role is set by the manifest, not the binary. With links the terminal is the register that drives a pinpad; with inbound_gateway it is the pinpad that serves a register over USB serial, TCP, HTTP or WebSocket — and replies on the same channel it was addressed on. The same -p70 APK turns a PAX A920 into the external pinpad of an X70.
- Dialects are data: EVO, Lane3000, NexGo, FirstData, Topwise mPOS, Verifone P400 and generic STX/ETX are already written. Adding one that uses the engine's repertoire means writing its template, not code. A single manifest can declare both roles at once.
- The pinpad is detected automatically: path: "auto" and a registry of 17 models by vid:pid with scoring; the X70 ↔ P70 docking is detected at both ends.
- The terminal is also the "component" integrators already call: it exposes over HTTP the same authorization request they already use, with that dialect declared in the manifest — same integrator, same APK.
- It only listens to what it declares: on Android the engine opens only the ports the application declares in inbound_gateway; the test bridge (/api/ui, /api/event) has to be declared too, and without that it does not exist. If a manifest applied over the bus changes the inputs, they are reopened live, without restarting the app.
// X70 = REGISTER: drives a pinpad by name; the transport belongs to the link "links": [ { "name": "real_cable", "direction": "outbound", "protocol": "evo_pinpad", "transport": "usb_serial", "path": "auto", "connection": { "baud_rate": 115200 } }, { "name": "clon_red", "direction": "outbound", "protocol": "evo_pinpad", "transport": "tcp", "host": "10.0.2.2", "port": 9000 } ] // P70 = PINPAD: serves the SAME dialect over cable and over the network at once "inbound_gateway": { "listeners": [ { "name": "cable", "transport": "usb_serial", "protocol": "evo_pinpad", "path": "auto" }, { "name": "red", "transport": "tcp", "protocol": "evo_pinpad", "port": 9000 } ], "operations": { "INIT_TRANSACTION": { "set": { "monto": "{{request.amount}}" }, "nav_to": "operando", "reply": { "approved": { "code": "00" }, "declined": { "code": "05" } } }, "DISPLAY_MESSAGE": { "set": { "txt_mensaje": "{{request.message}}" } } } } // the dialect: code table and actions per group, safe-side default "codes": { "_default": { "actions": ["SystemError"] }, "00": { "actions": ["Approve"] }, "05": { "actions": ["Refuse"] } }
One application for the whole fleet
gold = card reading verified on real hardware (Newland P70 magstripe/chip/contactless, N950 and Topwise T6 contactless, NewPOS N98 magstripe/chip); the rest, integrated and compiling at SDK level. EMV payment goes through the manufacturer's certified kernel, switched on by manifest — integrated on Newland, in validation. A small proportion of the code depends on the brand —≈23%: reader, printer, crypto— and lives isolated. The application never sees it.
| Platform | Status |
|---|---|
| Android (terminals, phones, tablets) | production |
| Windows · macOS · Linux desktop | available — native app on the JVM (Compose Desktop; DMG · MSI · DEB) |
| iOS / iPadOS | in validation — working on iPhone and iPad, bus included, via Kotlin Multiplatform and with the same manifest; being validated on real devices |
| Linux / RTOS payment terminals | in development — design ready; C database already compiling |
Adding a model
It means implementing the brand layer —reader, printer, crypto— against the contracts ten brands already use (MagstripeReader, PrintBridge, EmvCompletable). The acquirer's application runs on top untouched; emulators and simulators let you start without hardware. A probe decides in minutes whether a new device works with the SDK at hand.
Desktop and mobile applications that drive devices
The desktop runtime is not just a simulator: it has a serial port, a local database, inbound HTTP and PDF printing. The same metadata builds a station on Windows or macOS that drives a pinpad over COM, or an Android phone that handles an mPOS reader over Bluetooth.
- Desktop: native app on the JVM (Compose Desktop); serial port via jSerialComm —lists, opens and writes COM/tty—; the same protocol_engine as on Android; SQLite; six bridges; DMG / MSI / DEB packaging. Card reading and thermal printing stay on the devices it drives.
- On the bus (27-28/09): the bus is the same code as on Android (:host-core); the PC shows up in the fleet as <device>.<network>.desktop_<role>, obeys the same commands and runs send_request over bus, HTTP and TCP. Four apps per network, each with its own installer.
- Phones and tablets: their own screens per device class according to the short side in dp —phone or tablet, on either axis—; the app asks only for the permissions it uses (camera, location, internet). The same metadata runs on iPhone and iPad, with the bus.
- mPOS Hub: phone or tablet as host of a passive Topwise M3 reader over BLE, USB OTG or TCP, without touching the firmware; the device provides camera, QR and GPS.
- External pinpads and docking: pinpad over USB serial or TCP with automatic recognition (17 models); X70 ↔ P70 docking detected at both ends; NewLand dock and cash drawer under analysis.
- Inbound API for app-to-app: HTTP REST, bidirectional WebSocket, deep links / intents and local TCP — any register or app calls Adyton and gets the response over the same channel.
PC + pinpad over COM
Application declared on the merchant's PC, EVO pinpad over serial port with the same protocol engine, receipt to PDF. Card reading on the PC goes through that pinpad: on its way.
Phone + BLE reader
Generic build + one manifest: it is not another app. NFC SoftPOS as a demo (production requires EMVCo L2 + PCI SPoC).
SmartPOS of any brand
Manufacturer's reader, printer and EMV kernel; the application, identical.
Adyton inside another app
Another application invokes the payment via intent, REST, WebSocket or TCP and gets the result back over any of the four transports.
It adapts to the form factor. The brand comes from the metadata.
- One screen, N form factors: variants by orientation, width range and short side in dp (min_smallest_dp: tells phone from tablet and does not change on rotation), re-evaluated on rotation; orientation per device model (P70 landscape, N950 portrait); one set of artwork per format —16:9, 16:10, 9:16— never scaled. Verified on X70 and P70 emulators.
- Signage on the idle terminal: photo carousel, video or clock declared in idle_mode, with variants per orientation; wakes on touch, key or link data. Photos travel embedded with the manifest (5–8 institutional pieces); video, by file.
- Visual identity by metadata: palette and sizes per role in styles (changing the brand is a 9-line block), the customer's TTF typeface pushed over TMS, image background, global logo. Base themes and styles ship in the build. Button shape —corners, aspect ratio— is configured with defaults that are inherited. Two brand apps reproduced from their sources; two more generated from the same definition.
- Per-device rules: no printer, the same receipt goes out as PDF; no reader, the options that need it are switched off; print width and size per brand and model.
"styles": { "color.primary": "#2772CC", "color.surface": "#FFFFFF", "font.family": "Gilroy", "font.size.amount": 34 }, { "type": "button", "text": "Charge", "tint": "{{styles.color.primary}}" }, "idle_mode": { "enabled": true, "start_after_ms": 60000, "content": { "type": "box", "children": [ { "type": "carousel", "images": [ "/9j/4AAQ…", "/9j/4AAQ…" ], "interval_ms": 5000, "scale": "crop" }, { "type": "clock", "format": "HH:mm", "size": 56, "position": "top_end" } ] }, "variants": [ { "orientation": "landscape", "content": { "type": "video", "source": "promo_wide.mp4" } } ], "wake_events": [ "touch", "key", "link_data" ], "on_wake": "cobro" }, "orientation": { "default": "auto", "by_device": [ { "model": "P70", "value": "landscape" } ] }, "print_rules": [ { "when": { "brand": "pax", "model": "A920" }, "print_width": 48, "print_size": 24 }, { "when": { "brand": "generic" }, "print_mode": "pdf" } ]
A command channel, protected as one
The same binary that takes payments, with another manifest, governs a network of devices. Whoever reaches that channel can re-skin and push amounts to a whole fleet, so the right question is not whether it is encrypted but who can get in.
Each transport with its own mechanism, declared per channel
| ZeroMQ | HTTPS | |
|---|---|---|
| Mechanism | CURVE — Curve25519 · XSalsa20 · Poly1305 | mTLS, TLS 1.3 and nothing else |
| The device verifies the node | with the broker's public key | with our own CA |
| The node verifies the device | allowlist of public keys | client certificate signed by that CA |
| Credential per | device, CURVE | installation |
| Where the private key lives | on the device; it never leaves it | baked into its APK |
| Traffic | encrypted, not just signed | encrypted |
By key, not by IP
It is the only thing that works when you do not know where a terminal connects from on a merchant's network — and you never do. An IP allowlist over a terminal fleet is a promise that cannot be kept.
The role comes from the certificate, not from the request
On the HTTPS path the certificate name is <device>.<role>, and from that the node decides which stream to deliver. The client does not choose: its credential says so. Nobody can ask for another role's channel.
And if the customer's network blocks the ports
The terminal tries ZeroMQ first, with no bridge. If that path is not there —a corporate network that only lets traffic out on 443— it falls back to HTTPS on its own, with the same content and the same guarantees. It detects the cut in 12 seconds and keeps obeying. The node the device was shipped with is never lost: it is always the last step. Before stepping down, it reopens the same path: silence is almost always a dropped connection, not a blocked port. If it steps down, it does so on trial, and it goes back to the good path only after seeing two heartbeats on a side probe.
None of this holds up operations. The channel is encrypted and authenticated and even so the terminal keeps taking payments if the node is down. Security protects the command channel; it is not what the merchant's ability to sell depends on.
The intent contract: what goes out, what comes back
A point of sale on the same device asks the terminal for the sale and invokes it with startActivityForResult — that is what makes the result come back. Two ways:
| Path | How it is requested |
|---|---|
| Deep link | <network>-terminal://payment?amount=125000&operation=SALE (in the demo, acme-terminal://) — handled by that network's installed terminal, whatever the brand's package; with two networks on the same device, Android does not ask which one to open |
| Explicit intent | com.asaptech.pos.<network>.<flavor>/com.asaptech.pos.MainActivity with extras (on the demo P70, com.asaptech.pos.acme.generic) — the usual pattern of a POS register; the package changes with the device brand |
| Field | Value |
|---|---|
| amount | amount in cents (125000 = $ 1,250.00) |
| operation | today SALE |
| saf_key | optional: the sale's own reference, for reconciliation |
| callback_url | optional: caja://… or https://…, for whoever cannot use startActivityForResult |
// RESULT_OK, extra "result" { "approved": true, "code": "00", "message": "", "auth_code": "465367", "reference": "REF-12524126", "amount": "125000", "operation": "SALE" }
| Situation | What the register receives |
|---|---|
| Approved | RESULT_OK, approved: true, code: 00 |
| Declined | RESULT_OK, approved: false, code: 05 and the reason in message |
| The cashier tapped Cancel on the terminal | RESULT_OK, approved: false, code: 17, message "Cancelada por el cajero" (cancelled by the cashier) — the register is not left waiting |
| The cashier left without charging (Android Back) | RESULT_CANCELED |
| The payments app is not installed | ActivityNotFoundException |
The register can be Adyton too: send_request with transport: "intent"; the answer reaches {{cobro.response.*}} and on_response_route. examples/acmepay/pos is metadata only. With an Editable amount, amount carries what was actually charged: the register compares it with what it asked for.
The register over the bus: the same contract, between devices
The intent works within a single Android device. Between devices —a desktop point of sale and a real, emulated or desktop terminal— the request travels over the bus and the result comes back with the same msg_id.
| Step | What happens |
|---|---|
| 1 · the point of sale | payment.request on ctl_out, to ONE terminal of its network and customer, with its msg_id |
| 2 · the terminal | takes it as an integrated sale: same screens, modes and SALE operation from the manifest |
| 3 · the reply | ADYTON_RESP_V1 on term_out, with the request's msg_id; the register applies its response routes |
It lives in the shared bus and in the engine's Lua: it is the same for a desktop terminal, an emulator or a real Android device. In the demo point of sale it is a terminal selector and the «Charge over the bus» button, metadata only.
// request: the point of sale { "magic": "ADYTON_CMD_V1", "msg_id": "7c1e…", "cmd": { "name": "payment.request", "args": { "amount": "1970000", "currency": "0032", "operation": "SALE" } }, "selector": { "match": "id:…" } } // reply: the terminal { "magic": "ADYTON_RESP_V1", "msg_id": "7c1e…", "response": { "ok": true, "status": 200, "body": { "approved": true, "code": "00", "auth_code": "507216" } } }
| Measured on 28/09 | Result |
|---|---|
| Desktop → desktop terminal | approved (auth 507216) · cancelled by the cashier (code 17) |
| Desktop → Android emulator | approved (auth 007482) |
A new remote value is one line of manifest
The terminal declares which settings it has, with which values, and whether the central side may change them. The engine has a single command for all of them: the next setting —tip, installments, merchant copy— does not touch it.
"settings": { "integrated_amount": { "values": ["locked", "editable"], "default": "locked", "remote": true } } // on the screen "visible_when_fn": "@Or(@IsEmpty({{request.operation}}),@Eq({{setting.integrated_amount}},editable))"
| Piece | What it does |
|---|---|
| device.setting.set {name, value} | Bus command, with selector. Not declared → undeclared; without remote: true → not_remote; outside values → bad_value |
| Storage | The device remembers it across restarts; it is cleared when the terminal is released or when a new manifest closes it |
| {{setting.<name>}} | The stored value if still allowed; otherwise the default |
| {{request.*}} | The request that arrived from another app and awaits an answer; empty if there is none |
| Greeting ADYTON_HELLO_V1 | Reports the settings and which ones are remote; the panel only offers what the terminal accepts |
| Linter | Flags a default outside values and a quoted remote |
Register amount · Fixed / Editable
A row of the control panel, terminal by terminal or for all of the customer's terminals; the customers panel enables it with cap_importe_integrado. Factory default Fixed: "IMPORTE FIJADO POR LA CAJA" (amount set by the register), no keypad. Measured on 2026-09-25 on the P70 (emulator): fixed, authorization 455341; Editable from the panel, keypad shown, authorization 525664. 28 Lua tests.
In containers, and the same APK against the VPS or against the lab
cp deploy/acmepay/lab.env.example deploy/acmepay/lab.env
# Apple Container (macOS, Apple Silicon) or docker/ — same commands
deploy/acmepay/apple/laboratorio.sh todo
deploy/acmepay/apple/laboratorio.sh estado
deploy/acmepay/apple/laboratorio.sh logs acme-gateway
deploy/acmepay/apple/laboratorio.sh detener
| Container | What it is |
|---|---|
| adyton-broker | The bus broker, CURVE, 5570–5573 · with BUS=local |
| acme-host-simulator | The payments platform, ACME Payments API v5.8.2, POST /Sale · with PLATAFORMA=local |
| acme-gateway | The bus ↔ platform bridge (scripts/bus_payment_gateway.py): payment.authorize with amount_cents and currency (the merchant's currency, numeric ISO code) → POST /Sale with Bearer → ADYTON_RESP_V1 |
| lab.env | Effect |
|---|---|
| BUS=vps | Terminals and bridge use the VPS broker (bus.eldotech.io) |
| BUS=local | Broker on the Mac; emulators via 10.0.2.2, devices via mDNS with BIND_IP=0.0.0.0 |
| PLATAFORMA=local | Host-Simulator in a container |
| PLATAFORMA=remota | https://gw.eldotech.io; the key lives on the server |
The announcement does not leave the container
Multicast does not cross the Apple Container VM or the Docker network: scripts/bus_announce.py announces _adyton-bus._tcp from the Mac.
VPS or local, no rebuild
armar_apks.sh equipos: VPS node baked in + discovery. If an announced broker shows up it moves to it; if it stops beating (10 s), it goes back to the VPS. armar_apks.sh emuladores: node 10.0.2.2.
The same lab serves the three example networks at once. With Apple Container each container runs with 1 CPU and 256 MB. On startup, each application writes a RECURSOS line to the log with its consumption —memory, CPU— and the device's free resources.