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

Segwit transaction format #9

Closed
12 tasks done
dakk opened this issue Aug 7, 2017 · 0 comments
Closed
12 tasks done

Segwit transaction format #9

dakk opened this issue Aug 7, 2017 · 0 comments

Comments

@dakk
Copy link
Owner

dakk commented Aug 7, 2017

The upcoming activation of segwit, push the need of segwit transaction format support

https://bitcoincore.org/en/segwit_wallet_dev/#transaction-serialization
https://bitcoin.stackexchange.com/questions/49097/what-does-a-segregated-witness-transaction-look-like

The Tx could be a structure like now, but with optional witness fields:

type Witness.t = {
	marker		: uint32;
	flag			: uint32;
	witness		: field list;
	size		: int;
}

type t = {
	hash			: Hash.t;
	version		: int32;
	txin 			: In.t list;
	txout 		: Out.t list;
	locktime		: uint32;

	witness		: Witness.t option;
	size			: int;
} [@@deriving sexp]

The witnessScript reside in a different parte of the tx, but every witnessScript is associated to one txin; could be a smart trick to inflate the wintnessScript inside the txin.

Use this: http://n.bitcoin.ninja/checktx for examples and tests

Tasks:

  • Witness abstract data-structure
  • Parsing
  • Serialization
  • Tx hash and tx size for segwit
  • Tx vsize
  • Witness tests
  • Witness tests - P2WPKH
  • Witness tests - P2WSH
  • Witness tests - P2SH(WPKH)
  • Witness tests - P2SH(WSH)
  • Witness tests - Hash and sizes
  • Block hash and block size for segwit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant