Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: JustAnOtherLoser on November 01, 2021, 02:57:31 PM



Title: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 01, 2021, 02:57:31 PM
Hey Guys,

with LN becoming more and more "a thing" and me being bullish on BTCs future as the last currency we will ever adopt,
I thought to myself: Are there any LN BTC driven NFT games? Are they any good? If not: Why?

Of course I'll google that shit, but I guess this forum could also be a nice start for my research. As a proud owner of my
cryptokitties from the last century, I know there is a lot NFT Stuff and "Games" happening on the ETH Chain.

Call me a hater, but I prefer my Games to use real money - not premined shitcoins. We already got some of these, we call
them Dollars. My Checklist for this game would be something like: OpenSource, Items are NFTs, BTC driven, LN (or else)
for Micro TXs.

Could some of you give me a List of things I should read/learn to get behind any of this? I know Games are a FUCKTON of
work, but I'm a Web Developer and this project idea boggles my mind. It feels like there should be a good BTC Game. Like an
opensource Diablo, WOW or something.

 


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: n0nce on November 01, 2021, 08:03:17 PM
I'm fully with you about BTC being the better money and all that, but why do we want a game 'on Bitcoin'?
It's not entirely clear what you actually want to build. Cryptokitties on Bitcoin? Or do you simply want an open source game (a game can be open source and not utilize cryptocurrency)? Do you want to build a game with microtransactions made using Lightning?
These are all very different projects combining BTC and games and it should be clear to you what you actually want to accomplish before you start off.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 01, 2021, 08:33:03 PM
Runescape + Items on LN BTC would be cool, I guess. I don't even know if something like that would be even possible. That's why I'm asking so broadly  ;D


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: BlackHatCoiner on November 01, 2021, 09:01:44 PM
You don't seem self-awared of your plan.

Alright, so you want to build an NFT Game, but with Bitcoin. Do you know that Bitcoin isn't turing-complete (https://stackoverflow.com/questions/7284/what-is-turing-complete)? You'll have to work on a project that is, such as Ethereum.

Are there any LN BTC driven NFT games? Are they any good? If not: Why?
Do you mean games that accept the LN BTC as a payment method? There aren't probably many. But, here's another advantage of bitcoin; they don't have to. As long as there are people willing to exchange gift cards for bitcoins, you can use the lightning network to make in-game purchases.

This is also true for online services such as Google Play, Spotify, Netflix, Steam etc. They don't have to accept cryptocurrencies as long as there's this intermediary.

Call me a hater, but I prefer my Games to use real money - not premined shitcoins. We already got some of these, we call them Dollars.
Well, that's where these projects lack of. While they are cool as concepts, they fail in the sociopolitical part.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: pooya87 on November 02, 2021, 04:01:09 AM
Are they any good? If not: Why?
They are not games, they are gambles. And why would you want to build it on top of bitcoin (a payment system)? Would you build it on top of PayPal?!

Quote
but I prefer my Games to use real money
Why would a game use money at all?


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: OgNasty on November 02, 2021, 05:55:45 AM
You don't seem self-awared of your plan.

Alright, so you want to build an NFT Game, but with Bitcoin. Do you know that Bitcoin isn't turing-complete (https://stackoverflow.com/questions/7284/what-is-turing-complete)? You'll have to work on a project that is, such as Ethereum.

Not only is Bitcoin not equipped for this sort of usage, but fees would make it pretty difficult to build something usable.  Ethereum makes it incredibly simple to build this sort of thing, but again, fees are a major drawback.  That's why we're seeing chains like Polygon kick everyone's ass with usage suddenly.  Low fees and usability can't be compared with ETH or BTC.  I'm not familiar enough with the chain to know the drawbacks of this combination, but I know if I were building a project like this today, I sure as hell wouldn't be looking at BTC or ETH. 


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: pooya87 on November 02, 2021, 06:13:18 AM
Not only is Bitcoin not equipped for this sort of usage, but fees would make it pretty difficult to build something usable.
Technically a side-chain can handle any kind of weird functionality like this without worrying about "on-chain" transaction fees that bitcoin has or certain functionality that bitcoin smart contracts don't provide.

Quote
That's why we're seeing chains like Polygon kick everyone's ass with usage suddenly.
Ethereum used to have very low fees at the start too. They all face (best case scenario) same scaling issues as bitcoin or (worse case/most common case scenario) worse scaling issues than bitcoin.

Quote
Low fees and usability can't be compared with ETH or BTC.
You are right ETH is useless and extremely expensive to use while bitcoin is useful with so much cheaper transactions. Not to mention BTC is immutable, decentralized and secure, the 3 main principles that ETH lacks... You can't really begin to compare the two ;D
Here is the comparison between ETH and BTC transaction fees in USD. The red line is shethereum:
https://i.imgur.com/YBLQjEc.jpg


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: Pmalek on November 02, 2021, 10:31:33 AM
Bitcoin's very limited smart contract capabilities would make that very difficult to create. I don't have the needed knowledge to determine whether or not it's impossible though.

If I am a gamer, why would I want want to play blockchain-based games? For the potential to earn money? In that case, I am playing for the wrong reasons. Why not just buy and invest in Bitcoin? I never liked the buy-to-play model that many games seem to have adopted now. You purchase the game, then you are asked to buy in-game items to advance and get better.

Make something like Hitman or PES run on the blockchain. ;D 


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: HeRetiK on November 02, 2021, 12:12:01 PM
Could some of you give me a List of things I should read/learn to get behind any of this? I know Games are a FUCKTON of
work, but I'm a Web Developer and this project idea boggles my mind. It feels like there should be a good BTC Game. Like an
opensource Diablo, WOW or something.

As far as colored coins are concerned (ie. the NFT precursor) you could look into RGB:
https://rgb-org.github.io/

No idea how active this project still is though. From the looks of it, not very.



Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 02, 2021, 02:36:28 PM
If I am a gamer, why would I want want to play blockchain-based games? For the potential to earn money?

Nah. Because you can own the game (items) that way. I see all these fake Gamble shitgames on ETH popping up and thought this can't be it.
Lightning would provide small Fees & fast TX times. I just don't know where I should even start. I was just curious what btc talk thought about
this.

Many seem to think I want to use the BTC Mainlayer. That would be stupid as fuck. I thought maybe a LN Wallet could be the Game Account.
On this LN Wallet are your Items for your Char. These Items can then be traded or stuff like that. Just mind mapping around.

I just want a new type of game era. Fuck this whole EA gamble shit and the Items aren't even in your hand. This CANT be the future anyone wants.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 02, 2021, 02:39:50 PM
Alternatively, you could use Liquid Network. While the network is controlled by federation board, it utilize Bitcoin/Bitcoin network which partially meet OP criteria.

I never used Liquid, but I've read a bit about it. I don't really know if using Liquid would be open enough. I like the Idea of Lightning Channels.
Seems more like something everyone can use & setup without asking for permission.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 02, 2021, 02:42:49 PM
As far as colored coins are concerned (ie. the NFT precursor) you could look into RGB:
https://rgb-org.github.io/

THIS! But it seems like in the last 12 years nothing big happend in this direction. I'll continue my research.
Maybe we'll see us in some years, when I launch a first blue print. OpenSource Bitcoin MMO seems like something
that should be done already. I wonder why it did not happen by now.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: NotATether on November 02, 2021, 06:03:52 PM
Many seem to think I want to use the BTC Mainlayer. That would be stupid as fuck. I thought maybe a LN Wallet could be the Game Account.
On this LN Wallet are your Items for your Char. These Items can then be traded or stuff like that. Just mind mapping around.

I don't think LN in its present state has anywhere near the transactions per second as Ethereum has so that will be quite the obstacle for you to overcome.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 03, 2021, 12:51:19 AM
I don't think LN in its present state has anywhere near the transactions per second as Ethereum has so that will be quite the obstacle for you to overcome.

Really? That would be one of my smallest concerns. Of course it could be one, but something like missing functions would be a bigger hassle. TBH I'm running a LN Node, but just for fun. I'm just trying to get some impressions online - So thanks for your Input :)


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on November 03, 2021, 07:17:27 PM
I agree Liquid isn't open or permissionless enough, i never used Liquid either. Alternatively, you could check Rootstock (https://www.rsk.co/ (https://www.rsk.co/)) which have smart contract capability. It's less promoted than Liquid, but AFAIK it's more open and use merged mining on Bitcoin network.

I'll note that. I knew this won't be easy by any means, but it seems horribly hard. I'll need to research a lot more than I thought, but I still like the idea. I need to talk to some friends. Thanks for some first impressions!


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: Syke on November 05, 2021, 09:54:18 AM
Bitcoin community generally not interested with smart contract or other usage with high complexity, so it's not surprising you have hard time. But after short research (thanks to this thread), i found out RSK already support token, although there are few information/documentation about it.

RSK is very good at doing smart contracts. It's reasonably fast, and transactions are cheap.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: Rizzrack on November 05, 2021, 01:13:30 PM
You can check out elixir: https://launcher.elixir.app/games

There is at least one interesting game there lightnite https://lightnite.io/ . Sort of a low-poly Fortnite. Right now it's open beta ...
The NFTs are on Liquid sidechain but hey, close enough I guess  :P


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: titular on November 11, 2021, 01:00:59 AM
You may want to look into some bitcoin sidechains that support smart contracts and NFTs. That would be a good place to start.

The Stacks Network allows you to do this using the bitcoin network, but I do not believe you can buy or sell on their marketplace yet.

There are many projects though that act as a sidechain to bitcoin where you are able to utilize smart contracts to their max potential.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: OgNasty on November 11, 2021, 01:10:30 AM
You can check out elixir: https://launcher.elixir.app/games

There is at least one interesting game there lightnite https://lightnite.io/ . Sort of a low-poly Fortnite. Right now it's open beta ...
The NFTs are on Liquid sidechain but hey, close enough I guess  :P

Very cool to see that people are building out this sort of tech.  I wish Bitcoin would catch up and implement some sort of web3 login features for sites to use so we can stop relying on email/passwords to login.  That feels archaic already after getting used to using web3 applications on other blockchains.  I don't see why this hasn't been a standard for some time already.  After being strictly in the Bitcoin community for so long, it feels like I've traveled further into the future when using web3 apps to login to similar experiences like The Sandbox.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: thecodebear on November 17, 2021, 05:11:36 AM
It'll be interesting to see if this sort of stuff gets popular on Bitcoin. Obviously it would make more sense to use Bitcoin for everything than other crytpos, but Bitcoin wasn't made for this sort of thing. I guess with Taproot Bitcoin can now start being able to handle simpler finance applications better. But to do this sort of stuff - games, NFTs - I think that would never be possible on Bitcoin because it isn't designed for that. So you have to rely on sidechains. But then a sidechain is sort of like using another crypto network, except you still get to use Bitcoin.

Not sure if these sort of applications will ever take off on Bitcoin because I'm not sure people will ever really bother using sidechains much. Now if there could be an open application layer built on top of LN that including NFT funtionality (have no idea if this is even possible), rather than having to go with one of these sidechains controlled by companies which is pretty much no different than altcoins, I think that could have a possibility of being something big on Bitcoin.

Anyways, yeah to build an NFT game on Bitcoin you gotta go with a sidechain but the downside is they aren't very popular.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on December 25, 2021, 12:46:17 AM
Now if there could be an open application layer built on top of LN that including NFT funtionality (have no idea if this is even possible), rather than having to go with one of these sidechains controlled by companies which is pretty much no different than altcoins, I think that could have a possibility of being something big on Bitcoin.

That's exactly my thought / question: Is this even possible? When It's possible why is there nothing like that or am I not searching enough?


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: BBGC NFT on December 25, 2021, 01:47:57 AM
Now if there could be an open application layer built on top of LN that including NFT funtionality (have no idea if this is even possible), rather than having to go with one of these sidechains controlled by companies which is pretty much no different than altcoins, I think that could have a possibility of being something big on Bitcoin.
That's exactly my thought / question: Is this even possible? When It's possible why is there nothing like that or am I not searching enough?
What, if a LN channel closes? What happens to the 'NFT data'?


Building a NFT Game with BTC. Where Do I even start?
Start with an explorer/marketplace for Bitcoin NFTs :) But not using a sidechain.
I haven't yet read up enough on NFTs to confidently answer your question, but I'm pretty sure that they work a bit different from what you described.
Also, I already came across 'Bitcoin NFTs', which are sold on https://raretoshi.com/. While it's 'on BTC', it actually uses the Liquid sidechain.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on December 25, 2021, 04:52:02 AM
What, if a LN channel closes? What happens to the 'NFT data'?

Let's imagine your Channel is like your Account/ID in that game. If you close your channel and did not sell every item, the Data is gone forever. The thing I dislike about this approach is that the game seems to be bound to some "master nodes" which kind of defeats the purpose of a decentralized game. It should also be possible to link NFT Items to an account (via BTC signing) even if the channel gets closed, but a tx on the mainchain should be maybe a backup solution if everything fails.

I did not test it by now, but it should be possible to use the "Memo" of an LN tx to store a Hash of what ever I want. I guess this alone should be enough to send NFT Data via LN. What concerns me is the part of opening a Channel. The question is: To whom?

Even a P2P Game that uses its Players as Host would eventually delete Data of other Users, which seems pretty unenjoyable  ;D Maybe some LN users would host these "Account Channels" to gain Traffic (= tx revenue) on their node? I don't know by now.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: JustAnOtherLoser on December 25, 2021, 04:57:23 AM
You can check out elixir: https://launcher.elixir.app/games

There is at least one interesting game there lightnite https://lightnite.io/ . Sort of a low-poly Fortnite. Right now it's open beta ...
The NFTs are on Liquid sidechain but hey, close enough I guess  :P

Holy shit, how did I miss out on this?! Thanks! Liquid is a good start :D


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: rot13maximalist on January 20, 2022, 01:26:58 AM
Not NFT-related, but you should check out what zebedee is doing. They're building wallets, APIs, libraries, and services to do lightning micropayments in games. They have a build of CS:GO where you get sats for scoring points in a match and it looks like they're trying to make it easy to integrate into other games/game engines. I'd say go make a game that's actually fun to play (as opposed to a game that serves only as a post-hoc rationalization for the existence of a set of NFTs) and then incorporate lightning micropayments to drive engagement and monetization.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: d5000 on January 20, 2022, 10:41:46 PM
Even if I'm not really a gamer (and much less into blockchain gaming), I think the question whether LN is suited for NFT handling is very interesting.

For tokens in general, there's a framework called OmniBOLT (http://) to transact with Bitcoin-based tokens (For example, Tether started as a Omni token, and should also be compatible with OmniBOLT). I didn't know RGB, that looks interesting too :)

However, I see one big limitation in the usability of Lightning for NFTs, and that's rooted in the whole purpose of Lightning.

Lightning is basically a mechanism where you can bundle a big number of transactions into one (or two, if you close the channel eventually) on-chain transaction, the "channel opening" transaction. This however means that it makes sense principally if you do lots of transactions with that asset - be it Bitcoin or a fungible OmniBOLT token.

Now for a NFT, the problem is that it is not fungible, so you would have to open a LN channel for each NFT, because each NFT has a distinct value and market, so you (probably) can't bundle various NFTs into one channel. In most cases each account holder won't interact that much with a single NFT, maybe a handful of times as a maximum, so the benefits for Lightning are limited.

However, a type of game I could imagine where LN makes fully sense, would be one with the following characteristics:

- there are only a few NFTs circulating
- the game participants will be interacting in high frequency with every single NFT.

Imagine for example a game where there are only 5 NFTs circulating, and the score depends from trading movements between these 5 NFTs and Bitcoin. Opening 5 LN channels for the NFTs and one regular BTC channel wouldn't be a big problem for participants, and if everybody trades the NFT a lot of times while the game lasts, LN saves a lot of fees/transactions.

What, if a LN channel closes? What happens to the 'NFT data'?
Afaik this isn't the problem - if you close a NFT LN channel, then this NFT can "continue to live" in on-chain transactions. If you're the owner of it in the moment the channel was closed, it's you who will have the right to transfer it again, be it via on- or off-chain methods. Only a system has to be coded to "transfer the hash" smoothly from LN to on-chain and vice versa.

I did not test it by now, but it should be possible to use the "Memo" of an LN tx to store a Hash of what ever I want. I guess this alone should be enough to send NFT Data via LN. What concerns me is the part of opening a Channel. The question is: To whom?

To another game participant, of course; they could communicate via a web platform, LN itself or alternatively via some decentralized messaging system like Retroshare or Tox to request the opening of channels.

The best thing actually would be shared LN channels for NFTs between a group of players who have minimal trust between themselves. There are concepts like "account management" for Lightning which allow that; however, in these, one of the participants is the main holder of the keys and so the others must trust him.

There are concepts like trustless multi-party LN channels (also called "channel factories"), but as far as I know the maximum number of participants is currently ~10 and there are still no mature tools for it, so it's still a theoretical concept without actual practical usage. It may also depend on the Eltoo mechanism which needs SIGHASH_ANYPREVOUT (https://anyprevout.xyz/).


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: pooya87 on January 21, 2022, 04:01:36 AM
Now for a NFT, the problem is that it is not fungible, so you would have to open a LN channel for each NFT, because each NFT has a distinct value and market, so you (probably) can't bundle various NFTs into one channel. In most cases each account holder won't interact that much with a single NFT, maybe a handful of times as a maximum, so the benefits for Lightning are limited.
Why not? We are talking about smart contracts here and all it takes is two parties who accept the token to agree on an exchange rate, then they can "swap" their tokens with each other with that rate. I think the same principles of Atomic Swaps can be applied here too except that it all happens in one network instead of two.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: d5000 on January 21, 2022, 05:41:25 AM
Why not? We are talking about smart contracts here and all it takes is two parties who accept the token to agree on an exchange rate, then they can "swap" their tokens with each other with that rate. I think the same principles of Atomic Swaps can be applied here too except that it all happens in one network instead of two.
I'm not sure if I understand correctly what you mean. But for atomic swaps you also need two accounts (on each blockchain, or with each token if you're using two different tokens on the same blockchain). Atomic swaps are a connection between two transactions of different tokens where none of both can be done separately, but both are technically separate.

I'm not 100% sure my reasoning is correct, but the way I see it is the following:

Lightning's security is based on the principle that you always have to be able to close a channel, "freezing" the current channel state. But the "channel state" has always a maximum: the amount of the coin or token you and your counterparty (channel partner) froze when you opened the channel.

So can you simply create something new "while the channel is open" that didn't exist in your channel when it was opened? This "thing" (the NFT in this case) has to "jump into your channel" in some way, but isn't the security mechanism of LN and its double-spend protection limited to the original channel partners?

Probably however you could open, in a single transaction, a lot of NFT channels with some OP_RETURN magic in a few UTXOs.

I would actually be happy if I'm wrong, because that would create lots of cool use cases :)


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: pooya87 on January 21, 2022, 06:13:18 AM
I'm not sure if I understand correctly what you mean. But for atomic swaps you also need two accounts (on each blockchain, or with each token if you're using two different tokens on the same blockchain). Atomic swaps are a connection between two transactions of different tokens where none of both can be done separately, but both are technically separate.
The scripts used in transactions could be used here, all happening in one network but with two tokens that could have different values.

Quote
Probably however you could open, in a single transaction, a lot of NFT channels with some OP_RETURN magic in a few UTXOs.
Here is an idea and I don't know how possible it is but maybe we could use the new Taproot scripts here too. In Taproot the spending script can have different branches where only one has to be revealed when spending on chain. One of these branches could contain information regarding the Omni tokens (the amount being transferred, the signature,etc.) essentially a similar scrip that is put inside the OP_RETURN output.
This removes the need for OP_RETURN and creation of channels from such transactions and the involving complications.


Title: Re: Building a NFT Game with BTC. Where Do I even start?
Post by: vjudeu on January 21, 2022, 07:29:44 AM
Quote
Here is an idea and I don't know how possible it is
It is possible. You can even split the whole NFT into small blocks and put all of them in a tapscript tree. Then you can decide, how many things you want to reveal: spend by key and push only one simple Schnorr signature, spend by script and reveal some kind of hash of the NFT, or maybe spend by script and store some small piece of that NFT on-chain. If you have some huge file, paying alone for pushing that on-chain is not an option, it is too expensive. But if you have many owners and each of them reveal some small part of that file, that could work better. Even more: if you mine a signature, so the first bytes will reveal the data you want to push, you can pay in computing power instead of paying in satoshis. You can even combine that and pay something in satoshis and something in computing power.