Coder Social home page Coder Social logo

Forced account_merge about stellar-protocol HOT 10 CLOSED

stellar avatar stellar commented on July 21, 2024
Forced account_merge

from stellar-protocol.

Comments (10)

MonsieurNicolas avatar MonsieurNicolas commented on July 21, 2024 1

yeah merging a trustline may mean many things depending on the asset type (in some cases you want to send back to the issuer, in others send to the destination account). I'd rather have explicit business logic to deal with this than guess at the protocol layer (and potentially cause grief).

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 21, 2024 1

I mean, right now payments really mean "Send this exact amount to account" I want a payment that is "Send at most this amount to account"

So it won't fail if there isn't enough. This is a super set of "drain balance into X account" since you can just set amount=MAX_INT

from stellar-protocol.

nullstyle avatar nullstyle commented on July 21, 2024

Shouldn't you just need 1 transaction with 4 operations?

from stellar-protocol.

bartekn avatar bartekn commented on July 21, 2024

No. Depending on a stage we're in, account may have trust lines (or not) or have credit assets (or not).

from stellar-protocol.

nullstyle avatar nullstyle commented on July 21, 2024

I don't understand why that's an issue: If they don't have trustlines, don't remove them, just do the account merge. If they have trustlines send the money to wherever they want in an operation that occurs before the account merge.

from stellar-protocol.

bartekn avatar bartekn commented on July 21, 2024

Well, we're doing this now but for more complicated processes you basically end up with bunch of transactions (and bunch of code to create them). You also need to know exact amount of asset you have to send them back and sometimes it's not possible to determine.

Let's say I'm OK with the current solution but with forced account_merge it would be just way easier.

from stellar-protocol.

nullstyle avatar nullstyle commented on July 21, 2024

What situation requires more than one transaction?


My concern is that people will not understand the ramifications of performing a forced merge. Indeed, the entire concept of account merging is something that IMO we will need to hide from end users: My hunch is that people just want to close their accounts... they don't care about the technicalities beyond "where is my money going when I close this?"

Frankly, if a developer is merging and account on behalf of an end user I think it is strictly better if we make them drain the account manually. Closing an account shouldn't be easy enough that you put at risk the certainty of what is going to happen when you close the account.


IMO a safer solution would be to build a comprehensive document titled "Every dirty little secret you need to know when closing a stellar account" or something similarly cheeky ;)

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 21, 2024

I think the issue bartek is having is that the account you are trying to merge back in can be in several states. and the merge operations have to be presigned by the client so the server can't just look at the state of the account and craft the merge (since the server doesn't have the secret)

But, I'm still not sure we should have this operation. It seems too heavy handed. I could buy having an operation that sends as much of an asset as it can rather than failing if the account doesn't have enough. I could see that being useful in a lot of contexts

from stellar-protocol.

nullstyle avatar nullstyle commented on July 21, 2024

But, I'm still not sure we should have this operation. It seems too heavy handed. I could buy having an operation that sends as much of an asset as it can rather than failing if the account doesn't have enough. I could see that being useful in a lot of contexts

A "drain balance into X account" operation?

from stellar-protocol.

jedmccaleb avatar jedmccaleb commented on July 21, 2024

Closing as is but someone could reopen with a "Send at most this amount to account" operation

from stellar-protocol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.