Is Nethereum decentralized? If not what's a decentralized alternative for C#?
- NFT
- solidity
- smart contract All Things Web3
I have an app I'm building that MUST be 100% decentralized. It is a Unity game written in C#. The user needs to sign a nonce with their Ethereum wallet. The game checks the signature to determine whether or not the user's wallet contains the NFT that is designated to provide authentication. The checking to see if a particular NFT is present needs to be decentralized otherwise if the rpc node goes down or is compromised, the user can't get authentication. I used Nethereum to check if the NFT is present in the user's wallet. The docs provide this example of how to get the NFT balance of a particular address http://docs.nethereum.com/en/latest/Nethereum.Workbooks/docs/nethereum-managed-accounts.workbook/.
var balanceOfFunctionMessage = new BalanceOfFunction()
{
Owner = account.Address,
};
var balanceHandler = web3.Eth.GetContractQueryHandler<BalanceOfFunction>();
var balance = await balanceHandler.QueryAsync<BigInteger>(contractAddress1, balanceOfFunctionMessage);
Is this decentralized? I don't see how this could work without calling out to a URL for a Geth node which I believe would make the NFT balance query centralized. I'm hoping that this process is somehow decentralized. Maybe Nethereum reaches out to get the balance of several nodes in a decentralized way without going through a singular gateway? Can someone please tell me how decentralized or centralized Nethereum's method of querying the NFT balance is?
If the code in the Nethereum docs example that I provided is not decentralized. Could you provide me with the most decentralized alternative?
Answers 1
I believe this is more a question of trust rather than centralization or decentralization.
NFT is stored on the Ethereum blockchain. NFT component itself is decentralized.
Any request to a blockchain will have to be routed through one of the nodes on the network. Each individual node is owned by some entity and by definition is centralized. If you are not specifying RPC URL for Nethereum it means that there is some default URL that it uses and that someone must manage RPC. And there is no other way around it.
If you don't want to trust a default PRC that Nethereum provides than you can specify your custom RPC - https://docs.nethereum.com/en/latest/introduction/web3/#url-constructor
There are many established names that provide RPC service to Ethereum and can be well-trusted:
If you are worried that one of them is going down then you build backup providers. If you detect that default provider is down then use one of the backups.