Player BNS

Cryptonauts leverages BNS for player identification. To learn more about BNS visit https://bns.one

Set Player Address

After the players have Connected their Stacks Wallet (Leather or Xverse) to your UE5 based game, you'll likely want to present their BNS Name (example: cryptodude.btc) on the MainMenu and else where. To do this, after the Call Back is received, we will parse out and set the STX mainnet address as our MM_Principal (Main Menu Principal)

Casting to the Game Instance

Casting to the Game Instance is important for being able to facilitate Player Sent Transactions via your UE5 based game during map game play.

We introduced the Cast to GI_Cryptonauts and Set GI Principal nodes in our WB_MainMenu EventGraph just after we set our MM_Principal and checked for isSignedIn . You can skip the circled nodes while you handle getting the Main Menu Stacks Authentication and BNS presentation up and working. But, you will be required to do this or something similar, to get your player principal into the game map/level run time.

Get Player Name

Now that we have our players MM_Principal variable, will need to make use of it via BNSv2 API

GET https://api.bnsv2.com/names/address/{MM_Principal}/valid

Returns JSON of valid names owned by an address.

Example Get: https://api.bnsv2.com/names/address/SP3WAR3N1XRR139DXCGPR1ATPK2VN63PGRXTD537N/valid Example Response:

We want to call our API and extract the names[0].full_name from the response, and set it as variable MM_BNS, then use it in our WB_MainMenu to present to the player.

See the Video Demo for Example of the Player UX for when the Player Connects their Wallet