<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OneEyed</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=OneEyed"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/OneEyed"/>
	<updated>2026-05-13T22:52:27Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Payment_methods&amp;diff=29530</id>
		<title>Payment methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Payment_methods&amp;diff=29530"/>
		<updated>2012-08-07T13:37:38Z</updated>

		<summary type="html">&lt;p&gt;OneEyed: Add SEPA transfer information and put it in right place&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When trading bitcoins for national fiat currencies, one issue that frequently comes up is the mismatch between the hardness (non-reversibility) of bitcoin, and the softness (reversibility) of many of the fiat-currency payment methods. This page lists a number of payment methods, hardness ratings, and more detailed info in the notes field.&lt;br /&gt;
&lt;br /&gt;
Hardness goes from 0 (extremely soft) to 10 (completely non-reversible).&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid #c6c9ff; border-collapse: collapse;&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;10&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|- style=&amp;quot;text-align: center; background-color: #f0f0ff;&amp;quot;&lt;br /&gt;
! Method !! Currencies !! Hardness || Notes&lt;br /&gt;
|-&lt;br /&gt;
| [[Bank wire]] || Various || 10 || Very good match for trading bitcoin.  Quick (but expensive) transfers that are not reversible.&lt;br /&gt;
|-&lt;br /&gt;
| Euro SEPA transfer || EUR || 10 || Non-reversible, usually free wire transfer between European banks. Cleared in one working day after the transaction is done.&lt;br /&gt;
|-&lt;br /&gt;
| [[Liberty Reserve]] || EUR, USD || 10 || Very good match for trading bitcoin. However, it is difficult to get LR funded - it is only possible through third-party exchangers.&lt;br /&gt;
|-&lt;br /&gt;
| Webmoney || USD, RUB, BYR, EUR, XAU || 10 || Very good match for trading bitcoin. Requires funding by bank wire though, which may be expensive for small amounts.&lt;br /&gt;
|-&lt;br /&gt;
| [[PayPal]] - regular || Most world currencies || 0 || Extremely easy to charge back. Also, since trading bitcoin is against their ToS, good luck disputing the chargeback. Do not use.&lt;br /&gt;
|-&lt;br /&gt;
| Paypal - personal || Most world currencies || 1-5 || If funded via bank, requires person to dispute the ACH, which may be more arduous. If funded via credit card, requires person to dispute the CC charge, which is pretty easy. Since there&#039;s no way to tell what the funding source was... it&#039;s a gamble. Also, if paypal account is reported stolen, paypal will probably attempt to claw back the money.&lt;br /&gt;
|- &lt;br /&gt;
| Paypal - masspay || Most world currencies || 7 || Mass pay requires funding from paypal balance. Generally much harder to reverse, but not impossible. Probably your biggest worry here is an actual stolen account.&lt;br /&gt;
|- &lt;br /&gt;
| [[Dwolla]] || USD || 3? || Since Dwolla amounts are funded via ACH, Dwolla will reverse payments if the funds were the result of fraud.  Additionally, Dwolla&#039;s Terms and Conditions now state that peyments received are subject to chargebacks as the result of their internal dispute resolution processK&amp;lt;ref&amp;gt;[http://www.bitcoinmoney.com/post/8067352221 Dwolla&#039;s New Terms: &amp;quot;receiving party may be subject to chargebacks&amp;quot;]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[Serve]]|| USD || 0 || Extremely easy to charge back.&lt;br /&gt;
|-&lt;br /&gt;
| [[AlertPay]]|| Many currencies || 1 || Because payment may be made using a credit card a charge back is easy.  Doing so however will cause the account to be closed.&lt;br /&gt;
|-&lt;br /&gt;
| [[Moneybookers]] || || 0 || Chargebacks are possible.  Accounts have been terminated when this payment method was used for a Bitcoin trade.&lt;br /&gt;
|-&lt;br /&gt;
| Neteller || || ||&lt;br /&gt;
|-&lt;br /&gt;
| Western Union Money Transfer || || 9 || A money transfer can be stopped but once funds are withdrawn as cash there&#039;s little risk&amp;lt;ref&amp;gt;[http://www.ehow.com/how_8059315_stop-payment-via-western-union.html How to Stop Payment Via Western Union]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| Money Order || || 5 || A money order can be lost or stolen and there are procedures for reporting that.  Losses could occur even weeks after the check has cleared&amp;lt;ref&amp;gt;[http://www.ehow.com/how_7319971_stop-payment-money-order.html How to Stop Payment on a Money Order]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[MoneyPak]] || USD || 7 || MoneyPaks are reversible if claimed stolen. There have been reports where the party attempting to redeem a MoneyPak number has been asked to provide a copy of the receipt used to purchase the MoneyPak. Ask for a copy of the receipt when accepting MP to protect yourself.&lt;br /&gt;
|- &lt;br /&gt;
| Personal check || Any currency || 5 || At least in the USA, once a check clears, it is hard to claw back except when fraud is alleged.&lt;br /&gt;
|-&lt;br /&gt;
| Bank ACH || USD || 5 || Sometimes referred to a type of ACH transaction, a direct deposit. Though not very easily, ACH can actually be clawed back if the transaction was the result of fraud.&lt;br /&gt;
|-&lt;br /&gt;
| Cash in mail || Any currency || 10 || No chargebacks, obviously. Just check for counterfeit paper. &lt;br /&gt;
|-&lt;br /&gt;
| Cash at bank || Any currency || n/a || Some exchanges (e.g., [[Virtex]] and OTC traders accept cash deposited to an account at a bank.  &lt;br /&gt;
|-&lt;br /&gt;
| Check at bank || Any currency || n/a || Some exchanges accept a check deposited to an account at a bank.&lt;br /&gt;
|-&lt;br /&gt;
| Credit card || Any currency || 0 || Dead easy to charge back&amp;lt;ref&amp;gt;[http://blog.unibulmerchantservices.com/visa-chargeback-reason-codes-and-time-limits Visa Chargeback Reason Codes and Time Limits]&amp;lt;/reF&amp;gt;, &amp;lt;ref&amp;gt;[http://blog.unibulmerchantservices.com/mastercard-chargeback-reason-codes MasterCard Chargeback Reason Codes]&amp;lt;/ref&amp;gt;. Do not use.&lt;br /&gt;
|-&lt;br /&gt;
| [[TransferWise]] || GBP to EUR ||  || &lt;br /&gt;
|-&lt;br /&gt;
| Intra-bank transfer || || ||&lt;br /&gt;
|-&lt;br /&gt;
| [[Popmoney]] ACH || USD || 5 || Since Popmoney transfers occur via ACH, Popmoney will reverse payments if the funds were the result of fraud. &lt;br /&gt;
|-&lt;br /&gt;
| [[ING Person2Person]] || USD || 5 || Since Person2Person transfers occur via ACH, ING will reverse payments if the funds were the result of fraud. &lt;br /&gt;
|-&lt;br /&gt;
| [[Pingit]] || UK || 5 || Barclays will reverse payments if the funds were the result of fraud. &lt;br /&gt;
|-&lt;br /&gt;
| Chase QuickPay || USD || 3 || Chase has reversed legitimate transactions as the result of anti-fraud measures&amp;lt;ref&amp;gt;[http://forum.bitcoin.org/index.php?topic=11494.0 Chase QuickPay NOT RECOMMENDED]&amp;lt;/ref&amp;gt; requiring the sender to be trusted to re-pay.  The sender can also request a reversal after submitting an affidavit alleging that fraud occurred.&lt;br /&gt;
|-&lt;br /&gt;
| AliPay || CNY || n/a || Though reports of reversed AliPay payments can be found on the Internet, the operator of [[Bitcoinica]] asserts that AliPay transaction are &amp;quot;non-reversible&amp;quot;&amp;lt;ref&amp;gt;[http://bitcointalk.org/index.php?topic=65003.msg763730#msg763730 Bitcoinica now supports Alipay deposit!]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| [[UKash]] || many || n/a || A cash-based voucher system. &lt;br /&gt;
|-&lt;br /&gt;
| [[CashU]] || many || n/a || A cash-based prepaid card / redeemable code.&lt;br /&gt;
|-&lt;br /&gt;
| Bitcoin || BTC || 10 || While the bitcoin network has no concept of a bitcoin transaction being reversed, there could be the possibility of an exchange or merchant refusing to accept a bitcoin for various reasons (e.g., funds were stolen).&lt;br /&gt;
|-&lt;br /&gt;
| [[Redeemable code]] || USD, BTC || ? || These are generally bearer instruments so the &amp;quot;hardness&amp;quot; would seem to approach a 10 however each exchange that issues a redeemable code may have its own policy.  As these are a fairly new tool, it is not known if any exchanges will refuse to honor a code of their own (e.g., customer claims that the code had been stolen).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Secure Trading]]&lt;br /&gt;
* [[Digital currency]]&lt;br /&gt;
* [[:Category:Money transmitters|Money transmitters]]&lt;br /&gt;
* [http://stakeventures.com/articles/2012/03/07/the-may-scale-of-money-hardness-and-bitcoin The May Scale of Money Hardness and BitCoin]&lt;br /&gt;
* [[Mobile Payment Apps]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Financial]]&lt;/div&gt;</summary>
		<author><name>OneEyed</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:OP_CHECKSIG&amp;diff=29409</id>
		<title>Talk:OP CHECKSIG</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:OP_CHECKSIG&amp;diff=29409"/>
		<updated>2012-08-04T18:16:04Z</updated>

		<summary type="html">&lt;p&gt;OneEyed: /* Code samples and raw dumps */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Redundant step?=&lt;br /&gt;
&lt;br /&gt;
Under &amp;quot;How it works&amp;quot;, we have steps 2 and 6:&lt;br /&gt;
&lt;br /&gt;
- 2. A new subscript is created from the instruction from the most recent OP_CODESEPARATOR to the end of the script. If there is no OP_CODESEPARATOR the entire script becomes the subscript (hereby referred to as subScript)&lt;br /&gt;
&lt;br /&gt;
- 6. All OP_CODESEPARATORS are removed from subScript&lt;br /&gt;
&lt;br /&gt;
However, doesn&#039;t step 6 seem redundant? [[User:Vegard|Vegard]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Answer: ([[User:sirk390|sirk390]])&lt;br /&gt;
The comment for step 6. in the bitcoin sources help to understand this (script.cpp:882)&lt;br /&gt;
       // In case concatenating two scripts ends up with two codeseparators,&lt;br /&gt;
       // or an extra one at the end, this prevents all those possible incompatibilities. &lt;br /&gt;
In step 2, only OP_CODESEPARATOR before OP_CHECKSIG are removed. In step OP_CODESEPARATOR after OP_CHECKSIG are also removed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= More info =&lt;br /&gt;
&lt;br /&gt;
Maybe add short description from here [[Contracts#Theory]] for all SIGHASH_*? [[User:Mad|Mad]]&lt;br /&gt;
&lt;br /&gt;
= Code samples and raw dumps = &lt;br /&gt;
&lt;br /&gt;
I think there is some error in the section &amp;quot;Code samples and raw dumps&amp;quot; - The input script is:&lt;br /&gt;
&lt;br /&gt;
&amp;quot;04 11 db 93 e1 dc db 8a &lt;br /&gt;
01 6b 49 84 0f 8c 53 bc &lt;br /&gt;
1e b6 8a 38 2e 97 b1 48 &lt;br /&gt;
2e ca d7 b1 48 a6 90 9a &lt;br /&gt;
5c b2 e0 ea dd fb 84 cc &lt;br /&gt;
f9 74 44 64 f8 2e 16 0b &lt;br /&gt;
fa 9b 8b 64 f9 d4 c0 3f &lt;br /&gt;
99 9b 86 43 f6 56 b4 12 &lt;br /&gt;
a3&lt;br /&gt;
ac&amp;quot;&lt;br /&gt;
&lt;br /&gt;
and should probably be &amp;quot;304402204e45e16932b8af514961a1d3a1a25fdf3f4f7732e9d624c6c61548ab5fb8cd410220181522ec8eca07de4860a4acdd12909d831cc56cbbac4622082221a8768d1d0901&amp;quot;, at least according to the Block Explorer:&lt;br /&gt;
http://blockexplorer.com/rawtx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16&lt;br /&gt;
--[[User:ThePiachu|ThePiachu]] 22:46, 21 March 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
:Indeed, I had noticed the same problem. I have fixed the example.&lt;br /&gt;
:[[User:OneEyed|OneEyed]] ([[User talk:OneEyed|talk]]) 18:16, 4 August 2012 (GMT)&lt;/div&gt;</summary>
		<author><name>OneEyed</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=OP_CHECKSIG&amp;diff=29408</id>
		<title>OP CHECKSIG</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=OP_CHECKSIG&amp;diff=29408"/>
		<updated>2012-08-04T18:13:35Z</updated>

		<summary type="html">&lt;p&gt;OneEyed: /* Code samples and raw dumps */ Fix input script, which was by mistake a copy of output 1&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;OP_CHECKSIG is [[Script|script]] opcode used to verify that the signature for a tx input is valid. OP_CHECKSIG expects two values to be on the stack, these are, in order of stack depth, the public key and the signature of the script. These two values are normally obtained by running the scriptSig script of the transaction input we are attempting to validate. After the scriptSig script is run the script is deleted but the stack is left as is, and then then scriptPubKey script from the previous transaction output that is now being spent is run, generally concluding in an OP_CHECKSIG. &lt;br /&gt;
&lt;br /&gt;
The standard scriptPubKey checks that the public key (actually a hash of) is a particular value, and that OP_CHECKSIG passes.&lt;br /&gt;
&lt;br /&gt;
For normal transaction inputs if the creator of the current transaction can successfully create a ScriptSig signature that uses the right public key for the ScriptPubKey of the transaction output they are attempting to spend, that transaction input is considered valid. &lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
In addition to the script code itself and the stack parameters, to operate OP_CHECKSIG needs to know the current transaction, the current transaction input, and the current hashtype (discussed later)&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
[[File:Bitcoin_OpCheckSig_InDetail.png|thumb|right|Signature verification process using SIGHASH_ALL]]&lt;br /&gt;
# the public key and the signature are popped from the stack, in that order.&lt;br /&gt;
# A new subscript is created from the instruction from the most recently parsed OP_CODESEPARATOR (last one in script) to the end of the script. If there is no OP_CODESEPARATOR the entire script becomes the subscript (hereby referred to as subScript)&lt;br /&gt;
# The sig is deleted from subScript.&lt;br /&gt;
# All OP_CODESEPARATORS are removed from subScript&lt;br /&gt;
# The hashtype is removed from the last byte of the sig and stored&lt;br /&gt;
# A deep copy is made of the current transaction (hereby referred to txCopy)&lt;br /&gt;
# The scripts for all transaction inputs in txCopy are set to empty scripts&lt;br /&gt;
# The script for the current transaction input in txCopy is set to subScript&lt;br /&gt;
&lt;br /&gt;
Now depending on the hashtype various things can happen to txCopy, these will be discussed individually&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Hashtype Values (from script.h):&#039;&#039;&#039;&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Name !! Value&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_ALL || 0x00000001&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_NONE || 0x00000002&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_SINGLE || 0x00000003&lt;br /&gt;
|-&lt;br /&gt;
| SIGHASH_ANYONECANPAY || 0x00000080&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Hashtype SIGHASH_ALL (default) ===&lt;br /&gt;
&lt;br /&gt;
No special handling occurs in the default case.  Think of this as &amp;quot;sign &#039;&#039;&#039;all&#039;&#039;&#039; of the outputs.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Hashtype SIGHASH_NONE ===&lt;br /&gt;
&lt;br /&gt;
# The output of txCopy is set to a vector of zero size.&lt;br /&gt;
# All other inputs aside from the current input in txCopy have their nSequence index set to zero&lt;br /&gt;
&lt;br /&gt;
Think of this as &amp;quot;sign &#039;&#039;&#039;none&#039;&#039;&#039; of the outputs-- I don&#039;t care where the bitcoins go.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Hashtype SIGHASH_SINGLE ===&lt;br /&gt;
&lt;br /&gt;
# The output of txCopy is resized to the size of the current input index+1&lt;br /&gt;
# All other txCopy outputs aside from the output that is the same as the current input index are set to a blank script and a value of (long) -1;&lt;br /&gt;
# All other txCopy inputs aside from the current input are set to have an nSequence index of zero&lt;br /&gt;
&lt;br /&gt;
Think of this as &amp;quot;sign &#039;&#039;&#039;one&#039;&#039;&#039; of the outputs-- I don&#039;t care where the other outputs go.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Hashtype SIGHASH_ANYONECANPAY ===&lt;br /&gt;
&lt;br /&gt;
# The txCopy input vector is resized to a length of one&lt;br /&gt;
# The current input is set as the first and only member of this vector&lt;br /&gt;
&lt;br /&gt;
This can be combined with ALL/SINGLE/NONE. Think of this as &amp;quot;Let other people add inputs to this transaction, I don&#039;t care where the rest of the bitcoins come from.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Final signature ==&lt;br /&gt;
&lt;br /&gt;
An array of bytes is constructed from the serialized txCopy + four bytes for the hash type. This array is sha256 hashed twice, then the public key is used to to check the supplied signature against the hash. &lt;br /&gt;
&lt;br /&gt;
== Return values ==&lt;br /&gt;
&lt;br /&gt;
OP_CHECKSIG will push true to the stack if the check passed, false otherwise.&lt;br /&gt;
OP_CHECKSIG_VERIFY leaves nothing on the stack but will cause the script eval to fail immediately if the check does not pass.&lt;br /&gt;
&lt;br /&gt;
== Code samples and raw dumps ==&lt;br /&gt;
&lt;br /&gt;
Taking the first transaction in Bitcoin which is in block number 170, we would get after serialising the transaction but before we hash+sign (or verify) it:&lt;br /&gt;
&lt;br /&gt;
* http://blockexplorer.com/block/00000000d1145790a8694403d4063f323d499e655c83426834d4ce2f8dd4a2ee&lt;br /&gt;
* http://blockexplorer.com/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16&lt;br /&gt;
&lt;br /&gt;
See also [https://gitorious.org/libbitcoin/libbitcoin libbitcoin] for code samples.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
01 00 00 00              version&lt;br /&gt;
01                       number of inputs (var_uint)&lt;br /&gt;
&lt;br /&gt;
input 0:&lt;br /&gt;
c9 97 a5 e5 6e 10 41 02  input address hash&lt;br /&gt;
fa 20 9c 6a 85 2d d9 06 &lt;br /&gt;
60 a2 0b 2d 9c 35 24 23 &lt;br /&gt;
ed ce 25 85 7f cd 37 04&lt;br /&gt;
00 00 00 00              input index&lt;br /&gt;
&lt;br /&gt;
48                       size of script (var_uint)&lt;br /&gt;
47                       push 71 bytes to stack&lt;br /&gt;
30 44 02 20 4e 45 e1 69&lt;br /&gt;
32 b8 af 51 49 61 a1 d3&lt;br /&gt;
a1 a2 5f df 3f 4f 77 32&lt;br /&gt;
e9 d6 24 c6 c6 15 48 ab&lt;br /&gt;
5f b8 cd 41 02 20 18 15&lt;br /&gt;
22 ec 8e ca 07 de 48 60&lt;br /&gt;
a4 ac dd 12 90 9d 83 1c&lt;br /&gt;
c5 6c bb ac 46 22 08 22&lt;br /&gt;
21 a8 76 8d 1d 09 01&lt;br /&gt;
ff ff ff ff              sequence&lt;br /&gt;
&lt;br /&gt;
02                       number of outputs (var_uint)&lt;br /&gt;
&lt;br /&gt;
output 0:&lt;br /&gt;
00 ca 9a 3b 00 00 00 00  amount = 10.00000000&lt;br /&gt;
43                       size of script (var_uint)&lt;br /&gt;
script for output 0:&lt;br /&gt;
41                       push 65 bytes to stack&lt;br /&gt;
04 ae 1a 62 fe 09 c5 f5 &lt;br /&gt;
1b 13 90 5f 07 f0 6b 99 &lt;br /&gt;
a2 f7 15 9b 22 25 f3 74 &lt;br /&gt;
cd 37 8d 71 30 2f a2 84 &lt;br /&gt;
14 e7 aa b3 73 97 f5 54 &lt;br /&gt;
a7 df 5f 14 2c 21 c1 b7 &lt;br /&gt;
30 3b 8a 06 26 f1 ba de &lt;br /&gt;
d5 c7 2a 70 4f 7e 6c d8 &lt;br /&gt;
4c &lt;br /&gt;
ac                       OP_CHECKSIG&lt;br /&gt;
&lt;br /&gt;
output 1:&lt;br /&gt;
00 28 6b ee 00 00 00 00  amount = 40.00000000&lt;br /&gt;
43                       size of script (var_uint)&lt;br /&gt;
script for output 1:&lt;br /&gt;
41                       push 65 bytes to stack&lt;br /&gt;
04 11 db 93 e1 dc db 8a  &lt;br /&gt;
01 6b 49 84 0f 8c 53 bc &lt;br /&gt;
1e b6 8a 38 2e 97 b1 48 &lt;br /&gt;
2e ca d7 b1 48 a6 90 9a&lt;br /&gt;
5c b2 e0 ea dd fb 84 cc &lt;br /&gt;
f9 74 44 64 f8 2e 16 0b &lt;br /&gt;
fa 9b 8b 64 f9 d4 c0 3f &lt;br /&gt;
99 9b 86 43 f6 56 b4 12 &lt;br /&gt;
a3                       &lt;br /&gt;
ac                       OP_CHECKSIG&lt;br /&gt;
&lt;br /&gt;
00 00 00 00              locktime&lt;br /&gt;
01 00 00 00              hash_code_type (added on)&lt;br /&gt;
&lt;br /&gt;
result =&lt;br /&gt;
01 00 00 00 01 c9 97 a5 e5 6e 10 41 02 fa 20 9c 6a 85 2d d9 06 60 a2 0b 2d 9c 35 &lt;br /&gt;
24 23 ed ce 25 85 7f cd 37 04 00 00 00 00 43 41 04 11 db 93 e1 dc db 8a 01 6b 49 &lt;br /&gt;
84 0f 8c 53 bc 1e b6 8a 38 2e 97 b1 48 2e ca d7 b1 48 a6 90 9a 5c b2 e0 ea dd fb &lt;br /&gt;
84 cc f9 74 44 64 f8 2e 16 0b fa 9b 8b 64 f9 d4 c0 3f 99 9b 86 43 f6 56 b4 12 a3 &lt;br /&gt;
ac ff ff ff ff 02 00 ca 9a 3b 00 00 00 00 43 41 04 ae 1a 62 fe 09 c5 f5 1b 13 90 &lt;br /&gt;
5f 07 f0 6b 99 a2 f7 15 9b 22 25 f3 74 cd 37 8d 71 30 2f a2 84 14 e7 aa b3 73 97 &lt;br /&gt;
f5 54 a7 df 5f 14 2c 21 c1 b7 30 3b 8a 06 26 f1 ba de d5 c7 2a 70 4f 7e 6c d8 4c &lt;br /&gt;
ac 00 28 6b ee 00 00 00 00 43 41 04 11 db 93 e1 dc db 8a 01 6b 49 84 0f 8c 53 bc &lt;br /&gt;
1e b6 8a 38 2e 97 b1 48 2e ca d7 b1 48 a6 90 9a 5c b2 e0 ea dd fb 84 cc f9 74 44 &lt;br /&gt;
64 f8 2e 16 0b fa 9b 8b 64 f9 d4 c0 3f 99 9b 86 43 f6 56 b4 12 a3 ac 00 00 00 00 &lt;br /&gt;
01 00 00 00 &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To understand where that raw dump has come from, it may be useful to examine tests/ec-key.cpp in [https://gitorious.org/libbitcoin/libbitcoin libbitcoin],&lt;br /&gt;
&lt;br /&gt;
[https://gitorious.org/libbitcoin/libbitcoin libbitcoin] has a unit test under tests/ec-key.cpp (make ec-key &amp;amp;&amp;amp; ./bin/tests/ec-key). There is also a working OP_CHECKSIG implementation in src/script.cpp under script::op_checksig(). See also the unit test: tests/script-test.cpp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;iostream&amp;gt;&lt;br /&gt;
#include &amp;lt;iomanip&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/serializer.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/elliptic_curve_key.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/sha256.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/assert.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/util/logger.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;bitcoin/types.hpp&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/ecdsa.h&amp;gt;&lt;br /&gt;
#include &amp;lt;openssl/obj_mac.h&amp;gt;&lt;br /&gt;
using libbitcoin::elliptic_curve_key;&lt;br /&gt;
using libbitcoin::serializer;&lt;br /&gt;
using libbitcoin::hash_digest;&lt;br /&gt;
using libbitcoin::data_chunk;&lt;br /&gt;
using libbitcoin::log_info;&lt;br /&gt;
using libbitcoin::log_fatal;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    serializer ss;&lt;br /&gt;
    // blk number 170, tx 1, input 0&lt;br /&gt;
    // version = 1&lt;br /&gt;
    ss.write_4_bytes(1);&lt;br /&gt;
    // 1 inputs&lt;br /&gt;
    ss.write_var_uint(1);&lt;br /&gt;
&lt;br /&gt;
    // input 0&lt;br /&gt;
    // prevout hash&lt;br /&gt;
    ss.write_hash(hash_digest{0x04, 0x37, 0xcd, 0x7f, 0x85, 0x25, 0xce, 0xed, 0x23, 0x24, 0x35, 0x9c, 0x2d, 0x0b, 0xa2, 0x60, 0x06, 0xd9, 0x2d, 0x85, 0x6a, 0x9c, 0x20, 0xfa, 0x02, 0x41, 0x10, 0x6e, 0xe5, 0xa5, 0x97, 0xc9});&lt;br /&gt;
    // prevout index &lt;br /&gt;
    ss.write_4_bytes(0);&lt;br /&gt;
&lt;br /&gt;
    // input script after running OP_CHECKSIG for this tx is a single&lt;br /&gt;
    // OP_CHECKSIG opcode&lt;br /&gt;
    data_chunk raw_data;&lt;br /&gt;
    raw_data = {0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    data_chunk raw_script;&lt;br /&gt;
    raw_script = data_chunk();&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
    // sequence&lt;br /&gt;
    ss.write_4_bytes(0xffffffff);&lt;br /&gt;
&lt;br /&gt;
    // 2 outputs for this tx&lt;br /&gt;
    ss.write_var_uint(2);&lt;br /&gt;
&lt;br /&gt;
    // output 0&lt;br /&gt;
    ss.write_8_bytes(1000000000);&lt;br /&gt;
    // script for output 0&lt;br /&gt;
    raw_data = {0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x13, 0x90, 0x5f, 0x07, 0xf0, 0x6b, 0x99, 0xa2, 0xf7, 0x15, 0x9b, 0x22, 0x25, 0xf3, 0x74, 0xcd, 0x37, 0x8d, 0x71, 0x30, 0x2f, 0xa2, 0x84, 0x14, 0xe7, 0xaa, 0xb3, 0x73, 0x97, 0xf5, 0x54, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c};&lt;br /&gt;
    // when data &amp;lt; 75, we can just write it&#039;s length as a single byte (&#039;special&#039;&lt;br /&gt;
    // opcodes)&lt;br /&gt;
    raw_script = data_chunk();&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    // OP_CHECKSIG&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    // now actually write the script&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
&lt;br /&gt;
    // output 0&lt;br /&gt;
    ss.write_8_bytes(4000000000);&lt;br /&gt;
    // script for output 0&lt;br /&gt;
    raw_data = {0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    // when data &amp;lt; 75, we can just write it&#039;s length as a single byte (&#039;special&#039;&lt;br /&gt;
    raw_script.push_back(raw_data.size());&lt;br /&gt;
    libbitcoin::extend_data(raw_script, raw_data);&lt;br /&gt;
    // OP_CHECKSIG&lt;br /&gt;
    raw_script.push_back(172);&lt;br /&gt;
    // now actually write the script&lt;br /&gt;
    ss.write_var_uint(raw_script.size());&lt;br /&gt;
    ss.write_data(raw_script);&lt;br /&gt;
&lt;br /&gt;
    // End of 2 outputs&lt;br /&gt;
&lt;br /&gt;
    // locktime&lt;br /&gt;
    ss.write_4_bytes(0);&lt;br /&gt;
&lt;br /&gt;
    // write hash_type_code&lt;br /&gt;
    ss.write_4_bytes(1);&lt;br /&gt;
&lt;br /&gt;
    // Dump hex to screen&lt;br /&gt;
    log_info() &amp;lt;&amp;lt; &amp;quot;hashing:&amp;quot;;&lt;br /&gt;
    {&lt;br /&gt;
        auto log_obj = log_info();&lt;br /&gt;
        log_obj &amp;lt;&amp;lt; std::hex;&lt;br /&gt;
        for (int val: ss.get_data())&lt;br /&gt;
            log_obj &amp;lt;&amp;lt; std::setfill(&#039;0&#039;) &amp;lt;&amp;lt; std::setw(2) &amp;lt;&amp;lt; val &amp;lt;&amp;lt; &#039; &#039;;&lt;br /&gt;
    }&lt;br /&gt;
    log_info();&lt;br /&gt;
&lt;br /&gt;
    data_chunk raw_tx = {0x01, 0x00, 0x00, 0x00, 0x01, 0xc9, 0x97, 0xa5, 0xe5, 0x6e, 0x10, 0x41, 0x02, 0xfa, 0x20, 0x9c, 0x6a, 0x85, 0x2d, 0xd9, 0x06, 0x60, 0xa2, 0x0b, 0x2d, 0x9c, 0x35, 0x24, 0x23, 0xed, 0xce, 0x25, 0x85, 0x7f, 0xcd, 0x37, 0x04, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, 0xac, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xca, 0x9a, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0xae, 0x1a, 0x62, 0xfe, 0x09, 0xc5, 0xf5, 0x1b, 0x13, 0x90, 0x5f, 0x07, 0xf0, 0x6b, 0x99, 0xa2, 0xf7, 0x15, 0x9b, 0x22, 0x25, 0xf3, 0x74, 0xcd, 0x37, 0x8d, 0x71, 0x30, 0x2f, 0xa2, 0x84, 0x14, 0xe7, 0xaa, 0xb3, 0x73, 0x97, 0xf5, 0x54, 0xa7, 0xdf, 0x5f, 0x14, 0x2c, 0x21, 0xc1, 0xb7, 0x30, 0x3b, 0x8a, 0x06, 0x26, 0xf1, 0xba, 0xde, 0xd5, 0xc7, 0x2a, 0x70, 0x4f, 0x7e, 0x6c, 0xd8, 0x4c, 0xac, 0x00, 0x28, 0x6b, 0xee, 0x00, 0x00, 0x00, 0x00, 0x43, 0x41, 0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3, 0xac, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};&lt;br /&gt;
    BITCOIN_ASSERT(raw_tx == ss.get_data());&lt;br /&gt;
&lt;br /&gt;
    hash_digest tx_hash = libbitcoin::generate_sha256_hash(ss.get_data());&lt;br /&gt;
&lt;br /&gt;
    data_chunk pubkey{0x04, 0x11, 0xdb, 0x93, 0xe1, 0xdc, 0xdb, 0x8a, 0x01, 0x6b, 0x49, 0x84, 0x0f, 0x8c, 0x53, 0xbc, 0x1e, 0xb6, 0x8a, 0x38, 0x2e, 0x97, 0xb1, 0x48, 0x2e, 0xca, 0xd7, 0xb1, 0x48, 0xa6, 0x90, 0x9a, 0x5c, 0xb2, 0xe0, 0xea, 0xdd, 0xfb, 0x84, 0xcc, 0xf9, 0x74, 0x44, 0x64, 0xf8, 0x2e, 0x16, 0x0b, 0xfa, 0x9b, 0x8b, 0x64, 0xf9, 0xd4, 0xc0, 0x3f, 0x99, 0x9b, 0x86, 0x43, 0xf6, 0x56, 0xb4, 0x12, 0xa3};&lt;br /&gt;
    // Leave out last byte since that&#039;s the hash_type_code (SIGHASH_ALL in this&lt;br /&gt;
    // case)&lt;br /&gt;
    data_chunk signature{0x30, 0x44, 0x02, 0x20, 0x4e, 0x45, 0xe1, 0x69, 0x32, 0xb8, 0xaf, 0x51, 0x49, 0x61, 0xa1, 0xd3, 0xa1, 0xa2, 0x5f, 0xdf, 0x3f, 0x4f, 0x77, 0x32, 0xe9, 0xd6, 0x24, 0xc6, 0xc6, 0x15, 0x48, 0xab, 0x5f, 0xb8, 0xcd, 0x41, 0x02, 0x20, 0x18, 0x15, 0x22, 0xec, 0x8e, 0xca, 0x07, 0xde, 0x48, 0x60, 0xa4, 0xac, 0xdd, 0x12, 0x90, 0x9d, 0x83, 0x1c, 0xc5, 0x6c, 0xbb, 0xac, 0x46, 0x22, 0x08, 0x22, 0x21, 0xa8, 0x76, 0x8d, 0x1d, 0x09};&lt;br /&gt;
    BITCOIN_ASSERT(signature.size() == 70);&lt;br /&gt;
&lt;br /&gt;
    elliptic_curve_key key;&lt;br /&gt;
    if (!key.set_public_key(pubkey))&lt;br /&gt;
    {&lt;br /&gt;
        log_fatal() &amp;lt;&amp;lt; &amp;quot;unable to set EC public key&amp;quot;;&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    log_info() &amp;lt;&amp;lt; &amp;quot;checksig returns: &amp;quot; &amp;lt;&amp;lt; (key.verify(tx_hash, signature) ? &amp;quot;true&amp;quot; : &amp;quot;false&amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;/div&gt;</summary>
		<author><name>OneEyed</name></author>
	</entry>
</feed>