marcgodard / tx-builder Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add an option for building SegWit transactions.
Sources:
Details:
// P2PKH output script
DUP HASH160 ab68025513c3dbd2f7b92a94e0581f5d50f654e7 EQUALVERIFY CHECKSIG
// P2WPKH output script (includes: a witness version 0)
0 ab68025513c3dbd2f7b92a94e0581f5d50f654e7
// To spend the Segregated Witness output:
[...]
"vin" : [{
"txid": "0627052b6f28912f2703066a912ea577f2ce4da4caa5a5fbd8a57286c345c2f2",
"vout": 0,
"scriptSig": ""
}]
[...]
"witness": "<Bob’s witness data>"
[...]
// 1. P2SH
// Includes 20-byte RIPEMD160(SHA256(script)) hash:
HASH160 54c557e07dde5bb6cb791c7a540e0a4796f5e97e EQUAL
// P2SH output being spent:
"vout": 0,
"scriptSig": “<SigA> <SigB> <2 PubA PubB PubC PubD PubE 5 CHECKMULTISIG>”,
]
// 2. P2WSH output script
// Includes a witness version (0) and 32-byte SHA256 hash of the redeem script.
0 a9b7b38d972cabc7961dbfbcb841ad4508d133c47ba87457b4a0e8aae86dbb89
// P2WSH output being spent with separate witness data
"vout": 0,
"scriptSig": “”,
]
[...]
"witness": "<SigA> <SigB> <2 PubA PubB PubC PubD PubE 5 CHECKMULTISIG>"
Transaction:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.