Mina中的交易及经济白皮书

1. 引言

在这里插入图片描述
Mina中主要有3个角色:

  • 1)Verifiers:网络中的大多数参与者都是验证者。Mina使用recursive zk-SNARKs来持续证明state有效性,通过简单的下载一个zk-SNARK即可实现全节点安全性,该zk-SNARK仅为几百字节,仅需要几微秒即可完成验证。该zk-SNARK可证明共识信息和a Merkle root to a recent ledger state。当前,验证者会请求Merkle paths to relevant parts of the state。通过检查该Merkle path,验证者可确认他们关心的state(如其account balances)确实已包含在由该zk-SNARK证明的同一账本内。
  • 2)Block Producers:Mina中的产块者,类似于其它链协议中的miners或stakers。产块者受block rewards或coinbase transactions 以及 用户交易手续费激励。Mina采用Ouroboros Proof of Stake共识,对其产块者没有slash惩罚措施。个人可将其stake委托给其他产块者,即支持delegate to stake。
    产块者可选择在下一区块中包含的交易。为了使Mina链succinct,产块者还需承担额外的责任:在区块内每增加一笔交易,需增加相应数量的previously added transactions’ SNARKs。若不包含同等数量的SNARK,则其区块无法满足共识规则,将被其它节点拒绝。可将其想象为a queue of transactions。若产块者想要往队列末尾添加10笔交易以赚取手续费,他还必须在该队列前面添加10笔交易SNARK。这些SNARK可由产块者自己生成,也可从snarker marketplace中购买。
  • 3)Snarkers:是指生成zk-SNARKs that verify transactions的参与者。通过bids来获得补偿,若其SNARKs被采用在区块内,产块者将从其总交易手续费中向Snarker支付相应的bids费用。
    同一笔交易可能有多个Snarkers报价,产块者可选择最便宜的包含在其区块内。
    Snarkers不会影响Mina网络的活性或抗审查性。

2. Mina中的交易生命周期

在这里插入图片描述
Mina中的交易类型有:

  • Coinbase交易:给产块者激励和手续费的交易,为内部交易。
  • Fee_transfer交易:给snark worker手续费的交易,为内部交易。
  • Payment交易:支付交易,为用户交易。
  • Delegation交易:委托交易,为用户交易。
  • apply_parties_unchecked交易:指为支持zkApps智能合约创建的交易类型。

其中singed_command交易分为了payment交易和delegation交易。

let apply_transaction ~constraint_constants
      ~(txn_state_view : Zkapp_precondition.Protocol_state.View.t) ledger
      (t : Transaction.t) =
    let previous_hash = merkle_root ledger in
    let txn_global_slot = txn_state_view.global_slot_since_genesis in
    Or_error.map
      ( match t with
      | Command (Signed_command txn) ->
          Or_error.map
            (apply_user_command_unchecked ~constraint_constants ~txn_global_slot
               ledger txn) ~f:(fun applied ->
              Transaction_applied.Varying.Command (Signed_command applied))
      | Command (Parties txn) ->
          Or_error.map
            (apply_parties_unchecked ~state_view:txn_state_view
               ~constraint_constants ledger txn) ~f:(fun (applied, _) ->
              Transaction_applied.Varying.Command (Parties applied))
      | Fee_transfer t ->
          Or_error.map
            (apply_fee_transfer ~constraint_constants ~txn_global_slot ledger t)
            ~f:(fun applied -> Transaction_applied.Varying.Fee_transfer applied)
      | Coinbase t ->
          Or_error.map
            (apply_coinbase ~constraint_constants ~txn_global_slot ledger t)
            ~f:(fun applied -> Transaction_applied.Varying.Coinbase applied) )
      ~f:(fun varying -> { Transaction_applied.previous_hash; varying })

module Parties_applied = struct
    [%%versioned
    module Stable = struct
      module V1 = struct
        type t =
          { accounts :
              (Account_id.Stable.V2.t * Account.Stable.V2.t option) list
          ; command : Parties.Stable.V1.t With_status.Stable.V2.t
          }

3. Mina交易的经济性

在这里插入图片描述

4. Mina供应量及激励规划

在这里插入图片描述
在这里插入图片描述

参考资料

[1] Mina经济白皮书
[2] Crypto Deep Dive: Understanding Mina Protocol The Succinct & Secure Blockchain Project

附录1. Mina系列博客

Mina系列博客有:

猜你喜欢

转载自blog.csdn.net/mutourend/article/details/124594055
今日推荐