Pages:
Author

Topic: Building a NFT Game with BTC. Where Do I even start? (Read 590 times)

hero member
Activity: 813
Merit: 1944
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.
legendary
Activity: 3472
Merit: 10611
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.
legendary
Activity: 3906
Merit: 6249
Decentralization Maximalist
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 Smiley
legendary
Activity: 3472
Merit: 10611
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.
legendary
Activity: 3906
Merit: 6249
Decentralization Maximalist
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 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 Smiley

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.
newbie
Activity: 5
Merit: 6
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.
jr. member
Activity: 37
Merit: 16
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  Tongue

Holy shit, how did I miss out on this?! Thanks! Liquid is a good start Cheesy
jr. member
Activity: 37
Merit: 16
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  Grin Maybe some LN users would host these "Account Channels" to gain Traffic (= tx revenue) on their node? I don't know by now.
newbie
Activity: 16
Merit: 4
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 Smiley 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.
jr. member
Activity: 37
Merit: 16
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?
hero member
Activity: 2240
Merit: 848
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.
donator
Activity: 4760
Merit: 4323
Leading Crypto Sports Betting & Casino Platform
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  Tongue

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.
sr. member
Activity: 287
Merit: 368
"Stop using proprietary software."
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.
copper member
Activity: 783
Merit: 710
Defend Bitcoin and its PoW: bitcoincleanup.com
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  Tongue
legendary
Activity: 3878
Merit: 1193
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.
jr. member
Activity: 37
Merit: 16
I agree Liquid isn't open or permissionless enough, i never used Liquid either. Alternatively, you could check Rootstock (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!
jr. member
Activity: 37
Merit: 16
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 Smiley
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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.
jr. member
Activity: 37
Merit: 16
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.
jr. member
Activity: 37
Merit: 16
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.
Pages:
Jump to: