Skip to content

Segregated witness support should result in significantly different fees #4

Open

Description

@dcousens

Perhaps base it off a .witness field in the inputs... with which case:

vsize of a transaction equals to 3 times of the size with original serialization, plus the size with new serialization, divide the result by 4 and round up to the next integer. For example, if a transaction is 200 bytes with new serialization, and becomes 99 bytes with marker, flag, and witness removed, the vsize is (99 * 3 + 200) / 4 = 125 with round up.

Activity

  1. self-assigned this
    on Nov 9, 2016
  2. changed the title [-]Segregated witness results in significantly different VSize calculation[/-] [+]Segregated witness results in significantly different fees[/+] on Nov 9, 2016
  3. changed the title [-]Segregated witness results in significantly different fees[/-] [+]Segregated witness should result in significantly different fees[/+] on Nov 9, 2016
  4. changed the title [-]Segregated witness should result in significantly different fees[/-] [+]Segregated witness support should result in significantly different fees[/+] on Nov 9, 2016
  5. dcousens commented on Jan 8, 2017

    @dcousens
    ContributorAuthor

    Options:

    • .witness field for each input, or
    • .prevOutScript/.prevOutType for each input

    The latter is probably better...

  6. karelbilek commented on Jun 28, 2017

    @karelbilek
    Contributor

    Hey, I will look at this soon, I am currently in need for coinselect to work on segwit :)

  7. karelbilek commented on Jun 28, 2017

    @karelbilek
    Contributor

    Which script types would like to support?

    I could take the types from here (except for NONSTANDARD)

    https://github.com/bitcoinjs/bitcoinjs-lib/blob/170328341bdcf2a22d6ee6df1df587ea4e83c8a9/src/templates/index.js#L11

  8. dcousens commented on Jun 29, 2017

    @dcousens
    ContributorAuthor

    .script.length is used now for estimation [if provided] - without it, it assumes P2PKH.

    If you're implementation can pre-sign all inputs, but with fake/blank signatures [for security], then script.length and an added reduction of byte length over the witness stack would be more than enough to do this.

  9. karelbilek commented on Jun 29, 2017

    @karelbilek
    Contributor

    Hm, but pre-signing all inputs with empty/fake privkeys will complicate things and needlessly slow down computation, when the inputs types usually have the same lengths anyway for the given type

  10. dcousens commented on Jun 30, 2017

    @dcousens
    ContributorAuthor

    Hm, but pre-signing all inputs with empty/fake privkeys will complicate things and needlessly slow down computation

    Not necessarily, it should be no different then the approach we'd be taking here (pattern match, speculate byte length impact via a fake script/witness.

  11. dcousens commented on Aug 15, 2017

    @dcousens
    ContributorAuthor

    Resolved partially by #22 (comment) - but - the virtual size calculation isn't accounted for yet?
    .witness would need to be provided?

  12. blmalone commented on Apr 12, 2019

    @blmalone

    Is this issue being worked on? :)

  13. mahnunchik commented on Jul 13, 2023

    @mahnunchik

    Any news?

  14. karelbilek commented on Jul 13, 2023

    @karelbilek
    Contributor
  15. mahnunchik commented on Jul 13, 2023

    @mahnunchik

    What's happened?

  16. junderw commented on Jul 13, 2023

    @junderw
    Member

    I am here, but this repository is not a priority for me.

    PRs and more importantly PR reviews are greatly appreciated and needed.

  17. ChrisCho-H commented on Aug 18, 2023

    @ChrisCho-H
    Contributor

    I made PR #82 regarding this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions