sequenceDiagram
autonumber
actor Owner
participant Pad as Pad app (identity key)
participant Console as Console (Devices page)
participant Phone as Phone wallet
participant A as Contract A
participant Svc as Service (gateway + backend)
participant Sub as Submitter (inside the service)
Pad->>Pad: generate the identity key
Pad-->>Owner: show a QR code: chain, identity, tokens and caps
Owner->>Console: scan the QR code, confirm the caps
loop one transaction per token
Console->>Phone: WalletConnect: sign authorize(identity, token, cap)
Phone-->>Owner: prompt
Owner->>Phone: approve
Phone->>A: authorize(identity, token, cap)
end
loop until cap > 0
Pad->>A: authorizationOf(wallet, identity, token)
end
Pad->>Svc: sign-in challenge signed by the identity
Svc->>A: authorizationOf: cap above used?
A-->>Svc: yes
Svc-->>Pad: session credential
Pad->>Svc: call with an Intent (amount ≤ room), signed by the identity
Svc->>Svc: do the work, write the receipt (actual)
Svc-->>Pad: result + receipt
Note over Svc,Sub: the batch closes by N calls or time T
Sub->>A: settle(intent, actual)
Owner->>Console: revoke the pad
Console->>Phone: sign authorize(identity, token, used)
Phone->>A: cap = used: the room is 0
sequenceDiagram
autonumber
actor Owner as 所有者
participant Pad as 平板应用(身份密钥)
participant Console as Console(设备页)
participant Phone as 手机钱包
participant A as 合约 A
participant Svc as 服务(网关 + 后端)
participant Sub as submitter(服务内部)
Pad->>Pad: 生成身份密钥
Pad-->>Owner: 显示二维码:链、身份、代币和上限
Owner->>Console: 扫码,确认上限
loop 每个代币一笔交易
Console->>Phone: WalletConnect:签 authorize(identity, token, cap)
Phone-->>Owner: 弹出确认
Owner->>Phone: 同意
Phone->>A: authorize(identity, token, cap)
end
loop 直到上限大于 0
Pad->>A: authorizationOf(wallet, identity, token)
end
Pad->>Svc: 登录挑战,由身份签名
Svc->>A: authorizationOf:上限是否高于已用?
A-->>Svc: 是
Svc-->>Pad: 会话凭证
Pad->>Svc: 带 Intent 的调用(金额不超过额度),由身份签名
Svc->>Svc: 干活,写收据(实际用量)
Svc-->>Pad: 结果和收据
Note over Svc,Sub: 批次按 N 次调用或时间 T 关闭
Sub->>A: settle(intent, actual)
Owner->>Console: 撤销平板
Console->>Phone: 签 authorize(identity, token, used)
Phone->>A: 上限等于已用:额度为 0