Git Product home page Git Product logo

bip174's People

Contributors

d-yokoi avatar dcousens avatar dependabot[bot] avatar junderw avatar motorina0 avatar muvoyantsmart avatar reardencode avatar summraznboi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bip174's Issues

Taproot Leaf Script - more than one entry

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

Won't recognize if magic number is padded with 0x00

I encountered an issue with Electrum desktop 4.0.3.
Displayed QR code with PSBT is:

  1. base43 encoded (not a problem)
  2. magic number 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)

image

Help with Release

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.