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

Policy: limit witness stack size #52

Closed
wants to merge 25 commits into from
Closed

Conversation

jl2012
Copy link

@jl2012 jl2012 commented Jan 26, 2016

per input total witness stack size limit <= 73 * sigop + 200

briefly tested

@maaku
Copy link

maaku commented Jan 27, 2016

... why?

There are use cases for witnesses that do things other than sigops.

@sipa
Copy link
Owner

sipa commented Jan 27, 2016

@maaku Can you give an example?

@jl2012
Copy link
Author

jl2012 commented Jan 27, 2016

@maaku that's why I left 200byte free space. Actually, the same policy could be applied to non-segwit tx too

@maaku
Copy link

maaku commented Jan 27, 2016

@sipa near-term: multiple HLTC. long-term: two-way peg, lamport signatures, script extensions.

@sipa
Copy link
Owner

sipa commented Jan 27, 2016

All the long term ones require new script functionality first, so this doesn't apply to them. What is HLTC?

@jl2012
Copy link
Author

jl2012 commented Jan 27, 2016

@sipa Hashed Timelock Contract for LN.

@maaku How many extra bytes are needed for each input? It seems only 20-32 bytes?

And this is only a policy rule, not consensus

@NicolasDorier
Copy link

I am not fond of it, it complicate the code for no good reason. Can you explain what this is trying to achieve ?
Why limiting the stack size ?

@ajtowns
Copy link

ajtowns commented Jan 30, 2016

Joseph Poon recently proposed supporting escrow with lightning via revealing 2-of-3 hash preimages. http://lists.linuxfoundation.org/pipermail/lightning-dev/2016-January/000403.html

By my rought count, the untested demo scripts come out to about 190 or 240 bytes I think (depending on whether they're 20B hash values or 32B), with two sig operations (in different OP_IF branches), and there would be an additional 113 or 137 bytes of signature data to spend it, for a total of 303 bytes or 377 bytes. I haven't looked at how nAccurateSigOpCount handles if branches, but the formula works out to 273 bytes if it only counts taken branches which isn't enough for either approach, or 346 bytes if it counts both, which would work okay, though only allows for 160 bit security rather than 256 bit.

I don't see why a limit here in addition to the standard transaction size limit is desirable?

@sipa sipa force-pushed the segwit branch 2 times, most recently from 61a90de to 2a16578 Compare February 9, 2016 19:49
@sipa sipa force-pushed the segwit branch 2 times, most recently from 909fb25 to 99c8d54 Compare March 16, 2016 17:51
@sipa sipa force-pushed the segwit branch 4 times, most recently from a88b686 to 38a8b36 Compare March 26, 2016 00:21
@jl2012 jl2012 closed this Mar 30, 2016
sipa pushed a commit that referenced this pull request Oct 1, 2021
0d624261ef Merge bitcoin-core/crc32c-subtree#2: Merge upstream
cac7ca830b Merge commit 'fa5ade41ee480003d9c5af6f43567ba22e4e17e6' into bitcoin-fork
fa5ade41ee Fix compilation warnings on ARM64 with old GCC versions. (#52)
db08d22129 Updated Travis-CI configuration. (#51)
e31619a5b7 Fix GitHub links. (#50)
7fa4c263e8 Update Travis CI config. (#49)
a3d9e6d1a4 Updated third_party/ and Travis CI config. (#48)

git-subtree-dir: src/crc32c
git-subtree-split: 0d624261ef83ab08c953c196540ed18f355add4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants