STEEM.CRAFT | #1 | Let's decentralize Minecraft worlds!

in #utopian-io6 years ago (edited)

Hello, Steemians and Minecraft players

today, I have a new project I want to show off. It is all about connecting Minecraft worlds of servers with the Steem Blockchain.

Before, players had to stick with a server on which they have been building since there have been all the worlds they have built. Some people might be built their worlds over years until they're finally done. Now, with STEEM.CRAFT, players will be able to store their worlds directly on the Steem Blockchain and visit them from any server which uses STEEM.CRAFT. This is allowed thanks to the sponge schematics, which allows storing chunks very precise and space efficient.

1. Repository

https://github.com/Abwasserrohr/STEEM.CRAFT

2. Index

  1. Repository
  2. Index
  3. Why should servers use STEEM.CRAFT
  4. What about Minetest?
  5. Dependencies
  6. File organization
  7. Setup
  8. Roadmap
  9. New features and functions
    9.1 Added createComment function
    9.2 Added getSteemResponse function
    9.3 Added claimRewards function
    9.4 Added getSteemContent function
    9.5 Added functions for compression
    9.6 Added functions to validate Steem to Minecraft connections
    9.7 Added steemconnect.sk addon
    9.8 Added steemworlds.sk addon
  10. Pull requests
  11. GitHub Account
  12. How to contribute

3. Why should servers use STEEM.CRAFT

There are many reasons, why I decided to create STEEM.CRAFT, here are a few reasons why STEEM.CRAFT could be a game-changer for some Minecraft servers. STEEM.CRAFT is more than just saving the worlds, it could do even more exciting things. Here are some reasons why STEEM.CRAFT can be very useful.

  • Worlds are saved against world corruption
    Since the worlds are not only saved on one server, even if a world corruption happens, the Minecraft server can simply load the data from the Blockchain and rebuild the world on demand. This is not only good for server operators, but also for players, who don't have to worry about backups, which they can't control.

  • Players can access their worlds on any server which has STEEM.CRAFT
    Because the worlds are stored on the Blockchain, every server can load the world instantly and show it to other players. If a player gets for example banned on one server, there is still the possibility to go on another server and load it there to continue building.

  • The user is the true owner of the own world
    On normal servers, server operators are able to delete, grief, destroy or sell worlds of every player. STEEM.CRAFT doesn't allow the server operator to delete, grief or sell worlds to other players. While it is still possible for the server operator to delete, grief or destroy worlds, the server operator can't change transactions that have already been submitted by the player before, which allows the player to simply load the world on another server.

  • Easy accessible API
    Steem can be accessed easily using APIs. This would allow sites to display 3D versions of the built worlds directly in the browser, something similar to what cubical.xyz is doing. A world explorer, where people could explore all kinds of worlds would be super amazing and could be done in the future, thanks to the API. Server operators could use data from the Steem Blockchain directly on their website using already existing API wrappers for Javascript and Python to display data to the user without any hassle.

  • Interact with players all around the world
    Instead of just having feedback from players on the server, players can get feedback on their builds through comments and upvotes on their worlds later on. People could also create forked versions of a specific world, create mini-games within their worlds, add customized 3D objects, textures, and sounds into the game and share it with other players. Not all of these things are possible yet but could be added later on. Even modded Minecraft is going to be possible, thanks to the sponge schematics.

  • Incentive for playing and creating beautiful worlds
    Thanks to the Steem Blockchain, giving rewards for being an active member of the server is easy. Server operators could invest a part of their earnings they have made using STEEM.CRAFT to upvote active members who create and publish new and pretty worlds. This could motivate more players to play on the server and also to keep playing actively on the server.

  • Use Steem games on Minecraft
    Server operators could give their players access to games like Nextcolony, HashKings and others. While the game should be free to play, it would be possible to visualize these games furthermore in the game. For example, could a HashKings script allow the player to visualize their wheat and grow it directly using a hoe in the game. Or a Nextcolony version could render a space station in which the player can run around, watch his space ship collection, upgrade planet buildings and so on. There are multiple possible ways server operators could profit from truly decentralized games which are built on Steem in the future.

  • Server monetization
    Some servers struggling to give players more Mojang EULA compliant features. STEEM.CRAFT allows server operators to monetize in multiple ways.

    • Selling Steem wallets
      Since players need to have Steem wallet to benefit from the STEEM.CRAFT features, which are EULA compliant in my opinion, server operators can sell Steem wallets through Tebex with high profit easily, thanks to the current cheap prices of Steem.

    • Use beneficiaries for worlds
      Once a player saves or publishes a world to the Steem Blockchain, a comment is going to be created which stores important data about the world inside it. The server operator is able to change the beneficiaries of these comments within the configuration, which allows the server operator to get a part of the rewards which have been earned by the players on the server.

    • Sell resources to players who need it
      On the Steem Blockchain, transactions are "free" for Steem Stakeholders, while they do not cost any Steem to broadcast, it is necessary to have enough resources. Server operators could sell Steem or delegate Steem, for example, using Tebex or refer to services and earn referral provisions.

There are other ways to monetize for sure, but these are easy ways which could give the server operator some profit. It is important to give server operators reasons to use STEEM.CRAFT, since they are deciding what gets on their server. Once they have installed it, there is a very high chance that users of the server will buy a Steem account to access those features if they're interested in it.

4. What about Minetest?

I want to mention that Minetest and other open source projects are free and doing an amazing job creating great games. I've gone through and evaluated where STEEM.CRAFT could be useful. Minetest and other open source games would give way better opportunities to include Steem directly into the client. But Minetest and other voxel-based open source games lack of one specific thing: A big player base. Minecraft has still, even after 10 years around 91 million active players with over 176 million sales. This is an enormous amount of people, since STEEM.CRAFT is a niche software which allows people to use Blockchain, a big player base is very useful to grow faster and spread the word about the Steem Blockchain. Enjincoin is also trying to create an Ethereum Wallet for Minecraft servers, which allows players to store their items on the Ethereum Blockchain using a smart contract.

They also want to allow players to view their ETH and ENJ balance in the game, which can also be used to pay in game, as far as I could see it here. While it would also be amazing to have such features for STEEM.CRAFT, I want to point out that Mojang, the creators of Minecraft have guidelines named EULA about what is allowed and what is not. To prevent servers which are running STEEM.CRAFT getting banned, I decided to not implement such features in the near future to STEEM.CRAFT.

The EULA by Mojang is a major disadvantage, but since we're on the Steem Blockchain and not on Ethereum, like ENJ, there are better opportunities to use the Blockchain without financial transactions and costs for transactions to avoid being affected by the EULA.

As you have seen, there are advantages and disadvantages to use Minecraft. Still, Minecraft has a big user base, which is also willing to pay for special features, like STEEM.CRAFT could offer in the future. Minetest or other open source games would allow me and others to truly integrate real-world money into the game, but there wouldn't be enough players who would fit into this niche, I think.

While this Project is currently limited to Minecraft, it maybe inspires others to do the same or even connect together with Minetest, Hytale and other games which may come in the future.

5. Dependencies

Unfortunately, I don't have the time to make everything myself and inventing the wheel was not necessary to create STEEM.CRAFT.

I have decided to use Skript instead of Java to allow almost every server operator to mess with new features, functions and broadcast operations. Currently, STEEM.CRAFT uses SteemJ to get and broadcast data from and to the Steem Blockchain. Therefore, it is currently needed to authenticate the posting role of the server account, which then broadcasts data using a private posting key of the server.

Using Steemconnect would have been possible, but using Steemconnect with an offline token would be as dangerous as authorizing the server account, but decrease the setup work for the server operator, which is very important.

An alternative could be to host a site directly from the Minecraft server, which is opened by the player who also has Steem Keychain installed. If the player does something in the game, which needs action by the user, a popup from Steem Keychain would automatically appear for the player. But most people really want it simple, they're not that concerned about those things. That's why I've gone the way I did, which is still as save as granting an offline token for voting, commenting and custom json with Steemconnect.

Enough explanation why I use SteemJ for now, here are the dependencies for STEEM.CRAFT:

6. File organization

Here, I just want to show how the files of STEEM.CRAFT are going to be organized.

There are three folders there are currently in the repository:

  • _lib:
    This folder will hold some functions which are needed for STEEM.CRAFT but don't fit into core or addons.

  • core:
    The core folder holds all important main functionalities which are imported from SteemJ. This folder is not meant to be customized to the requirements of a server. Rather, the functions should allow all necessary parameters to make it customizable from addons and custom games for server operators.

The reason to use Skript based functions is to reduce as much work involved for server operators and make the integration of Steem based transactions as easy as it can get in the future. Most server operators don't like overcomplicated things which need a lot of reading first.

  • addons:
    The addons folder is going to hold special features which use core functions. Players who want to interact with the Steem Blockchain can do it only through addons or custom scripts made by the server operators.

Currently, the only big addon will be steemworlds.sk, which allows players to store their worlds on the Steem Blockchain and load it on every server which runs STEEM.CRAFT with steemworlds.sk.

7. Setup

STEEM.CRAFT is still in a very early stage of development, there can be bugs, even though this process has worked for me just fine, it may not work for you. If it doesn't work, the sewage pipe on our Discord can help you with most problems that can occur.

  1. Get a Spigot or PaperSpigot Server setup ready and start to create folders. Here, you can find ready to use files. You need a 1.13.2 build.
  2. Load Skript, SkQuery, skript-mirror into the plugins/ folder.
  3. Build SteemJ from here and move the SteemJ with dependencies.jar file to the plugins/skript-mirror/ folder.
  4. Load the latest files from the STEEM.CRAFT Github repository to your plugins/Skript/scripts/ folder.
  5. Restart the server.
  6. To use STEEM.SK, a Steem wallet is needed.
  7. Insert your private posting key and dedicated Minecraft server steem wallet name to the config.sk file. You can skip this if you only want to look at already existing worlds.

Steps for users to broadcast transactions:

  1. The player has to follow the guide which appears with /steemconnect <steem account>

The guide will use Steemconnect links to authorize the server for the account, it will look similar to this:

https://app.steemconnect.com/authorize/@<your dedicated minecraft server steem wallet name>/?redirect_uri=https://app.steemconnect.com/sign/profile-update?minecraftuuid=<uuid of the player>

While it would be possible to create your own page, which does the same and is faster to use than Steemconnect, I suggest using Steemconnect, since it is fast, simple and is more trustworthy.

8. Roadmap

To allow a view into the future of STEEM.CRAFT, I did some brainstorming what could be done with it in the future. These are my plans, there might get more added or changed depending on other contributors who might help.

  • Create a documentation how steemworlds.sk saves worlds to the Steem Blockchain
  • Make all important SteemJ methods available through easy to use Skript functions
  • Add ready to use addons for server operators:
    • World storage based on Steem Blockchain: `steemworlds.sk, with comment and voting functionalities
    • Broadcast comments on posts on Steem through in-game server with reward functionality for more interaction on community posts
    • Automated Steem wallet creation system for unique Minecraft accounts through an easy in-game process
    • Automated Steem (later resource) delegation system which delegates Steem to users of the server if needed for broadcasting transactions
  • Publish STEEM.CRAFT on https://www.spigotmc.org
  • Update and maintain STEEM.CRAFT for future versions of Steem and Minecraft

9. New features and functions

9.1 Added createComment function

Interacting with other people on the Steem Blockchain is important, because of this reason, the createComment function has been created very early to allow interactions with others.

Since the creation of a comment is not instantly, the function makes use of the $ thread functionality by SkQuery, which allows the functions to be run in a separate thread.

After it has been tried to create a comment, it can be checked if there have been any errors occurred from commenting. If an error occurred, the error is set to the steem response. If there is no error, the response is just set to the string "done".

Currently, I'm not able to use the BroadcastTransactionSynchronousReturn function from SteemJ, which would allow me to get more information about the successfully broadcasted transaction, since querying for transaction ids directly is not possible from the Steem API. This alone was not a problem but SteemJ checks for duplicate transactions which makes use of the transaction id query from the Steem API, which isn't accepted.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-20cf5b6933d75f5e26f509450b15f149

9.2 Added getSteemResponse function

Since most Steem broadcast functions will call another threaded function, it will not be possible within Skript to return such data. It rather has to be queried afterward. For this reason, the getSteemResponse function has been created.

This function can return a response for a specified transaction. All transactions have to get an internal transaction id which is used to get the response later on.

Thanks to the metadata storage of Bukkit, it is quite easy to use and allows functions and commands to wait for threaded operations while still being in the main thread.

This can be quite useful for feedback messages and specialized functions.

The function is also pretty small and straight forward just returning the metadata value. While it would be possible to just use metadata values, I don't like that it doesn't look as clean as an easy to memorize function like getSteemResponse.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-5add987243892af6b457325b13560f78

9.3 Added claimRewards function

Claiming rewards can be very important for people who aren't as active on Steem apps as in the game. This can be used later by addons to add a claim rewards command in the game.

The claimRewards function just uses the claimRewards from SteemJ, which makes it very small. Another function, which allows checking the pending rewards would be useful to tell the player how much has been claimed and also that there is something to claim.

There are people who never log into any Steem related sites but they have a Steem account to access to STEEM.CRAFT features. Since it is very important for these people to claim rewards, it has been added very early.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-cd9bd6df0eaa6dd6fa31698e64219c2c

9.4 Added getSteemContent function

Steem has a lot of really good content stored on the Blockchain. We have a big advantage here to query posts from users, which is very useful. getSteemContent helps here, since it only needs a Steem username and a permlink as a string to return the requested content.

I want to say that addons from STEEM.CRAFT could simply import all necessary SteemJ classes but I want to make the addons look cleaner, which can be done with these functions. It also makes it easier to maintain addons for changes.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-39044a71ff96cbaf22e24cbebb9f2acd

9.5 Added functions for compression

Broadcasting data to the Blockchain is a very powerful tool, but the size of transactions can make a big impact. To allow the best results, functions have been added to compress sizes furthermore. Not everything needs to be compressed, but an addon, which is part of STEEM.CRAFT, called steemworlds is going to make use of this compression functions to reduce the size of transactions as much as possible.

It uses gzip compression to reduce the size from the already small sized schematic files furthermore.

Files:
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-891ceeea4e7839aa9b407e0531e5c113
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-1816ad93efe32f5291d5c73ca735e167
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-4b1f8fa59d661d9f6a5eb7677524e20c
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-ec8685772d0bc0db549c1ac51a90f02e

9.6 Added functions to validate Steem to Minecraft connections

For smooth user experience, players have to sync up their Steem account to the Minecraft server. This allows the Minecraft server to broadcast data for the user. This happens without giving the own posting key away but rather authorizing the server Steem account for posting transactions.

The validation functions can be used by functions to validate the following data:

  • The Steem account has the profile value minecraftuuid set to his own, Minecraft account UUID.
  • The Steem account has authorized the server account to broadcast with the posting key.

Both of these functions are being used by the steemconnect.sk addon, which allows players to connect to the Minecraft server using Steemconnect links.

This, for example is how validateSyncedSteemAccountUUID works. Our server knows the uuid of the player and the steem account which should be checked. By getting the account using the getAccount function, it is possible to get the json metadata of the user, which should hold the minecraftuuid value stored in the profile.

By using jackson, the json can be easily accessed to get the needed data. If the needed data is as expected and both uuid values are the same, the function is going to return true. If the values do not match, it will return false to prevent other accounts from using any Steem account on the server.

Files:
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-85474782818eeb5db637b954db315fde
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-ee1736b61adcb014ec2998df216273c9

9.7 Added steemconnect.sk addon

This addon is meant to allow players easily connect their Steem account to the Minecraft server using Steemconnect links. The addon uses the validation functions to check if the player has the profile value minecraftuuid set to the own Minecraft account UUID and authorization to the Steem account of the server. If one of both validations returns false, the player gets a direct link to solve the issue.

Once both validations return true, the server is going to save the account locally. Other functions can then easily grab the Steem account name for needed actions.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1/files#diff-bfd87e37f853d8348c2745673e22870c

9.8 Added steemworlds.sk addon

Steemworlds is an experimental add-on to STEEM.CRAFT, which allows players to store their personal Minecraft word on the Steem Blockchain and access, change and save the world from any Minecraft server running this addon.

I already wrote much about this above and why it could be a great advantage for server operators to have this.

Storing the data not on an external device with only a reference on the Blockchain was important for me to really have valuable content easily accessible from every server. External storage could get corrupted or deleted without any chance for recovery.

To counteract high traffic, the server could store frequently requested blocks directly on the server. Once this is out of the experimental stage, it will be more smooth and resource efficient to run it.

Here is a video of the saving process and the loading process of my world from two different servers:

To try explaining how steemworlds.sk saves the world to the Blockchain, I have created an image which hopefully demonstrates how it is working.

Each 16x255x16 area is one chunk in Minecraft. By compressing the chunks, a high size reduction of more than 80% can be achieved. Thanks to these savings, worlds can be broadcasted using custom json transactions.

To remove the need to store a centralized database, all blocks which hold the needed transactions are added to the custom json metadata of the comment, which represents a world. The custom json metadata can be changed if needed to allow updates and can be used to query the data to be truly decentralized without third-party database or server.

Some chunks might be bigger and could exceed the custom json transaction size limit, in these cases, the chunk is split into multiple custom json transactions, which have json data added to allow to rebuild the chunks even without the comment, which refers to the chunk, in case the player needs to revert some changes to an earlier version of the world.

File: https://github.com/Abwasserrohr/STEEM.CRAFT/pull/2/files#diff-bfd87e37f853d8348c2745673e22870c

10. Pull requests

https://github.com/Abwasserrohr/STEEM.CRAFT/pull/1
https://github.com/Abwasserrohr/STEEM.CRAFT/pull/2


11. GitHub Account

https://github.com/Abwasserrohr


12. How to contribute

If you want to contribute to STEEM.CRAFT, contact me here in the comments or on Discord. Please contact me directly, I'm the sewage pipe on Discord. I look forward to meeting people who want to get in touch with Skript and Minecraft.
Of course, you can also start forking STEEM.CRAFT, creating pull requests and improve it without contacting me.

Discord: https://discord.gg/FRuK5BC


Thank you for reading my contribution post.

In this post, I introduced you a new way for servers to store important player worlds to the Steem Blockchain. This does not involve big worlds which have been created by servers over the years, but lightweight worlds saved using Schematic, which can now be created by players.

I'm also really sorry for making such big pull requests. But I simply forgot making more of these. In the future, there will be less messy and smaller pull requests to make it easier to view.

While I had much to say this time, I didn't have enough pictures to show and creating new ones which visualize things are pretty time consuming, so I went fewer pictures for this time.

If you have feedback about this contribution post, the new features or STEEM.CRAFT in general, just comment below this post, I appreciate your feedback.

Have a great Friday and a nice weekend,

@immanuel94

STEEM.CRAFT IS NOT A OFFICIAL MINECRAFT PRODUCT.
NOT APPROVED BY OR ASSOCIATED WITH MOJANG.

Sort:  
  • Awesome post with a video, images, code samples and explanations of coding choices.
  • I love the idea of merging the blockchain and games, kudos for doing it.
  • Commit messages are exceptional
  • Comment in the code are over the top.
  • Keep innovating, it's exciting.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for reviewing my contribution post. :)

Thank you for your review, @helo! Keep up the good work!

Das Skript ist auf jeden fall sehr Praktisch, wenn ich ein Citibuild server machen würde, würde ich das Skript auf jeden fall nehmen. Was ich schade finde ist das es nur mit Skript funktioniert -> Man braucht auf dem Server das Skript plugin. Aber ansonsten sehr cooles Skript und war bestimmt eine Menge arbeit

Ja, da hast du recht. Während es ein Nachteil ist, Skript zu haben, ist es aber auch ein großer Vorteil, eigene Ideen schnell mit einzubauen, Menüs nach eigenen Wünschen einzubauen, etc. =)

Da hast du recht, daran habe ich garnicht gedacht. Skript ist auf jeden fall einfacher als Java und hat meines wissens nach nicht so viele Probleme mit der Performance

Skript hat durchaus einen schlechten Ruf bei vielen Serverbetreibern, dabei ist es garnicht so langsam und wirklich super einfach anzupassen. :)

Loading...

was soll das sein?

Ja, ist für manche möglicherweise etwas unverständlich. Ich werde dafür aber definitiv noch genauere Informationen machen, damit es verständlich ist, was da passiert. :)

Super ;)

Danke für dein Feedback!^^

What an amazing piece of work! I made an approach to several influencial minecrafters, hopefully this will spread and be developed in a nice way!

Thank you for your feedback! =) Currently, this is still very experimental and it will need some improvements to really make it fun.^^

Hört sich sehr spannend an und die ersten Tests waren ja auch sehr gut.

wow decentralized crafting that's a great idea

Thank you for your feedback. :)

Hey, @immanuel94!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi @immanuel94!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 3.327 which ranks you at #7336 across all Steem accounts.
Your rank has improved 1594 places in the last three days (old rank 8930).

In our last Algorithmic Curation Round, consisting of 483 contributions, your post is ranked at #122.

Evaluation of your UA score:
  • You're on the right track, try to gather more followers.
  • The readers appreciate your great work!
  • Good user engagement!

Feel free to join our @steem-ua Discord server