pull down to refresh
Yeah this is awesome. Not having CTV in Bitcoin is an error Bitcoin can't afford, IMHO. It's more of a question of how at this point, and I don't think it's miner contentious so mid-as-well just go with Speedy Trial again.
reply
deleted by author
Looks like he wrote this in markdown. That'll play nicely with mailing list archive subs.
reply
deleted by author
deleted by author
Introduction
OP_CHECKTEMPLATEVERIFY
(CTV) a.k.a. BIP119 2 is a proposed upgrade to Bitcoin which is being actively discussed. CTV makes possible an optimized protocol which improves DLC performance so dramatically that it solves several user experience concerns and engineering difficulties. To me this is the most compelling and practical application of CTV so I thought it's about time to share it!Present state of DLC specification
R
for each event. Let's say each event hasN
outcomes.R
from the oracle announcement and construct a set of attestation pointsS
and their corresponding payouts.N
outcomes is calculated likeS_i = R + H(R || X || outcome_i) * X
whereX
is the oracle's static key.CET_i = S1_i + S2_i + S3_i
.CET_i
is the conjunction (AND
) between the event outcomes represented byS1_i, S2_i, S3_i
.s_i
wheres_i * G = S_i
if thei
th is the outcome transpired.s_i
s from each of the attestations and combines them e.g.cet_i = s1_i + s2_i + s3_i
and usescet_i
to decrypt the CET adaptor signature encrypted byCET_i
and broadcast the transaction.Performance issues with DLCs
E * N
attestation points whereE
is the number of events you are combining andN
is the number of outcomes per event. (1 mul)C >= E * N
CET adaptor signatures and verify them. (2 mul -- or with MuSig2, 3 muls).E=20,N=2,C=2^20
. So the biggest concern for worst case performance is the adaptor signatures multiplications.committing to each CET in a tapleaf with CHECKTEMPLATEVERIFY
CET_i
and spend the coins to the CET (whose CTV hash isCET-hash
) which distributes the funds according to the contract.CET_i
which will involve a point normalisation but it still brings the computational cost per CET down from hundreds of microseconds to around 5 (per party). There will be a bit more data on chain (and a small privacy loss) in the uncooperative case but even with tens of thousands of outcomes it's only going to roughly double the virtual size of the transaction. Keep in mind the uncooperative case should hopefully be rare too esp when we are doing this in channels.getting rid of combinatorial complexity of oracle thresholds
Getting rid of the attestation point multiplication
E*N
attestion points is a small fraction of the total CET point computation.outcome_i
:outcome_i
the oracle will reveal a different linear combination ofR
andX
. However, if we still want to preserve the ability to add attestation points together to create an AND like condition for points attestations from the same oracle so we have to do:S1_i + S2_j = (i*R1 + X) + (j*R2 + X) = i*R1 + j*R2 + 2*X
S1_i + S2_j = (i*X + R1 + (j*X + R2) = (i + j)*X + R1 + R2)
S1_1 + S2_2 = S1_2 + S2_1
. Note that this collision problem also exists in the current spec and original paper[4,5] but requires a solving a hashing k-sum that should be hard to do in practice.i in 1..N
,S_1 = R + X
and each subsequent isS_i = S_{i-1} + R
and so we only need to do one addition for each attestation point.In summary
Credits
R + i*X
was broken.