bitcoinjs / bip174 Goto Github PK
View Code? Open in Web Editor NEWA BIP174 compatible partial Transaction encoding library.
License: MIT License
A BIP174 compatible partial Transaction encoding library.
License: MIT License
Is leafHashes
a required parameter for TapBip32Derivation? If I'm using the key spend script.
https://github.com/bitcoinjs/bip174/blob/master/src/lib/interfaces.d.ts#L98
These four should probably be exported...
KeyValue,
PsbtGlobal,
PsbtInput,
PsbtOutput,
Since PSET in Elements is based on that we are creating this repo in our organization, but happy to transfer here after we make first implementation
Original Request here:
Also removed TransactionInputAdder
& TransactionOutputAdder
The PR for this issue should be merged only after the (dependent) bitcoinjs-lib PR is merged bitcoinjs/bitcoinjs-lib#1655
Bitcoin core fails with the message 'TX decode failed extra data after PSBT' when trying to parse a psbt with no inputs or outputs. This is because Bitcoin Core expects the input and output maps to exclude the separator when those sections do not contain any data.
Are there any plans on the roadmap to introduce the following BIP174 input types:
Hash locks - PSBT_IN_RIPEMD160, PSBT_IN_SHA256, PSBT_IN_HASH160, and PSBT_IN_HASH256
Time locks - PSBT_IN_REQUIRED_TIME_LOCKTIME and PSBT_IN_REQUIRED_HEIGHT_LOCKTIME
I have a question about the Taproot Leaf Script
from BIP371:
Taproot Leaf Script | PSBT_IN_TAP_LEAF_SCRIPT = 0x15 | The control block for this leaf as specified in BIP 341. The control block contains the merkle tree path to this leaf. | <script> <8-bit uint> | The script for this leaf as would be provided in the witness stack followed by the single byte leaf version. Note that the leaves included in this field should be those that the signers of this input are expected to be able to sign for. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. Finalizers should remove this field after PSBT_IN_FINAL_SCRIPTWITNESS is constructed. |
---|
In this libs the filed is defined as a list: tapLeafScript?: TapLeafScript[];
However, when spending a taproot UTXO via script-path, only one leaf
will be chosen.
I don't see a scenario where two or more tapLeafScript
can be used, am I missing something? How would the finalizer know which one to choose?
Related to: bitcoinjs/bitcoinjs-lib#1742 (comment)
cc: @brandonblack
See bitcoin/bips#849 for details.
Not sure how to deal with the private parts in a way that makes it easy for others to extend (we won't be extending any of them for the main lib, but others might want to.
I encountered an issue with Electrum desktop 4.0.3.
Displayed QR code with PSBT is:
0x70736274
("psbt") is padded with 0x00
.Why? I don't know, but if you throw it in bitcoinjs as is - it will choke.
I wrote simple unpad function, but I have a feeling that something is wrong.
Example:
const Base43 = require('electrum43');
const bitcoin = require('bitcoinjs-lib');
function unpadHex(hex) {
const index = hex.indexOf('70736274')
if (index !== -1) {
return hex.substr(index);
}
return hex;
}
const hex = Base43.decode('8+065FQS++FH76-QX$/RI8KR6O*V+WR-I0FH.9B49H1+L6I5N1JJ$M+P:3AH:QM2QUFSRR2D1XFX+I2:WTTG3F2HL4P02O2+6JE8VYJNXP:EPJ6KPMHQEJO-I/W.6*ESN:YC6FZ24PJS/QRU0YEAKSZAZM8:$7$HI7UKPG+H:+BNRO20QPOOCI8P45/TNGX-QR.X0P*WP0TAGCHMMO-UGONFLCG2QMMIA$GU6HPNI.9TK2+X99L7GLD0$OHSX2N55/1.X8ZCRH.-06B8L+6A865PIWM8Q.*8BLD2/AY+1E2F-FH6VD+JFZC*-G*IDZQ/U-8G0UOGYV1GA6BC1N.X95R:E12L987Q$TG61X4+SR4SO*IG083GH4L77DF6FL-JAFDX/W5BR4.I*$3S*9CDIW0Z4MXWJE-R9TP-OU3T$L0RHXXV885$GJ$VMOP6DX700GU7CASZGM:-XZQ+QSFXUOE:P/OKNUEIBT.BV8G.V5GRDQ3DT-W5*L4GHD-X2WFV9940YL:4LCTAWQDL..GAD9X6H:ZU064-5MUBKG0O20ZY8FV0RX+O7IL3T3YL0CKGLYZQUYXB+.F2JNN4MV83/V70UWZA6AGSU5SVSJMYXN7RRO02IXX8*QBDCYJU2G*N7+U');
const unpaddedHex = unpadHex(hex);
bitcoin.Psbt.fromHex(unpaddedHex);
(same on runkit: https://runkit.com/overtorment/5f805f125ba08e001c32f318 )
screenshot: (slightly different qr)
hi,
I just noticed that bip174 is scheduled for release sometime in September. Do you need help writing out this library? I would love to help if possible.
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.