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
相关推荐
独行soc25 分钟前
2025年渗透测试面试题总结-腾讯[实习]玄武实验室-安全工程师(题目+回答)
linux·安全·web安全·面试·职场和发展·渗透测试·区块链
链上Sniper21 小时前
Python 区块链开发实战:从零到一构建智能合约
开发语言·网络·python·架构·区块链·php·智能合约
姜家志1 天前
AI+去中心化=下一波生产力革命(2)
web3·区块链
链上Sniper1 天前
区块链+AI融合实战:智能合约如何结合机器学习优化DeFi风控?
架构·区块链
全干engineer1 天前
web3-Remix部署智能合约到“荷兰式”拍卖及以太坊gas费机制细讲
web3·区块链·智能合约
链上Sniper1 天前
智能合约安全漏洞解析:从 Reentrancy 到 Integer Overflow
开发语言·网络·架构·区块链·php·智能合约
FakeOccupational1 天前
【p2p、分布式,区块链笔记 MESH】 论文阅读 Thread/OpenThread Low-Power Wireless Multihop Net
分布式·区块链·p2p
全干engineer1 天前
web3-以太坊智能合约基础(理解智能合约Solidity)
web3·区块链·智能合约
穗余1 天前
WEB3——开发者怎么查看自己的合约日志记录
web3·区块链
链上Sniper1 天前
高并发区块链系统实战:从架构设计到性能优化
开发语言·网络·python·性能优化·架构·区块链·php