Defi Token Exposed as Pump and Dump ... - news.bitcoin.com

BIP 199 HTLC initial stack state

Hey fellow bitcoiners and redditors

I'm trying to understand how HTLCs (Hashed Time-Locked Contracts) can be implemented in Bitcoin and BIP-199 turned out to be the best resource for that purpose.

TL;DR
Question answered!
  1. Does the stack need to feature the secret/image twice in the OP_IF case? => call the script with [pubKey, signature, 1]
  2. How can the OP_ELSE flow ever be executed successfully (since this requires the stack to be empty, but [pubKey, signature] are required for OP_CHECKSIG at the very end of the script )? => call the script with [pubKey, signature, 0]

Full story
This is the example HTLC script I copied from BIP-199:
OP_IF
[HASHOP] OP_EQUALVERIFY OP_DUP OP_HASH160
OP_ELSE
[TIMEOUTOP] OP_DROP OP_DUP OP_HASH160
OP_ENDIF
OP_EQUALVERIFY
OP_CHECKSIG

IF-Case (seller can claim the buyers deposited BTCs)
TL;DR: detailed debug log of this path. Question: Can I avoid providing the preimage twice?

Before running this script, the preimage should be known and the stack should looks:
preimage
preimage
pubKey
signature

  • So since the stack is not empty, it will jump into the OP_IF clause.
    • the OP_IF will pop the top value => stack is now: [preimage, pubKey, signature]
  • [HASHOP] will hash the preimage
    • the preimage on the stack will, be replaced by the image => stack: [image, pubKey, signature]
  • digest (a synonym for image) will be pushed
    • => stack: [image, image pubKey, signature]
  • OP_EQUALVERIFY checks the two top items for equality: image == image => true
    • ...and removes them, if they are equal => stack: [pubKey, signature]
  • OP_DUP will duplicate the pubKey, => stack: [pubKey, pubKey, signature]
  • OP_HASH160 will double-hash the pubKey => stack: [p2pkhAddress, pubKey, signature]
  • represents the p2pkhAddress => stack: [p2pkhAddress, p2pkhAddress, pubKey, signature]
  • OP_EQUALVERIFY checks the two top items for equality: p2pkhAddress == p2pkhAddress => true
    • ...and removes them, if they are equal => stack: [pubKey, signature]
  • OP_CHECKSIG checks the signature
  • Done, all fine!
  • Question: This flow requires the secret to be on the stack twice before starting the script; Can I avoid that somehow?

ELSE-Case (buyer claims refund of his/her deposited BTCs)
Since the script runs an OP_CHECKSIG at the very end. This means the stack has to contain at least [pubKey, signature] before the execution pointer moves to OP_IF. However, OP_IF returns true "If the top stack value is not False". So how can the script possibly ever execute the OP_ELSE flow?

Disclaimer
  • My mother tongue is not English, please forgive me any mistakes. :)
  • I'm just getting started with BTC scripting, please forgive me any noob mistakes.
  • I also searched the whole stackexchange/search engine/reddit/github universum for this issue, obivously without success.
PS - buy Bitcoin :)
submitted by redditeraya to Bitcoin [link] [comments]

YouTube Delmenews - YouTube a-ha - Take On Me (Live From MTV Unplugged) - YouTube Payjoin/P2EP - Uma nova era de Privacidade no Bitcoin 8-BitRyan - YouTube

Morgan Stanley Investment Management's chief strategist and head of emerging markets has recommended bitcoin as an alternative investment to stocks amid central banks' massive money printing policies. Hashop.io guarantees daily payouts and no additional fees except the maintenance fee. The user is required to make a one-time payment that implies a 2-year contract. The company accepts credit cards, wire transfer and Bitcoin payments via Bitpay, BIPS and Coinbase. Hashop.io has an on-going discount system. In addition according to the company’s promotional scheme, the users can receive a ... From Bitcoin Wiki. Jump to: navigation, search. This page describes a BIP (Bitcoin Improvement Proposal). Please see BIP 2 for more information about BIPs and creating them. Please do not just create a wiki page. Please do not modify this page. This is a mirror of the BIP from the source Git repository here. BIP: 197 Layer: Applications Title: Hashed Time-Locked Collateral Contract Author ... Hashop.io guarantees daily payouts and no additional fees except the maintenance fee. The user is required to make a one-time payment that implies a 2-year contract. The company accepts credit cards, wire transfer and Bitcoin payments via Bitpay, BIPS and Coinbase. Hashop.io has an on-going discount system. In addition according to the company’s promotional scheme, the users can receive a ... Hashop.IO; Hashrate; Hashra Astro; Hashra Astro Warp 3; Hashra Moonraker 1THS; Hashra Moonraker 2THS; Hashra Moonraker 3THS ; Hash Exchange; Helena Bitcoin Mining; HHTT; Higher difficulty pooled mining; HIS R9 390 (30 Mh/s for Ethash) Honest Mining; Horizen; I. IBeLink DM384M; IceDrill; Ice Rock Mining ICO; ICoin IEO; INNO3D GTX 760 (9 Mh/s for Ethash) Is bitcoin mining profitable; J. Jonny ...

[index] [41016] [11164] [31326] [30062] [748] [15380] [29699] [36336] [19041] [5232]

YouTube

Visit my website - http://www.mjlorton.com/ PCBWay SMT Service only $30 with Quick Turnaround Time https://www.pcbway.com/ ----- Cli... Delmenews.de ist das lokale Nachrichtenportal für die Stadt Delmenhorst bei Bremen. Jeden Tag gibt es aktuelle Meldungen aus der kreisfreien Stadt. Der Delme... Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. Entenda como funciona o Payjoin/P2EP, a forma de quebrar as heurísticas de análise da blockchain de maneira simples, fácil e econômica. Veja também como você... Welcome to my channel, my name is Ryan! You can expect to see a variety of gaming content based around just about every genre out there! If this is your thin...

#