Giter VIP home page Giter VIP logo

Comments (4)

studyzy avatar studyzy commented on July 28, 2024

You can see example at here

from runestone.

hlee4real avatar hlee4real commented on July 28, 2024

Hey, thanks for your quick reply. I followed the example and it returns commitx and revealtx, however, when I try to broadcast it to bitcoin testnet, it returns an error:

Error validating transaction: Error running script for input 0 referencing 022c4e1b49e33d4955338a5c307e220c68720981665b572bd7b24ce85aab6663 at 1: incorrect number of witness items for version 0 witness program of length 20.

Due to my research, this error occured because the transaction hasn't signed yet, but in code, I saw a function to sign commit tx. Can you help me about this. Many thanks!

from runestone.

hlee4real avatar hlee4real commented on July 28, 2024
{
    "addresses": [
        "tb1qp290l5642zjpj0arcqrqjfnk9sm99gcxlln7am",
        "tb1pgksxr7fc8v5nufhtfq0ls8mwrx3tq2nzm8s3gn67yqsqgkgvuykspcewra"
    ],
    "block_height": -1,
    "block_index": -1,
    "confirmations": 0,
    "double_spend": false,
    "fees": 284,
    "hash": "b298e8cbfde13817d50cbe1e4f744fa1ae606ac9cc82020a037dc4eb2d492dbd",
    "inputs": [
        {
            "addresses": [
                "tb1qp290l5642zjpj0arcqrqjfnk9sm99gcxlln7am"
            ],
            "age": 2568208,
            "output_index": 1,
            "output_value": 8000,
            "prev_hash": "022c4e1b49e33d4955338a5c307e220c68720981665b572bd7b24ce85aab6663",
            "script_type": "pay-to-witness-pubkey-hash",
            "sequence": 4294967285,
            "witness": [
                "862a1fbb954daa54893f84cdf2a04218448cbf085784510be0a0962cab54142aa1b2d2f1e7c62f4ef3bc0f273ccdad43818bc9702b86093de5c6632c47a7dc10"
            ]
        }
    ],
    "opt_in_rbf": true,
    "outputs": [
        {
            "addresses": [
                "tb1pgksxr7fc8v5nufhtfq0ls8mwrx3tq2nzm8s3gn67yqsqgkgvuykspcewra"
            ],
            "script": "512045a061f9383b293e26eb481ff81f6e19a2b02a62d9e1144f5e202004590ce12d",
            "script_type": "pay-to-taproot",
            "value": 1306
        },
        {
            "addresses": [
                "tb1qp290l5642zjpj0arcqrqjfnk9sm99gcxlln7am"
            ],
            "script": "00140a8affd35550a4193fa3c0060926762c3652a306",
            "script_type": "pay-to-witness-pubkey-hash",
            "value": 6410
        }
    ],
    "preference": "low",
    "received": "2024-05-02T07:46:15.531059858Z",
    "relayed_by": "3.236.110.27",
    "size": 193,
    "total": 7716,
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 2,
    "vsize": 142
}

This is my commit TX after I decoded it

from runestone.

studyzy avatar studyzy commented on July 28, 2024

My example code is for P2TR address, your input addres is P2WPK.
for easy use, please use P2TR address as input

from runestone.

Related Issues (3)

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.