Ethereum: Step by step example to redeem a P2SH output required

I can introduce you to a prime plague, how to buy the p2sh output, which is necessary for a simple transaction with a signature in Ethereum.

Okaz from information: This is a preferential and not expected primer for use in production. Obraty Unimania that Bip16 (exposure to the introduction of Bitcoin 16) will follow the most difficult realization, the attachment of the walls, which goes behind the frames.

Ethereum P2sh transaction (the hash -liner key can create some annexes with pummeties, such as the compulsory wall verification -… y:

Create new Koshelek Ethereum

Vo-First, we consume the new nose Ethereum, using the Komandy Stroki tool Eth-Wallet ':

Bash

$ Eth-Wallet Create-Newwallet

`

This will come to choose the name of the partner and the place. We use the place of smoking.

Creation of a particular key

It will be more, we consume some key for our new Koshka:

Bash

$ Eth Wallet GetNewaddress 0x …

`

This is the new addresses generally available (for example,0x …) and the corresponding closed button (for example,0x …). We will use them for creating the transaction with a signature.

Create a simple transaction with a signature

We consume a new transaction, which only sets the one with the wall. We will use follows -ups:

Json

{

"Transaction": {

"A": "0x ...", // address

"Values": 1, // entrance (1 ethhere = $ 10000 ssh)

"GAZ": 20000, // Gas limit

"Gasprice": 20, // car on the gas in Wei

"Script": "0x ..." // wall for the alignment of this transaction

}

}

We will be able to use the Komandy StrokiEth-Fullment, to create and buy an output P2SH, necessary for this transaction:

Bash

$ Eth-Wallet Newaddress 0x …

$ Eth-phulllimment-lepenting-modern = 3-transation = “0x … 1 20000 20 0x …”-TX-Index = 0 0x …

`

This is a new transaction and redeem the first exit, treated with a wall. Flag— scripting = 3includes the wall wall, which is necessary for the P2sh transaction.

Check it burns it

To keep the redemption firmly, you can use the Follow -Up Comnd:

Bash

$ Eth-phulllimment-scripting-modern-moding = 0-Transation = “0x … 1 20000 20 0x …” Your_Transection_hash “

`

This is a precipitate firmly, the proverbial transaction.

Note. You have to changeYour_transotion_hash ‘on a factual transactional hand, one collected by your dwarf.

METAMASK REACT

Leave a Comment

Your email address will not be published. Required fields are marked *