feat(pokerchain): NFT prize messages + validator unlock signing (register/confirm/request/submit)

Đang mở
#756 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
22/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
blockchain, go
Lĩnh vực
blockchain

Hướng nghiên cứu

Start with the design doc at ui/docs/designs/play-for-nft.md, then read the withdrawal path in pokerchain/x/poker/ (keeper, msg server, query, and BuildWithdrawalSignature) that the new messages mirror. Done means NFTPrize state keyed by gameId, the register, confirm, request and submit messages with the SNG start gate on confirmed, the NFTUnlockSigningHash signature, and a query for it, all covered by tests alongside the withdrawal tests.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

Part of #196 (Play for NFTs). Design: ui/docs/designs/play-for-nft.md.

Scope

x/poker chain-side support for the NFT prize lifecycle: track the escrowed prize per gameId, gate SNG start on a confirmed deposit, author the unlock request on win/cancel, and have validators sign it — reusing the withdrawal signing path.

State

  • NFTPrize{ gameId, nftContract, tokenId, depositorEth, confirmed bool, nonce } keyed by gameId.

Messages

  • MsgRegisterNFTPrize{ gameId, nftContract, tokenId, depositorEth } — creator declares the intended prize (before start), recorded unconfirmed.
  • MsgConfirmNFTPrizeDeposit{ gameId, ethTxRef } — gateway-only; flips confirmed after PrizeDeposited is observed. SNG start must be gated on confirmed.
  • MsgRequestNFTUnlock{ gameId, recipientEth } — resolution trigger:
    • Caller's cosmos identity is the recorded winner (GameState.Results) → authorize a WIN unlock to recipientEth.
    • Game cancelled pre-winner and caller is the depositor's cosmos identity → authorize a REFUND to the depositor's ETH address.
  • MsgSubmitNFTUnlockSignature{ ... } — twin of MsgSubmitWithdrawalSignature; validators submit their 65-byte signature.

Signing

  • Reuse the withdrawal helper with the escrow payload: NFTUnlockSigningHash(gameId, recipient, kind, nonce) = EIP-191(keccak256(abi.encodePacked(gameId, recipient, kind, nonce))). Sign with VALIDATOR_ETH_PRIVATE_KEY (same as BuildWithdrawalSignature). Serve the signature via a query like WithdrawalSignature.

Notes

  • SNG-only, winner-takes-all: the winner is the single 1st place in Results; no place field.
  • Mirror the existing withdrawal keeper / msg-server / query structure in pokerchain/x/poker/.
Ngôn ngữ chính
TypeScript
Star
2
Fork
5
Merge trung bình
23 giờ 37 phút
Pull request đã merge (30 ngày)
96

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của block52/ui

Tất cả issue của block52/ui

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.