Raiden Network(二)—— Mediated transfers(多跳支付里的中介传输)

什么是Mediated transfers

  • 在雷电网络中,节点可以通过中间节点进行Mediated transfers向其他节点进行支付。
  • Mediated transfers的步骤:
    1. Allocation(分配): 使用锁定的转移消息(locked transfer message)为给定的支付预留代币容量。
    2. Finalization(完成) 使用解锁消息(unlock message)让保留的代币金额完成支付。

Mediated Transfers:

  • mediated transfer = hash-locked transfer
  • 目前雷电网络仅支持一种锁:hash time lock
  • 锁所包含的信息:1. 需要转移的金额 2. 用于验证解锁密码的秘密哈希 3. 锁的过期时间来确定其有效性。

Locked Transfer message:

Field Name Type Description
payment_identifier uint64 付款的标识符,由发起人选择
token address 代币合约地址
recipient(接收者) address Destination for this hop of the transfer(此传输跃点的目的地)
lock HashTimeLock A lock
target address 付款的最终目的地
initiator address 传输的发起人和知道秘密的一方
metadata Metadata 传输元数据,用于优化和发现
message_identifier uint64 已交付Delivered和已处理确认Processed的 ID

Unlock:

  • Non cancellable, Non expirable(不可取消,不可过期)

- Invariants

  • 余额证明必须包含新挂起锁列表的哈希值,解锁过的锁已经从中删除。
  • 此消息仅在相应的合作伙伴发送了 Reveal Secret message后发送。
  • nonce 相对于之前的余额证明增加 1
  • 锁定金额必须减少,转移金额必须增加解锁锁定中持有的金额。

-Fields(字段)

  • Unlock 消息由链下余额证明off-chain balance proof 和以下字段组成
Field Name Field Type Description
message_identifier uint64 An ID used in Delivered and Processed acknowledgments在传递和处理的确认中使用的ID
payment_identifier uint64 An identifier for the Payment chosen by the Initiator发起人选择的付款标识符
lock_secret bytes32 The secret that unlocked the lock
相关推荐
The_Ticker4 小时前
印度股票实时行情API(低成本方案)
python·websocket·算法·金融·区块链
苏慕白的博客9 小时前
精度套利:藏在盘口缝隙里的稳定机会
区块链·量化·高频量化·套利
Tattoo_Welkin2 天前
【RWA 机制,ERC-4626,ERC-3643,ERC-7540,ERC-7575,LayerZero】
区块链
魑魅魍魎12 天前
基于全同态加密的逻辑回归心脏病预测示例详解
区块链·逻辑回归·同态加密
软希网分享源码2 天前
中英双语言量化交易投资源码/跟单搬砖区块链交易所源码/前端uniapp纯源码+后端
前端·uni-app·区块链·中英双语言量化交易投资源码
好多大米2 天前
W2D3-Foundry 测试
区块链·solidity
Bczheng12 天前
四.比特币默克尔树(上)
区块链
OxYGC2 天前
[Web3] 一文读懂区块链中的账本类型
web3·区块链
david_lv2 天前
大A,2026年Q1总结
区块链
筱璦2 天前
期货软件开发 - 策略编辑
前端·区块链·交易·期货