0:00
(欢快的音乐)
0:02
- 嗨,欢迎收听CD Pod特别篇。
0:14
今天我没有和Yuga一起,
0:17
而是和X4OTT的Carson和Amanda一起
0:19
出镜。
0:21
我们要尝试在新的一天做点新东西。
0:24
我们将做一个技术专题讲解,
0:26
介绍一个刚刚上线的新功能,
0:29
X4OTT对任意ERC-20代币的支持。
0:33
背景是,X4OTT一直想
0:37
支持任何任意的ERC代币,
0:42
并且它确实支持,这一点与许多链不同。
0:46
EVM上的代币难点在于
0:49
很多代币都比较老,
0:52
可能不支持最新的
0:55
基于签名的转账方式。
0:59
所以我们利用了permit来支持
1:04
基于签名的转账。
1:06
但permit的一个问题是,一旦你授权了
1:08
某人代你转账,
1:10
对方就能转移任意数量的代币。
1:14
所以Carson,我们是怎么做的,
1:17
让facilitator不能随意代表你
1:19
转账任意数量代币的呢?
1:21
- 我们写了一个叫X4OTT
1:25
to exact permit代理合约。
1:29
这个合约的作用是,
1:33
基本实现EIP-3009的保障,
1:37
但使用permit流程。
1:39
具体来说,当facilitator
1:43
使用这个合约以permit流程结算时,
1:47
除了permit原有的安全保障,
1:51
我们还强制规定了转账目的地和金额。
1:56
通过我们的permit整合和合约,
2:00
我们将permit流程
2:03
提升到了跟3009相同的安全保障。
2:08
- 这意味着你作为用户,
2:11
你不再是授权facilitator,
2:13
而是授权X4OTT的permit代理合约。
2:18
- 是的,没错。
2:19
你这时候是在授权permit代理合约。
2:23
- 然后你签署一条消息,
2:26
把它发送给facilitator,
2:28
facilitator会跟permit代理合约交互,
2:31
那个代理合约会检查支付是否
2:32
符合约定。
2:35
然后它只会按照你签署的内容
2:38
转移资金,
2:40
这样facilitator就不能随意调度你的资金,
2:41
因为这是由代理合约强制执行的。
2:44
- 但是这里还有个问题,
2:46
很多老代币只支持普通授权,
2:51
你必须把交易广播上链,
2:53
才能让对方有权代表你操作代币。
2:57
这跟我们X4OTT让操作更便捷的目标
3:02
是矛盾的,
3:05
你能说说我们怎么为用户
3:08
创造了无Gas体验,
3:10
并让它适配任意代币的吗?
3:13
- 基本上这里有两类代币。
3:15
一类是支持permit的,也就是2612代币,
3:19
这类代币内置了链上permit功能,
3:20
另一类是老旧代币,
3:23
比如普通ERC20代币如USDT,
3:28
它们不支持这种功能,
3:30
我们需要另行解决。
3:33
所以我们做了两套Gas赞助方案,
3:36
针对新代币的有EIP2612 Gas赞助扩展,
3:38
这套方案保持EIP3009流程,
3:41
用户签一个签名,
3:44
就能原子化完成permit和结算,
3:47
通过我们的合约实现。
3:49
而对于老代币,
3:52
我们采取的是不同流程,
3:54
用户得签署一个普通授权交易,
3:57
但我们不直接上链,
4:00
而是把它作为X4的payload的一部分,
4:03
当facilitator遇到这种情况,
4:08
它会先给你的账户转一点ETH,
4:12
足够你支付授权的Gas,
4:14
然后再帮你把授权交易上链,
4:18
再进行后续操作。
4:20
这样的话,
4:24
这个无Gas体验
4:26
就实现了一个三步连贯流程。
4:31
will be required.
4:33
The way that we've accomplished a GASIS flow here
4:36
is this three-step scenario
4:38
where when a client sees that extension,
4:42
they will sign an ERC20 approved,
4:45
but they do not put it on chain.
4:47
They include it as part of the X4 to payload.
4:50
And then on the facilitator side,
4:53
when it runs into this scenario,
4:56
it will send your account a little bit of ETH
4:59
just enough to cover the GAS or the approve,
5:02
and then immediately call the,
5:04
or like put your approved transaction on chain,
5:08
and then it will call so.
5:10
So it ends up being three back-to-back operations
5:13
这基本上为旧代币启用了GASIS流程
5:17
这些代币至今还没有体验过GASIS。
5:21
- 太棒了。
5:22
Amanda,你想跟我们讲讲现在看到的情况吗
5:26
现在你可以使用任何EVM代币
5:29
这适用于任何EVM链吗?
5:32
- 是的,所以你可以使用任何ERC20代币
5:36
只要它兼容任何EVM链
5:38
这个合约可以更商业化一些,
5:41
这真的很棒。
5:43
我们已经看到的人使用它的几种方式
5:46
就是他们建立了自己的生态系统
5:49
使用自己的ERC20代币支付
5:52
生态系统中的商品给用户。
5:54
还有一个,就像Carson提到的,
5:56
旧代币比如USTT,
5:59
在美国外有大规模采纳度,
6:02
你现在可以使用它们,
6:04
这就打开了一个广泛的全球市场。
6:08
机会,另一个我还没见过,
6:11
但我很好奇会不会出现的是游戏代币
6:15
因为现在你可以使用任何ERC20,
6:18
这可能是游戏代币,
6:19
并且它有免gas功能。
6:22
所以你可以直接,
6:24
用户不用感知,流程无缝,
6:26
可以购买新游戏物品、支付费用,
6:29
也可以转账。
6:30
哦,如果你是代理,
6:32
手头没有USDC,
6:34
但是有其他被资源服务器接受的代币,
6:36
你现在不必进行兑换,
6:38
也不用担心滑点问题,
6:40
或者任何不确定因素,
6:43
你可以直接使用
6:46
你的代理钱包中传递的代币,
6:47
这非常令人振奋。
6:51
是的,基本上无限可能。
6:52
- 你会说我们要飞月球吗?
6:56
(笑)
6:58
- 姐妹们。
6:59
- 去月球,我会这么说。
7:00
好了,总结一下,第一,
7:03
我们长期支持大多数链上任意代币的导出,
7:06
比如Slauna、Aptos,许多非EVM链
7:09
从一开始就支持任意代币。
7:13
而在EVM链上长期以来,
7:17
导出只支持EIP 309兼容的代币,
7:20
这是因为我们想给所有用户带来
7:22
免gas的体验。
7:27
今天我们宣布的是,
7:30
你现在可以通过我们部署的新合约
7:32
在任何EVM链上使用任何代币
7:34
享受完全的免gas体验。
7:37
这是一个完全开放权限的合约,
7:41
任何人都可以在任何链上部署,无需我们参与,
7:44
还有一个新的扩展支持
7:47
旧ERC20代币合约的初始审批的微gas赞助。
7:49
所有这些结合在一起,
7:54
让我们现在支持在任何链上的任意代币导出。
7:56
这次分享很棒。
7:58
非常感谢Amanda和Carson加入我,
8:00
这很有趣。
8:05
我们应该多做这种CDPODA上的构建更新。
8:07
- Eric?
8:10
- 谢谢邀请。
8:11
- 通过Coinbase开发者平台构建,
8:14
推动世界的链上转型。
8:17
访问我们 cvp.coinbase.com,
8:18
在X上关注我们 Coinbase Dev,
8:20
并务必在你喜欢的播客应用上留下评价。
8:22
Visit us at cvp.coinbase.com,
8:25
follow us on X at Coinbase Dev,
8:27
and be sure to leave us a review
8:29
on your favorite podcast app.
0:00
(upbeat music)
0:02
- Hey, welcome to a special edition of the CD Pod.
0:14
Today I'm not joined by Yuga, settling,
0:17
but I am joined by Carson and Amanda
0:19
from the X4OTT.
0:21
And we're gonna try this on a new day.
0:24
We're gonna do a little breakout technical track
0:26
on a new feature that we just placed
0:29
in X4OTT arbitrary ERC-20 support.
0:33
So the context here is X4OTT has always wanted
0:37
to support any arbitrary ERC, any arbitrary token.
0:42
And it does unlike many, many chains.
0:46
So the difficulty with tokens on the EVM
0:49
is that there are a lot of tokens that quite old
0:52
and they may not support a long tail
0:55
of more modern ways of doing signature based transfer.
0:59
And so we leveraged permit to enable
1:04
signature based transfer.
1:06
But the issue with permit too is that once you approve
1:08
something to transfer on your behalf,
1:10
it can transfer arbitrary amounts of token for you.
1:14
And so Carson, what did we do in order to make it
1:17
so that the facilitator can't just transfer
1:19
arbitrary amounts of tokens on your behalf?
1:21
- So we wrote a contract called the X4OTT
1:25
to exact permit to proxy contract.
1:29
And what this contract enables is essentially
1:33
the guarantees we get out of EIP-3009,
1:37
but with a permit to flow.
1:39
Specifically, this enforces that when a facilitator
1:43
uses this contract to settle with the permit to flow.
1:47
In addition to permit to security guarantees,
1:51
we are also enforcing the destination and the amount.
1:56
So with our permit to integration and our contracts,
2:00
we're able to elevate the permit to flow
2:03
to the same 3009 guarantees that we've come to love.
2:08
- And so what that means is that you as a user,
2:11
you don't approve the facilitator.
2:13
You approve the X4OTT permit proxy contract.
2:18
- Yes, that's correct.
2:19
You are approving the permit to proxy contract in this case.
2:23
- Yeah, and then you sign a message
2:26
and then you send that message to the facilitator.
2:28
The facilitator interacts with the permit
2:31
to proxy contract.
2:32
That proxy contract checks if the payment
2:35
adheres to the specification.
2:38
And then we'll only move funds in accordance
2:40
to what you've signed.
2:41
And you get that same property of the facilitator
2:44
can't arbitrarily route your funds
2:46
because it's enforced via the proxy contract.
2:51
- There's kind of this problem still though, right?
2:53
And that you need to, a lot of older tokens
2:57
only support approvals for permit.
3:02
And that means you have to broadcast
3:05
the transaction on chain to actually have that,
3:08
that whoever you're approving,
3:10
be able to move tokens on your behalf.
3:13
And so that's, of course, in contention
3:15
with our goal of X4OT of making X4OT castle
3:19
a lot of return.
3:20
And so, could you tell us a bit about
3:23
how we created the GASIS experience for users
3:28
and made it work with any possible token?
3:30
- So basically there's two types of tokens here.
3:33
There's tokens that are permit aware,
3:36
which are the 2612 tokens.
3:38
These tokens have built-in functionality
3:41
to be able to put permit on chain.
3:44
And then there's tokens that predate that,
3:47
such as generic ERC20s such as USDT,
3:49
that have no such capabilities
3:52
that we had to separately solve for.
3:54
So to do this, we have two separate
3:57
GAS sponsorship extensions.
4:00
For the newer tokens that are permit to aware,
4:03
we have an EIP2612 GAS sponsoring extension.
4:08
This gets to maintain the same EIP3009 flow
4:12
where you are signing one signature
4:14
and we're able to do both the permit and settle
4:18
atomically through our contract.
4:20
For the older tokens for the more generic ERC20s,
4:24
we had to take a different flow.
4:26
So as a sign transaction for a generic approval
4:31
will be required.
4:33
The way that we've accomplished a GASIS flow here
4:36
is this three-step scenario
4:38
where when a client sees that extension,
4:42
they will sign an ERC20 approved,
4:45
but they do not put it on chain.
4:47
They include it as part of the X4 to payload.
4:50
And then on the facilitator side,
4:53
when it runs into this scenario,
4:56
it will send your account a little bit of ETH
4:59
just enough to cover the GAS or the approve,
5:02
and then immediately call the,
5:04
or like put your approved transaction on chain,
5:08
and then it will call so.
5:10
So it ends up being three back-to-back operations
5:13
that essentially enables a GASIS flow for old tokens
5:17
that to date haven't had a GASIS experience.
5:21
- That's awesome.
5:22
Amanda, do you wanna tell us a bit about what we're seeing
5:26
now that you can use any EVM token
5:29
in this works on any EVM chain?
5:32
- Yeah, so you can use any ERC20 token
5:36
that's compatible with any EVM chain
5:38
that the contract can be more commercial-lessy,
5:41
which is pretty awesome.
5:43
A couple of the ways we've been seeing people use it already
5:46
is they've built their own ecosystem
5:49
that use their own ERC20 tokens to pay
5:52
for things on their own ecosystem to people.
5:54
Another one, like Carson mentioned,
5:56
older tokens like USTT,
5:59
which have massive adoption outside of the US,
6:02
you can now use,
6:04
and so it opens up this like broad global market.
6:08
Opportunity, another one that I haven't actually seen,
6:11
but I'm curious to see if it happens is gaming tokens
6:15
'cause now you can use any ERC20,
6:18
which could be a gaming token,
6:19
and it's got a GAS-less feature.
6:22
So you can just like,
6:24
the user doesn't have to know it's seamless
6:26
and you could buy new game items and could pay stuff,
6:29
you could send things.
6:30
Oh, and if you're like, if you're an agent
6:32
and you don't have USDC,
6:34
but you have this other token that is acceptable
6:36
by the resource server,
6:38
you now no longer have to swap it
6:40
and do like deal with slippage
6:43
and deal with any of those sort of uncertainties,
6:46
you can just use what you pass
6:47
in your agentic pocket,
6:51
which is pretty exciting.
6:52
Like, yeah, the sky is basically the limit.
6:56
- Would you say that we're going to the moon?
6:58
(laughs)
6:59
- The sister.
7:00
- To the moon, I would.
7:03
Okay, to recap, number one,
7:06
we've export to supported arbitrary tokens
7:09
on most chains for a long time,
7:13
like Slauna, Aptos, many of the non-IVM chains
7:17
have supported arbitrary tokens for since inception.
7:20
For a long time on EVM chains,
7:22
export to only supported EIP 309 compatible tokens,
7:27
and that's because we've wanted to deliver
7:30
GAS's experience to all users.
7:32
What we're announcing today is,
7:34
we now have a way for you to have a fully GAS's experience
7:37
on any EVM chain using any token
7:41
via a new contract that we've deployed.
7:44
This is a contract that is fully permissionless to deploy,
7:47
anyone can deploy it on any chain with or without us,
7:49
and a new extension which handles micro-gas sponsorship
7:54
for the initial approval of that contract
7:56
for older ERC 20 tokens.
7:58
All that comes together to make it,
8:00
so we now export on export to any token on any chain.
8:05
So, this has been a great session.
8:07
Thanks so much, Amanda and Carson for joining me,
8:10
and look, this was fun.
8:11
We should do more of these, like, build updates on CDPODA.
8:14
- Eric?
8:17
- Thanks for having us.
8:18
- Leave the world's transition on chain
8:20
by building with Coinbase developer platform.
8:22
Visit us at cvp.coinbase.com,
8:25
follow us on X at Coinbase Dev,
8:27
and be sure to leave us a review
8:29
on your favorite podcast app.
回复