-
Notifications
You must be signed in to change notification settings - Fork 37
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
Endpoints needed for Atomic Swaps #302
Comments
I write the endpoints inputs and outputs here LoginThis exists and is called I also propose that we will return in the
This is so future calls (like get balance for an account can pass those params and not let the user pick them) Balanceidea: make it more generic and call this getinfo that can return balances or trxid or trxhex etc... Balance will return the balance of that account
SendSend funds to a given address (or addresses) (do we need to also specify walletId, accountId?)
Optional params to consider on the input
Spending the swap trxThis is a special case we have two options somehow build the special swap script in the wallet itself or enable the wallet to sign an input To get an idea of the complexity of building the swap spend trx look here An idea I have is that we could potentially make an api endpoint that return the swap special private key and do the signing in the dapp, and give the user extra warnings about this operation. The risk is lower because if we implement the BCIP then the private key is hardened and if leaked only open swaps are potentially compromised (assuming the attacked has the secret hash) out of the 3 options here are the inputs
Derivation of the secret hashThe secret hash need to be a random number, however if we are able to have access to the private key then we can derive the secret hash in a deterministic way (which can be useful for recovery) If we go for the option of asking for the private key this is not an issue, however otherwise we can add an endpoint to sign the session id and hash that (I think this can potentially be achieved already with the |
Another endpoint we could potentially get and then not use the send endpoint is to fetch UTXOs and then call the sign method Doing this will give the swaps dapp more flexibility |
I that I have one more requirement, there are two methods that do not require consent (no popup) However when the wallet is locked this is not possible, I suggest when those methods are called if the wallet is locked we must initiate a wallet popup to unlock the wallet. Why is it without consent? during a swap I may need to call a wallet a few times, the UX will be horrible if a user has to approve a few popups one after the other |
One more to the list |
block-core/blockcore-atomic-swaps#11
The text was updated successfully, but these errors were encountered: