Craftware Docs
  • What is Craftware?
    • Game Samples using Craftware
  • ❗Getting Started
  • SDKs
    • Unity3D SDK Guide
    • Golang SDK Guide
  • Blockchain Elements
    • Smart Contracts
    • ICraftableIn Library
  • 🎮Game Content
    • Game Assets
      • Resources
        • Create a resource
        • Retrieve Resources in Game
      • Currencies
      • Items
      • Properties
      • Export Assets Data
      • Import Assets Data
    • Crafting
      • Crafting Rule
  • 🤝Onchain Interoperability
    • Authentication
      • Wallet Binding
      • Wallet Session Authentication
      • Setting Up Wallet Authentication
    • Ports Protocol
      • Export Protocol
      • Import Protocol
    • Backward Compatibility
    • Crafting Protocol
      • Craftable Token
        • Definition Metadata
        • Craftable Input Token
        • Craftable Output Token
      • Crafting Rule Contract
        • Definition Metadata
      • Crafting Rule No-code Designer
  • ⚙️Admin
    • Account Settings
      • Account
      • Users
      • API Keys
      • Plan
      • Config
    • Security
    • Terms of Service
    • Privacy Policy
Powered by GitBook
On this page

Was this helpful?

  1. Onchain Interoperability

Ports Protocol

The ports allow you to take items out from your game into the blockchain and back into them

A port is a smart contract that stands at the interface of the game backend and the blockchain. It is managed by an admin wallet that represents the game admin.

In the design of the port, we aim to satisfy the four main criteria:

  • For the player: Help the user stay in control of their tokens. We don't want the tokens locked in the port for some reason or allow abusive game admins to control what gets in or what gets out.

  • For the Game backend: Make sure that the users cannot export their items during gameplay sessions. We only want the user to be able to export their tokens if they are not using it.

  • Four the player and game backend: We want to link the user id the game uses with the player wallet. this is a multi-sig operation that needs the approval of both parties.

  • To the Game contract developers: Make sure that the contract has minimum assumptions about the implementation of the items token. This will help game item tokens have the most flexibility in designing their tokens.

So, the contract has three main functions to interact with:

  • bindWallet( ... ): to associate the user account with a wallet. Binding the wallet will be handled by our SDK.

  • importToPort( ... ): to import a token from the blockchain to the game.

  • exportFromPort( ... ): to export the game item from the game to the blockchain.

PreviousSetting Up Wallet AuthenticationNextExport Protocol

Last updated 1 year ago

Was this helpful?

🤝