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

PaychanAndEscrowForTokens: Token-Enabled Escrows and Payment Channels support (XLS-34d) #4396

Open
wants to merge 32 commits into
base: develop
Choose a base branch
from

Conversation

dangell7
Copy link
Collaborator

@dangell7 dangell7 commented Jan 23, 2023

High Level Overview of Change

The proposed amendment to the XRPL protocol, XLS-34d: Token-Enabled Escrows and Payment Channels, would introduce changes to the ledger objects, transactions, and rpc methods to enable Escrows and PayChannels to use Trustline balances.

Context of Change

The proposed changes would include modifications to the following ledger objects;

RippleState
PayChannel
Escrow

The proposed changes would include modifications to the following transactions;

PaymentChannelCreate
PaymentChannelFund
PaymentChannelClaim
EscrowCreate

The proposed changes would include modifications to the following RPC methods;

account_lines
account_channels
account_objects
channel_authorize
channel_verify

Type of Change

  • New feature (non-breaking change which adds functionality)

Test Plan

PaychanAndEscrowForTokens unit tests are added for all core functionality features.

Future Tasks

@dangell7 dangell7 closed this Jan 23, 2023
@dangell7 dangell7 changed the title started amendment Introduce Token-Enabled Escrows and Payment Channels support (XLS-34d) Jan 23, 2023
@dangell7 dangell7 reopened this Jan 23, 2023
@intelliot intelliot changed the title Introduce Token-Enabled Escrows and Payment Channels support (XLS-34d) PaychanAndEscrowForTokens: Token-Enabled Escrows and Payment Channels support (XLS-34d) Jan 24, 2023
@dangell7 dangell7 force-pushed the icv2-squash branch 3 times, most recently from 809ca07 to 99b7700 Compare January 24, 2023 02:29
@RichardAH
Copy link
Collaborator

Wondering if @ximinez and/or @scottschurr might be able to do a review of this amendment

@ximinez
Copy link
Collaborator

ximinez commented Jan 24, 2023

Wondering if @ximinez and/or @scottschurr might be able to do a review of this amendment

I'd love to, but it'll be some time before I can get to it.

@dangell7 dangell7 force-pushed the icv2-squash branch 3 times, most recently from c6a49a4 to 02ee58b Compare January 24, 2023 22:36
@intelliot
Copy link
Collaborator

For context, what is motivating this feature addition? Who will use it?

@RichardAH
Copy link
Collaborator

RichardAH commented Jan 25, 2023

For context, what is motivating this feature addition? Who will use it?

There's a problem statement in the XLS here: XRPLF/XRPL-Standards#88 copied below for reference

The XRPL supports several types of on-ledger negotiable Instruments, namely: Escows, PayChannels and Checks. While each of these instruments is implemented as a first-class on-ledger object, only the Check object supports the use of Trustline balances. PayChannels and Escrows support only the native asset XRP. This limitation is a barrier to wider-spread use of these Instruments for reasons including:

  1. Regulatory compliance.
  2. Unwillingness to hold a counter-party-free asset (i.e. XRP).
  3. Volatility and exchange-rate risk.

XRPLF/XRPL-Standards#88

started amendment

escrow trustline code finished, untested not compiling

compiling

fix invariants for IOU escrows/paychans

prevent trustlines being spent below spendable balance

bug fixes for IOU escrows

preliminary paychan IOU support, compiling, not tested

bug fixes, testing

move all trustline lock and unlock logic to view, untested

more refactoring

compiling

debugging, bug fixes

templates

major refactor templates for trustTransfer and lock

fix logging to use journals

escrow bug fixes, escrow create/finish/cancel working

update claim serialization format

add sfLockCount and isAddable

add error message, address isAddable xrp edgecases

bug fixes

add lockedbalance and lockcount to account_lines rpc

update error handling & fix xrp issue

fix: format error

change check from xrp to native + error handle

add IC to tecUNFUNDED

add ic signClaim

fix amount bug

comment unused variable

tests

escrow tests

change error type

add paychan tests

enable test w/ features

fix account_channels resp

cont. paychan tests

escrow tests cont. + lint/clean

update rpc auth + verify

enable disallowXRP test (escrow)

paychan tests tests; rpc, disallow & abusetl

fix disalllow XRP bug

lint

fix disallow XRP tests

fix consequences test

fixup consequences test

update rpc call `value/currency/issuer`

fix paychan marker

cleanup and fix rpc call test

add gateway feature

clang-format

fix no-line bug

add pre test

fix test name

remove invariant test

clang-format

nit

clang-format

clang-format

add transfer rate

todo: fix this failing test

nit

nit

nit

update insuficient funds error

clang-format

clang-format

precision paychan test

bad currency guard

fix finalAmount + guard dest Issuer

fix final dest amount

finish tests

clang-format
Copy link
Collaborator

@shawnxie999 shawnxie999 left a comment

Choose a reason for hiding this comment

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

looks good from my pass. would appreciate others to give more indepth reviews

@intelliot
Copy link
Collaborator

@dangell7 - please confirm when your updates are complete and have been pushed to this PR

@dangell7
Copy link
Collaborator Author

@intelliot Shawn was the last one to review and he approved.

I didn't see these merge conflicts and will address them but were just waiting for another reviewer...

@RichardAH
Copy link
Collaborator

RichardAH commented Jul 27, 2023

We're closing this, for now. It will go on the Hooks sidechain instead. Perhaps it can go on mainnet in the future.

@RichardAH RichardAH closed this Jul 27, 2023
@intelliot intelliot reopened this Sep 8, 2023
@intelliot
Copy link
Collaborator

intelliot commented Sep 8, 2023

@RichardAH said it's OK to reopen this PR.

Previous comment from @dangell7 :

@shawnxie999 I'm having an issue building locally so I just dumped everything and I have to nuke my computer.

I'm not finished making your updates. I will make the thumbs up as soon as I can build locally again.

I assume those updates were finished 🤔

@dangell7 wrote:

I didn't see these merge conflicts and will address them but were just waiting for another reviewer...

Can you address the merge conflicts?

@intelliot intelliot requested review from ximinez and scottschurr and removed request for seelabs and gregtatcam September 8, 2023 16:43
@intelliot intelliot mentioned this pull request Sep 8, 2023
@dangell7
Copy link
Collaborator Author

@intelliot To my understanding all current issues and merge conflicts have been resolved.

@intelliot intelliot added this to the 2024 release milestone Sep 25, 2023
@ximinez
Copy link
Collaborator

ximinez commented Sep 28, 2023

I started an idea / pre-standard proposal over at XRPLF/XRPL-Standards#133

I know that what we have in this PR is a fully functional implementation, but I have serious qualms about it (outlined at the above link), that I would like to discuss before this PR moves forward.

This is not a veto. This solution might be the right way to go, but I'm not convinced of that.

@RichardAH
Copy link
Collaborator

Just a PSA: We're not actively promoting or defending XLS34 for merge into mainnet. We think it's the correct approach and it's what we're using on Xahau. If Ripple engineers want to (or don't want to) merge it into mainnet that's completely up to them.

@intelliot intelliot requested review from kennyzlei and removed request for ledhed2222 October 17, 2023 01:11
@outrum
Copy link

outrum commented Jan 4, 2024

Great work on XLS-34d! This functionality is essential for most XRPL tokens, in my view. Appreciating the complexities involved, I just wanted to express my support and eagerness to see this feature go live. Your efforts in pushing this forward are invaluable. Thanks for all the hard work!

@intelliot intelliot removed this from the 2.1.0 (Mar 2024) milestone Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 Needs review
Development

Successfully merging this pull request may close these issues.

None yet

10 participants