在 BSC 上申请一次 Chainlink 的随机数需要多少钱?

如果在 BSC 上使用 Chainlink 随机数,我需要支付的费用有哪些?

请先 登录 后评论

最佳答案 2022-09-13 16:39

不论在哪条链上,使用 Chainlink VRF,要支付的费用都是三部分组成的:

  1. premium fee,也就是 VRF 节点的收费。可以在这里找到在不同的链上使用 Chainlink VRF 的 premium fee。
  2. callback gas。在 VRFConsumer 合约(也就是用户合约)中,会有一个回调函数 fulfillRandomness,这个回调函数会对返回的随机数进行操作。
  3. verification gas,在 VRFCoordinator 合约中,会对VRF 节点返回的随机数进行验证,VRF 除了随机数还会返回一个 proof,会基于这个proof 对随机数进行验证。

所以使用的费用就是 premium fee + (callback gas + verification gas)* gas price。其中 gas price 可以在写用户合约的时候选择,就是gas lane。也可以在上述文档中找到,不同的链所对应的不同的 gas lane。

请先 登录 后评论

其它 2 个回答

WZ - 开发工程师/产品经理

刚看的文档, 简单来说是调用合约的gas费, 和需要支付LINK代币的订阅费用, 不知道理解的对不对

--- 文档原文
Subscription billing
For Chainlink VRF v2 to fulfill your requests, you must maintain a sufficient amount of LINK in your subscription balance. Gas cost calculation includes the following variables:

Gas price: The current gas price, which fluctuates depending on network conditions.

Callback gas: The amount of gas used for the callback request that returns your requested random values.

Verification gas: The amount of gas used to verify randomness on-chain.

请先 登录 后评论
区块链逸尘
请先 登录 后评论
  • 3 关注
  • 0 收藏,3293 浏览
  • Chainlink 提出于 2022-09-05 17:45