Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binance Smart Chain support #29

Closed
LouizFC opened this issue Nov 23, 2021 · 7 comments
Closed

Binance Smart Chain support #29

LouizFC opened this issue Nov 23, 2021 · 7 comments

Comments

@LouizFC
Copy link

LouizFC commented Nov 23, 2021

Greetings.

This issue is related to airgap-it/airgap-wallet#55.

As the title suggests, I would like to implement BSC support into AirGap. As per #7, AirGap as a project prefers not to accumulate features that the maintainers cannot properly maintain, so I understand that my changes could end up not merged, which is fair considering the security centric approach of this project.

As per "Contribute Guidelines", I would like to know if there is interest in such a PR before implementing it?

@AndreasGassmann
Copy link
Member

Hi. Thanks for reaching out and reading our guidelines.

Because BSC is very similar to ETH, I'm not expecting there to be a lot of code changes, so maintaining that code shouldn't be too much effort. My main concern is regarding the node. Are there "official" nodes that we could use?

We decided that in the long term, we will add something like "community maintained protocols" to AirGap. Those will be hidden between a flag so users need to accept a disclaimer of sorts that will explain that those protocols might break at any moment and are not maintained by us. This feature is not ready yet though. The main focus there will be to implement some kind of "sandbox" so those community protocols can't mess with the private key, for example.

I can't give you any promises, but out of all possible chains, I think BSC might be the one we would most likely merge :).

@LouizFC
Copy link
Author

LouizFC commented Nov 23, 2021

My main concern is regarding the node. Are there "official" nodes that we could use?

I am a Integration Engineer, but I will admit that I am a bit of a newbie to the crypto world, so could you please clarify? as Node, you mean an official entrypoint where we broadcast/query the transactions? There are some words that I am not yet familiar with.

@AndreasGassmann
Copy link
Member

The node is the backend service that holds the data of the blockchain and is continuously connected to other nodes to always have the latest state of the network. It is used to broadcast transactions and for some simple queries (eg. balance of an address).

The API of the node is quite limited, which is why there is often something called an "indexer", which stores the blockchain data in a database and makes more advanced queries easier (eg. getting all transactions of an address).

Both of those services are needed in AirGap. The problem is that if the node / indexer goes down, the protocol will stop working (eg. no balances or transaction can be shown, no transactions can be broadcast). So the best solution is to host that node ourselves, which is quite a bit of work, depending on the chain.

Here is the example for Ethereum: https://github.com/airgap-it/airgap-coin-lib/blob/master/packages/core/src/protocols/ethereum/EthereumProtocolOptions.ts#L15-L18

@LouizFC
Copy link
Author

LouizFC commented Nov 24, 2021

I see, thank you for clarifying. That said I will study these concepts. I took a look at the BSC docs and, selfhosted nodes aside, I found the information needed. I start working on the implementation probably in the weekend.

@AndreasGassmann
Copy link
Member

Let us know if you hit any issues. I'm assuming you can extend the EthereumProtocol and create a new BinanceSmartChainProtocol with it. In the best case, you actually only need to provide the new node URLs and chain ID, the rest should be largely the same.

@AndreasGassmann
Copy link
Member

I'm happy to announce that AirGap Vault is now compatible with MetaMask. See our tutorial here. Using this approach, it is possible to use BSC with AirGap Vault.

Adding BSC to AirGap directly is still an option, but in my opinion it's now not as urgent anymore as before because there is an alternative.

@LouizFC
Copy link
Author

LouizFC commented Mar 29, 2022

I used the MetaMask integration recently at it works perfectly.

I am closing this because I think there is no tangible benefit for implementing this natively. BSC documentation at the moment is not really friendly, and setting up self hosted nodes is poorly documented (again, at this moment).

@LouizFC LouizFC closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants