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

TON Connect #115

Merged
merged 1 commit into from
Apr 18, 2023
Merged

TON Connect #115

merged 1 commit into from
Apr 18, 2023

Conversation

tolya-yanot
Copy link
Member

@tolya-yanot tolya-yanot commented Feb 27, 2023

The Tonkeeper team has done a great job. They studied what's been done in other blockchains, took the best approaches and improved the weaknesses.

If you like comparisons, TON Connect can be seen as an improved and most importantly decentralized version of WalletConnect.

Many TON dapps and wallets already support TON Connect. With the upcoming updates of the TON Connect SDK and UI, it's going to be pretty good. Let's have a final discussion about the protocol to make it a network-wide standard.

If you see any flaws or omissions of the protocol, please describe them here.


TON Connect is a bridge that crosses this conceptual gap.

TON Connect, in addition to the transport layer of communication between the wallet and the app, provides methods of authorization, sending transactions to the network, interaction with smart contracts, etc.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which methods of authorization are implied here?
Usually local authorization is done in wallet itself (fingerprint, pin, password).

Is it supposed to be something other than just private key (or complete seed phrase) + local authorization?

E.g. some types of 2FA to sacrifice some decentralization in favor of security?

Copy link
Contributor

@Gusarich Gusarich Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AndreyDodonov-EH
Authorization in this context means proving to the app backed that user really owns the wallet.
It is also shown in docs: https://ton.org/docs/develop/dapps/ton-connect/integration#logging-out-and-requesting-tonproof

Copy link

@AndreyDodonov-EH AndreyDodonov-EH Feb 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!
I'll try to go through the docs thoroughly.

@stels-cs
Copy link

stels-cs commented Mar 1, 2023

Add way to abort transaction sent via connector.sendTransaction

like abortable fetch in browser api https://developer.chrome.com/blog/abortable-fetch/ its use AbortSignal https://developer.mozilla.org/ru/docs/Web/API/AbortSignal

If the user changes his mind about sending a transaction, he should be able to exit of the UI. Like on screen.
It's may happen after call connector.sendTransaction, in this case dapp can hide own UI, but can't abort transaction in wallet UI
image

Of course, this does not affect the blockchain, only UI

@Gusarich
Copy link
Contributor

Gusarich commented Mar 1, 2023

@stels-cs user can just cancel the tx in his wallet UI. What's the problem with that?

@stels-cs
Copy link

stels-cs commented Mar 1, 2023

@stels-cs user can just cancel the tx in his wallet UI. What's the problem with that?

This is not convenient when you use a computer and a wallet in your phone.

@tvorogme
Copy link

tvorogme commented Mar 3, 2023

Currently, connector.sendTransaction returned signed boc. For better API calls, I suggest to return transaction hash (wallet is 100% sure that the transaction is processed, so it must have a hash of it?). It's quite hard to find a transaction by signed boc on scale of 100k+ users.

@tolya-yanot
Copy link
Member Author

Currently, connector.sendTransaction returned signed boc. For better API calls, I suggest to return transaction hash (wallet is 100% sure that the transaction is processed, so it must have a hash of it?). It's quite hard to find a transaction by signed boc on scale of 100k+ users.

Maybe it can be done as a separate event - immediately at the time of sending, return a message or message hash, and then send an event with a hash of the transaction

@tolya-yanot
Copy link
Member Author

tolya-yanot commented Mar 7, 2023

Since some wallets (hardware wallets or custom wallets such as a lockup wallet) will probably never support multiple messages in one SendTransaction, the parameter maxMessages: number added to the Feature SendTransaction.

The Feature format has also been changed so that the wallet can return more information if required.

before:

type Feature = 'SendTransaction' | 'SignData';

after:

type Feature = { name: 'SendTransaction', maxMessages: number } | { name: 'SignData' };

For some time in the process of transition, wallets can return both format features = [ 'SendTransaction', 'SignData', { name: 'SendTransaction', maxMessages: number }, { name: 'SignData' } ] for backward compatibility.

Shi8ho11

This comment was marked as spam.

@tolya-yanot
Copy link
Member Author

Add way to abort transaction sent via connector.sendTransaction

like abortable fetch in browser api https://developer.chrome.com/blog/abortable-fetch/ its use AbortSignal https://developer.mozilla.org/ru/docs/Web/API/AbortSignal

If the user changes his mind about sending a transaction, he should be able to exit of the UI. Like on screen. It's may happen after call connector.sendTransaction, in this case dapp can hide own UI, but can't abort transaction in wallet UI image

Of course, this does not affect the blockchain, only UI

NOTE: the response to the request to cancel sendTransaction must contain information whether the transaction signing was cancelled or whether the user has already sent it.

@tolya-yanot
Copy link
Member Author

I think that it would be nice to implement the proposals #115 (comment) and #115 (comment) in one of the next versions of TON Connect protocol.

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

Successfully merging this pull request may close these issues.

7 participants