Bitcoin Forum
May 02, 2024, 01:11:50 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 [69] 70 71 72 73 74 75 76 77 »
1361  Bitcoin / Development & Technical Discussion / Re: What is the "wallet export format"? on: January 10, 2012, 10:44:01 AM
So in the end, to convert things from WIF to a private key, I would:
1) Convert the WIF into a hex array as any base58 encoded string
2) Drop the first byte and last 4 bytes

And I should also perform some checks to make sure the string wasn't corrupted by calculating the checksum.
Yeah I think that would be pretty much how to do it. Make sure to use the Base58 character set used by Bitcoin when doing the Base58 conversions.
1362  Bitcoin / Development & Technical Discussion / Re: What is the "wallet export format"? on: January 10, 2012, 08:27:25 AM
Quote
That link is about creating a Bitcoin address from a key pair, not from the "wallet import/export format" which is said to "include built-in error checking codes" (from the "Private key" wiki entry).
Steps 4 to 9 describe how to do Base58Check encoding (but remember what I said about step 9). A WIF (wallet import format) key is simply a Base58Check encoded private key.

EDIT: so let me make this clearer:

1) Attach '80' to start of private key.
2) Perform SHA-256 hash on the whole string.
3) Perform SHA-256 hash on the result of the previous SHA-256 hash.
4) Take the first 4 bytes of the last SHA-256 hash. This is the checksum.
5) Add the 4 checksum bytes from point 4 to the end of the string from point 1.
6) Convert the result from a byte string into a base58 string.

EDIT: If you look here you'll see the process (Base58Check encoding) described in a few steps:

Quote
A Base58Check string is created from a version/application byte and payload as follows.

1.  Take the version/application byte and payload bytes, and concatenate them together (bytewise).
2.  Take the first four bytes of SHA256(SHA256(results of step 1))
3.  Concatenate the results of step 1 and the results of step 2 together (bytewise).
4.  Treating the results of step 3 - a series of bytes - as a single big-endian bignumber, convert to base-58 using normal mathematical steps (bignumber division) and the base-58 alphabet described below. The result should be normalized to not have any leading base-58 zeroes (character '1').
1363  Bitcoin / Development & Technical Discussion / Re: What is the "wallet export format"? on: January 10, 2012, 06:14:32 AM
Ok I see what you were referring to now:

Quote
This sample key in wallet export format is 5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ, and the corresponding Bitcoin address is 1GAehh7TsJAHuUAeKZcXf5CnwuGuGgyX2S.

I think that's actually meant to say "wallet import format".

Also have a look at this: Base 58 Wallet Import format
1364  Bitcoin / Development & Technical Discussion / Re: What is the "wallet export format"? on: January 10, 2012, 05:56:18 AM
You mean "wallet import format" right?

Quote
Is it just a base58 encoded private key, or is there more to it than that?
To turn a normal private key into a WIF key you need to perform Base58Check encoding.

I'm pretty sure steps 4 to 9 on this page describe the process.
EDIT: btw, at step 4 you start with the private key and attach 0x80 to the front instead of 0x00.

Quote
9 - Convert the result from a byte string into a base58 string using Base58Check encoding.

I think this step is incorrect. The process completed between steps 4 and 9 is Base58Check encoding from what I understand. At step 9 you convert the result from a byte string into a base58 string using a specialized base58 character set: Base58 symbol chart. On that same page you'll also see another step by step guide for Creating a Base58Check string.

To turn a public key into a bitcoin address it's the exact same process, except you need to start at step 1 instead of step 4. So you perform Base58Check encoding on the RIPEMD-160 hash.
1365  Bitcoin / Bitcoin Discussion / Re: [It's here] The Second Bitcoin Whitepaper on: January 07, 2012, 11:39:05 AM
Therefore I think you should drop the idea of a trusted entity, drop the idea of price manipulations, and promote the concept of useing mastercoin as a way to add more data to transactions to give the features you mentioned to bitcoin itself.
+1
1366  Bitcoin / Project Development / Re: Bitcoin SCI: process bitcoin transactions with PHP (address generation & IPN) on: January 06, 2012, 10:56:24 AM
Quote
Don't forget that blockexplorer is technically run by private party and it's closed source. Support for alternative sites would be important for the safety.
Good point. I'll get around to it when I have more time. Can you recommend some alternative sites?

Quote
I'm looking exactly to this (handling keys in PHP) for writing PHP client for my Stratum project. Maybe you would be interested in writing API for it? It has basically JSON-RPC interface, with some significant benefits over using blockexplorer.
That seems like it would be way over my head. Even if I could, I don't really have time to help out. Sorry about that. Seems like a very interesting project though.

Quote
With this feature, there's no need for extra buttons like "confirm payment", website can detect incoming transaction by self, providing excellent user experience: Webpage with displayed bitcoin address will have open ajax connection to the website, when website receive notification about new transaction to this particular address, it send that transaction back to webpage over the ajax connection.
Well I was thinking about using AJAX, but I decided not to use any javascript at all so it would be more reliable. With AJAX I could have sent queries to blockexplorer in the background and automated everything. Even if I were to use AJAX, it would be rather pointless to send queries to blockexplorer when the user hasn't even sent the bitcoins; although you could automate it that way. The 'confirm' button simply tells the script that it can start looking for confirmations once the user has sent the payment. It's only one extra button they have to click anyway, and I think it helps to have it there with the cancel button before the confirmation stage.
1367  Bitcoin / Project Development / Re: Bitcoin SCI: process bitcoin transactions with PHP (address generation & IPN) on: January 06, 2012, 09:24:49 AM
Great! Cheesy
Do you think that it should be easy to add also the support to blockchain.info API ?
Yah it should be simple. Go ahead and do what you like with it.
1368  Bitcoin / Project Development / Bitcoin SCI [PHP]: process transactions yourself! (addresses gen, IPN, QR Codes) on: January 06, 2012, 08:58:01 AM
    This is a little project I've been working on for the last few days. I first came up with this idea here: PHP script to create private key & public address. It was hard to find a decent Elliptic Curve library for PHP but eventually I came across this on a blog: Elliptic Curve PHP-OOP DSA and Diffie-Hellman. The library only came with a set of NIST curves so I had to create a set of SEC curves using the parameters supplied in sec2_final.pdf.

Then to convert the keys into bitcoin addresses I basically followed the instructions on this page: Technical background of version 1 Bitcoin addresses. I found that many of these steps had already been coded in PHP: bitcoin-php - Bitcoin utility functions. I did a lot of testing with it and it seems to generate valid bitcoin addresses each time, I even sent coins to one of the addresses generated in PHP and it worked fine. However, I am far from an expert on cryptography so please check the code and let me know if you see any problems.

If you have time, take a look at the bitcoin.lib.php file and check the following functions for problems. The mini key functions aren't really used for anything at this point, I just coded them because it seemed like a good idea at the time.

getNewPrivKey()
getNewKeyPair()
getNewKeySet()
privKeyToAddress($privKey)
privKeyToWIF($privKey)
checkMiniKey($miniKey)
getNewMiniKey()
miniKeyToWIF($miniKey)
miniKeyToAddress($miniKey)

The other part of this script is the Bitcoin Payment Gateway. Instead of passing the transaction through to a 3rd party for processing, payments are verified simply by using blockexplorer to monitor the status of a payment to a specified address. There's no need to install bitcoind on your server, everything is done in pure PHP. This script essentially enables you to have your own Payment Notification System without the need for a middleman (except blockchain.info/blockexplorer.com), very safe imo, and another amazing feature of bitcoin. This is the description from my website:

Quote
The Bitcoin Shopping Cart Interface package is a set of libraries and tools that enable you to process bitcoin transactions with only PHP. You can have your own Instant Payment Notification system without the need for a middleman. If you've been wondering how to handle customer payment since MyBitcoin went down, look no further, because this is the safest solution.

An elliptic curve library written in PHP is used to achieve server side generation of FRESH bitcoin addresses for each customer. The script monitors the status of a payment by making use of the data supplied by blockexplorer.com. As such, there is no need to install a heavy duty service such as bitcoind on your server. The only limitation with this PHP package is that you can't make outgoing payments.

The SCI package comes with a simple example to give you an idea about how to generate new keys and initiate a new payment through the Bitcoin Payment Gateway. This is NOT full shopping cart software, you would typically use this script to offer Bitcoins as one method of payment. Some of the Bitcoin SCI scripts (in the 'sci' folder) need to be modified to work properly on your website.

Info: Bitcoin SCI: process bitcoin transactions with PHP

Download: Bitcoin SCI

Demo: BitShop Integration
1369  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 30, 2011, 05:24:49 AM
I've already set the permissions on the botg.sh file correctly. At first it wasn't outputting anything so I fixed the permissions and it started giving me a string of 1's for both the keys. The output looks like this:

PrivateKey
1111111111111111111111111111111111
PublicKey
1111111111111111111111111111111111

I did a quick Google search and found that someone else using the BOTG script was getting the same type of output. It was because they were missing certain packages, so I assume that's my problem.
1370  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 30, 2011, 01:54:12 AM
I created a php library that uses "bitcoin-off-the-grid" (BOTG) (source: https://bitcointalk.org/index.php?topic=23081.20) which is a bash script.

Here is the library:
https://github.com/RobKohr/PHP-Bitcoin-Address-Creator

I trimmed out a bunch of stuff from BOTG to make it more script friendly, and wrapped a php exec call to it. It seems to work pretty well.
Awesome idea, I didn't think of that. It's still not working on my server though, I must be missing some packages. It's just outputting a bunch of 1's for me. And I don't really have the ability to install new packages on my server, that's another reason I wanted to find a way to generate bitcoin addresses without installing bitcoind on the server. I tried grondilu's Perl modification which removes some dependencies, but no luck. I must be missing the dc/bc package. Looks like I might have to read up on the process for creating bitcoin addresses and write a pure PHP script.
1371  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 06:43:31 PM
Quote
I think they were expecting you to move the BTC off the address each time so you can start back at zero for each re-use of the address. This would also work.
Wouldn't that involve a transaction fee for every single address that you need to empty?
1372  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 04:50:54 PM
lol don't worry I'm still confused. It's almost 4 in the morning here. Grin

I'm mainly just wondering if it would be better to use a list or to generate a new keypair for each customer.

I found this page on the wiki, and it's basically what I was talking about:

Quote
Solution for receiving bitcoins

1.    Input a list of bitcoin receiving addresses to your database
2.    Give a bitcoin address to a potential customer
3.    Have the customer tell you when they have sent the coins and have at least 1 confirmation (you can choose a number higher than 1 if you are worried about double-spending)
4.    Check blockexplorer to see if they sent the right amount (i.e. http://blockexplorer.com/q/getreceivedbyaddress/19hMEAaRMbEhfSkeU4GT8mgSuyR4t4M6TH/1) - the /1 is the number of confirmations you require
5.    Give them what they paid for
6.    After a reasonable amount of time has passed, you can re-use the address for another customer

You could avoid having a list of addresses and reusing them if one of the wallet services someday lets you get a new address via API call, but this will work for now.

It seems having a new address for each customer is desirable, but wouldn't it be better to simply get new addresses via this method we're talking about rather than a 3rd party as the wiki suggests?

Also, it seems to me like the getreceivedbyaddress function returns the total amount sent to a specified address, so if you were re-using addresses wouldn't that mean you'd need to keep track of how much each address has received?
1373  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 04:22:23 PM
Quote
Yes, your original post basically describs one "correct" way to do it - generate a keypair for each customer
Ok, so then this would be useful? Is this way more "correct" then using a static list of addresses?
1374  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 04:09:19 PM
Quote
I think it is a great idea to generate a different address for each customer
...
I think you may just be confused about some of the specifics as to how that is done is all.
And the specifics being that it's more efficient to simply use a list of addresses and recycle them to be used with other customers? Or am I totally confusing myself here?
1375  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 03:52:27 PM
Quote
I do not understand the difference/advantage of the proposed system.  In one case you pre-generate a list of key pairs and then hand them out to the customers as needed.  When they pay they pay.  You monitor the blockchain to see when they pay.
Well I guess you're right about that. You only really need as many addresses as you think will be needed at any one time. I just like to have systems that scale well. It would also seem to me that having a new address for each customer would make it easier to monitor the addresses on the Block Explorer and make it easier to document transactions.

Quote
Then you have added the additional step of importing the private key.
Hmm I see what you mean. If one were to use a static list of addresses the addresses could be generated in the normal way. Well I guess you're right then. There's no need to generate a new address for each customer. If I can cut out that part of the equation it will make the problem much simpler.

Quote
BTW importing a private key does not generate a blockchain event.
That's what I assumed, but wasn't sure. As I understand it, the network doesn't know about the address until it sends or receives money. I assume that's what makes 'off the grid' accounts possible?
1376  Bitcoin / Development & Technical Discussion / Re: PHP script to create private key & public address on: December 21, 2011, 03:09:32 PM
Wouldn't this be useful for merchants who might need to generate a new address for each customer instead of using a large static list of addresses that are generated beforehand? As I understand it, it's possible to import a private key into the bitcoin client or use a service like StrongCoin to make use of a private key.

The merchant could generate a private key and public address server side, tell the customer to send the payment to the public address and store the private key. Another simple AJAX/PHP script would be used to monitor the status of a payment by using the Block Explorer. After reaching a specified amount of confirmations the payment would be accepted.

Then the merchant could import those private keys in one of the ways I specified earlier. What I'm wondering is, will payments sent to these addresses receive confirmations before or after they are imported? I'm fairly sure it should work but I'm not exactly an expert. Anyone know if this would work as I'm proposing?

What I really want is a completely automated system. This would be like a way to carry out automated payment notification and allow customers instant access to products such as digital downloads. If I'm correct this idea could potentially achieve this goal without the need to for a middle man (except of course the Block Explorer).

I think BitcoinNotify (not 100% sure) implemented a similar idea of monitoring the block chain to check for payments to a specified address. The clear advantage of this is that they never gain control over your account, they simply monitor the activity of an account and use the data to power their notification system.

I don't really see why they are needed as a 3rd party when it should be possible to implement a few simple scripts that achieve the same thing. I have the ability to create all these scripts (and I want to), but what I don't really know how to do is use PHP to generate the keys. I looked all over and can't find a PHP script for doing it.

I guess I might try to convert the JavaScript code into PHP unless anyone can offer some help? Grin
1377  Other / Off-topic / Re: My bitcoin song and video on: October 11, 2011, 01:42:30 PM
Plain awesomeness.

Well done sirs.
1378  Other / Off-topic / Re: The story of Bold Funding. on: August 31, 2011, 10:57:51 AM
I can see why you've been so successful at scamming Bruce. I read your post and I almost believed you for a minute or two. But there are too many critical questions you have failed to answer (i.e. purposely avoided).
1379  Other / Off-topic / Re: Bruce Wagner - "reprehensible" fraudster according to Cook County Judge on: August 30, 2011, 11:03:02 PM
I never trusted you Bruce. Now I have all the proof I need to know you are a f'ing douche.
1380  Economy / Trading Discussion / Re: What SCI should merchants use now that MyBitcoin is dead? on: August 20, 2011, 03:56:47 PM
Quote
What merchants should use, only they should know!
Well I did know. MyBitcoin was working fine for me. I really liked the fact it was basically the most powerful wallet service around. It was basically like PayPal in that you could do nearly everything with MyBitcoin alone. It was easy and efficient. But I guess they are also like PayPal in that they are complete scum bags. I'm just looking for some advice and alternative options that are said to be safe and reliable.
Pages: « 1 ... 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 [69] 70 71 72 73 74 75 76 77 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!