Giter Club home page Giter Club logo

guillaumelauzier / p2pkh Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

In this example, we define the public key hash as a hex string (pubkey_hash) and then create the P2PKH output script by pushing the appropriate opcodes and data chunks onto a bc::data_chunk. The resulting script is then stored in a bc::script object (p2pkh_script), which can be used to create a transaction output.

License: MIT License

C++ 100.00%
bitcoin hash p2pkh pubkey

p2pkh's Introduction

P2PKH

Pay-to-Public-Key-Hash (P2PKH) is a commonly used transaction script in Bitcoin that allows a recipient to receive bitcoins by providing their public key hash. When someone wants to send bitcoins to another person, they create a transaction that includes a P2PKH output script. The output script contains the recipient's public key hash, which is obtained by taking the RIPEMD160 hash of the SHA256 hash of the recipient's public key. When the transaction is broadcasted to the Bitcoin network and included in a block, the recipient can spend the bitcoins by providing a valid digital signature and the corresponding public key. To do so, they need to create a transaction input that references the previous transaction output and includes a P2PKH input script that contains the digital signature and the public key. The Bitcoin network then verifies that the provided signature is valid for the public key hash and that the transaction input spends the correct amount of bitcoins before including the transaction in the blockchain.

src.cpp

In this example, we define the public key hash as a hex string (pubkey_hash) and then create the P2PKH output script by pushing the appropriate opcodes and data chunks onto a bc::data_chunk. The resulting script is then stored in a bc::script object (p2pkh_script), which can be used to create a transaction output.

p2pkh's People

Contributors

guillaumelauzier avatar

Watchers

 avatar  avatar

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.