Skip to content

Increase Trust Operation #285

@JeremyRubin

Description

@JeremyRubin

One of the issues with trust lines is that when they need to be increased, it requires an out-of-band read of the current value.

This issues proposes a new operation which combines a read with a write (similar semantics to fetch_add).

What the new operation should do is to have an increment and a maximum value for the trustline. e.g.:

Operation FetchAddIncreaseTrust {
    asset a
    int increment,
    int limit,
}

The increment saturates up to the limit. Therefore, if the account exists, increment should never fail -- it can only succeed less.

If limit < the trust line's limit, nothing happens.

This makes it easier to have multiple pending payments from different parties without ever giving a user more trustline capacity than they need to have to hold the assets sent to them.

This is useful because otherwise every trustline increase before a payment sent has an inherent race condition, and every transaction with a increase and a send must happen serially otherwise. It also makes it impossible to have long standing smart contracts which pay to trustlines.

The trustline itself may also require Authorization, in which case this operation should either automatically require an Allow Trust or should be paired with an allow trust.

Opening for discussion now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    CAPRepresents an issue that requires a CAP.enhancementCAP that adds or changes functionality as opposed to a fix.needs draftThis an issue that has no corresponding draft, and as such has not entered the CAP/SEP process.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions