-
Notifications
You must be signed in to change notification settings - Fork 120
Reach wallet arcs (0005 thru 0011) #8
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
Conversation
|
@fabrice102 And I chatted yesterday about ARC-0009 and how it is going to be very brittle to actually expose the real algosdk objects, when what we really care about is controlling access to the node behind them. He proposed the idea of instead providing a simple HTTP client-style interface, with a However, the pull request to js-algorand-sdk that would enable this was rejected --- algorand/js-algorand-sdk#277 --- and in its conclusion they suggest override an internal variable with an undocumented interface. If js-algorand-sdk refuses to support this pattern, then I think we're left with two choices:
I think that we should move forward with these ARCs and try to produce a new version once we can get buy-in from Algorand to support this in their JS SDK. |
+1 If js-algorand-sdk doesn't want to play nice, we could consider creating a competing js sdk for algorand that does the things we want, and try to entice people to switch over to it. I don't love the idea of splitting the community, though. I do think that developers should be able to program against a single interface, and then it Just Works whether you're just using the js sdk, or going through a wallet. ARC 9 is definitely brittle and is intended to be replaced at some point in the future with something better. But, in defense of ARC 9 as currently exists, I think it's reasonable to assume that js-algorand-sdk will at least maintain backwards compatibility with their |
Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk.
* Enabling a custom client for Algod and Indexer Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk. * improvements followging review
From algorandfoundation#8 with the following changes: * use of `genesisID`/`genesisHash` instead of `network` for `enable` * enforce main networks' hashes from genesisID * allow `enable` to return no account for just access to blockchain * support of list of group of transactions in posting * clarify error handling in many cases * add security considerations in many places * add optional `signTxns` and `postTxns` to wallet standard * clarify requirements for confirmation when posting transactions * use `BaseHTTPClient` from algorand/js-algorand-sdk#477 for `getAlgodv2Client` and `getIndexerClient` * other minor changes Main points to discuss: * splitting the error standards out of ARC-0001 and make it a living standard * allow optional argument to post without waiting for confirmation (dangerous)
* Enabling a custom client for Algod and Indexer Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk. * improvements followging review
* Enabling a custom client for Algod and Indexer Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk. * improvements followging review
* Enabling a custom client for Algod and Indexer Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk. * improvements followging review
* Enabling a custom client for Algod and Indexer Currently the only way for a dApp to use the SDK with an API service is to know the URL and token of the API service. This prevents dApps from using API services / algod / indexer provided by the user or by a wallet such as AlgoSigner. In particular: * When using a wallet such as AlgoSigner, a dApp either need to manually serialize data and write path for endpoints (https://github.com/PureStake/algosigner/blob/develop/docs/dApp-integration.md#algosigneralgod-ledger-mainnettestnet-path-algod-v2-path--) or need to not use at all the provided API service. * A user cannot use their preferred (potentially more trusted) API service / algod / index / API services * A dApp cannot easily connect to a private network of the user (See also algorandfoundation/ARCs#8 for more details on wallets and discussion around them.) The goal of this PR is to allow the above scenarios. It does so by introducing an intermediate interface `BaseHTTPClient` and to allow to construct `Algodv2Client` and `IndexerClient` from such a `BaseHTTPClient`. A `BaseHTTPClient` is minimal: it does not perform any serialization/de-serialization, does not fix `accept` headers, does not even try to utf8-decode strings. Its only purpose is to execute directly REST queries and return the raw responses. `BaseHTTPClient` is meant to be stable over releases of algosdk. * improvements followging review
I've also written a small runnable demo which demonstrates an implementation of all of the API functionality specified by this group of ARCs. [except for
window.algorand, since it is a cli demo]https://github.com/reach-sh/algo-demo-wallet