Selecting a password for your Bitcoin wallet

They previously advised me to come to blockchain. I came, downloaded their scripts, launched it, I needed an API key, filled out a form to request an API key (that’s how they do it now), waited a day, and I received a refusal. Refusal, KARL) I am being denied service in the Bitcoin area. You see, they didn’t like my site, and they think that I don’t need to accept bitcoins. But - first of all, what do they care about my site? I wrote them an angry letter, full of hatred, demanding that they give me the key this minute.

What other options are there? What other 100% reliable methods are there, are there any known libraries for working with Bitcoind, for example in PHP, or aggregators, or something else?

Google didn't help me, or I was looking for the wrong thing. Please do not offer various Robocashes, money and Horns and Hoofs, you need to work without commission from such offices.

From time to time I notice questions about how to accept Bitcoin payments on my website without using third-party services. This is quite simple, but we must take into account that there are pitfalls.

In this article I will try to describe in as much detail as possible, without emphasis on any programming language, how to accept Bitcoin payments (and also, if desired, Litecoin, Dash, Bitcoin Cash, Steep, ONION, etc.), starting with deploying a full node and finishing with verification of payment receipt.

Wallet installation

The first step is to allocate a separate server to host the wallet. Why a separate server? A separate server will reduce the risk of an attacker withdrawing all your funds if the main site is hacked. Well, don’t forget that storing blockchain requires a lot of disk space (

150Gb of disk space, etc. - details at the link).

What are the options for cheap servers? There are a lot of them, in my opinion the most adequate ones are servers from hetzner.de or chipcore.com. On chipcore.com, for example, you can buy a dedicated one with a 500Gb disk (enough for BTC and a couple more blockchains) for only 990 rubles (about 17 bucks). If you know something cheaper, write in the comments, it’s very interesting (I think not only for me).

After you have meaningfully decided that you want to accept cryptocurrencies on your website and have purchased a server (or used an existing one), you need to install a bitcoin node.

Any suitable operating system must be installed on the server, the simplest option is Ubuntu 16.10 (yes, in fact, this is not the best choice, it is better to install 16.04 or wait for 18.04 and wait a couple more months for stabilization). As a rule, there is no point in bothering with disk partitioning and you can safely use 2-4Gb for swap and put the rest on the root partition (/or root).

After the server is available, the first thing to do is disable password authentication and configure authorization using ssh keys. This is quite easy to do; there is a good description from DigitalOcean.

After the server is configured, a couple of commands are enough to launch a full-fledged wallet node

Selecting a password for your Bitcoin wallet

In early 2012, I first heard about the Bitcon crypto currency. It was immediately decided that there would be mining. I registered at mining.bitcoin.cz and started mining. Everywhere I read about Bitcoin, the authors insistently recommended encrypting the wallet. Hackers, intelligence agencies, viruses, etc. everyone is trying to steal your wallet.dat. So I gave in and decided to encrypt mine. The encryption process took place late in the evening, a couple of days after the start of mining and in a state of slight alcoholic intoxication. So, 3 months passed until I decided to use the one I had mined for the first time, and imagine my surprise when none of the passwords I used worked. A new wallet.dat without a password was urgently created and this one was postponed until better times. I hoped that as Bitcoin spread, there would be “kind” people who would write a wallet cracker and I would recover my password. But time passed and there was still no such solution, although there were many posts on the Internet on forums calling for help in recovering forgotten passwords, when a person knew his password but could have made a mistake in several characters in several places. It was decided to write a password picker myself. In one of the posts on the bitcointalk.org/index.php?topic=85495.0;all forum, I came across a ruby ​​script that tries passwords to open a wallet. Having understood the code, it turned out that the algorithm is very simple.

Next, I will describe what I did and how, but having understood the essence of the process, any programmer can write his own password picker. So I have an old wallet.dat from March 2012, there is a client of that time bitcoin-0.5.2-win32-setup.exe. For simplicity, it was decided to install Windows XP on a virtual machine and conduct all experiments in it. After installing Windows and the Bitcoin client, the virtual machine's network adapter was turned off and c:\Program Files\Bitcoin\bitcoin-qt.exe was launched for the first time. Why turn off the network adapter? When the wallet client starts, it goes online and downloads the entire chain of transactions, which is currently 14Gb - a long process and unnecessary in this case. There is a new wallet.dat in c:\Documents and Settings\Administrator\Application Data\Bitcoin\. Next, close bitcoin-qt.exe. We replace the newly created wallet.dat with our old one with a forgotten password. Now you need to put the bitcoin.conf file with the following contents in c:\Documents and Settings\Administrator\Application Data\Bitcoin\ next to wallet.dat:

rcpuse=zeta rpcpassword=somerandomcrap daemon=1

Next, go to c:\Program Files\Bitcoin\daemon\ where the file bitcoind.exe is located. That's what we need. Please note that the bitcoin-qt.exe client must be disabled. So create a bat file with the following contents:

bitcoind.exe -daemon

Let's launch it. The client started in daemon mode and the console window should not disappear but seem to freeze. Let's roll it up. Now a little theory. The selection process consists of launching another instance of bitcoind.exe with the command line parameters:

bitcoind.exe walletpassphrase some_pass 20

where some_pass is the new password that is trying to open the wallet. The process returns a code depending on the result. 0 if the password is correct, in all other cases the number will be different from 0. For example, if bitcoind.exe is not currently running as a daemon, a message will be displayed in the console:

error: couldn't connect to server

if bitcoind.exe runs as a daemon then we will see:

error: {"code":-14,"message":"Error: The wallet passphrase entered was incorrect."}

Knowing this, all that remains is to write a program that generates new passwords, launches bitcoind.exe with the walletpassphrase parameter, followed by a space, a new password, then a space and the number 20. We look at the returned code and either generate a new password or report that the password has been found.

I wrote my implementation in C++. Here is part of the startup code:

STARTUPINFOW si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) );

std::string sFull= "walletpassphrase "+sPass+" 20″;

if(!CreateProcess("bitcoind.exe", sFull.c_str(), NULL, NULL,FALSE, 0,NULL,NULL,&si,&pi)) WaitForSingleObject(pi.hProcess, INFINITE);

DWORD exitCode=0;

// Get the exit code. GetExitCodeProcess(pi.hProcess, &exitCode);

if (exitCode==0) resTry=pswSuccess; else { if (exitCode==87) resTry=pswTryAgain; }

Since I usually use several password options that differ at the end, a list of possible beginning options was compiled, a list of characters that could be at the end, and the essence of the search was to take the beginning of the phrase and brute force the end of the phrase. Several copies of virtual machines with different origins were created and the process began. Since it is not known how long the brute-force process would take, it was decided to write a client-server application where the server generates passwords and sends them to clients; the clients try and either ask for a new batch of passwords or report that the password has been found. By the way, just when I finished writing this application and tested it, my password was found. Still, I finished it and here are the results of several computers:

intel i7 2600K — 1900 passwords per minute intel i5 2500K — 920 passwords per minute amd [email protected] — 900 passwords per minute intel q9650 — 520 passwords per minute

I hope my experience will help someone else recover their password. Good luck.

Install bitcoind

This is all that is required to install the node

Setting up bitcoind

First of all, you need to create a bitcoin user:

and create service directories:

Now the only small thing left is to correctly configure the node to receive JSON RPC requests.

The minimum config will look like this:

It should be placed at /etc/bitcoin/bitcoin.conf. And don’t forget to set the correct owner:

Important: using USERNAME and PASSWORD is a deprecated method and a little unsafe. It is more correct to use rpcauth, you can find an example at the link.

Next, it’s enough to configure the systemd service to start the node (including after a reboot).

To do this, you can simply copy the unit file located at the address in the /etc/systemd/system/ directory:

Then run it and configure autorun:

Now you can check the functionality of the node:

If everything is ok, you will receive a message like this in response:

Setting up the main site server

All that remains is to configure the server on which your site is located.

The safest and easiest way to make the wallet API available on the backend is to create an ssh tunnel through the systemd service (or any other init service). When using systemd, the service configuration is as simple as possible:

This configuration should be placed at /etc/systemd/system/sshtunnel-btc.service.

After that, set the service to autostart and run:

To check, you can knock on the localhost port and check that everything is ok:

Introduction

Please note that this API key is for receiving payments only. There is a standard wallet API that is available in Python, Java, .NET (C#), Ruby, PHP and Node and can be used to send and receive payments. However, it differs from the Receive Payments V2 API in that it is not suitable for generating different addresses for different users. Blockchain.info's API V2

Obtaining an Extended Public Key

https://api.blockchain.info/v2/receive?
xpub=$xpub&callback=$callback_url&key=$key ​​https://api.blockchain.info/v2/receive? xpub=$xpub&callback=$callback_url&key=$key&gap_limit=$gap_limit

Website integration

The only remaining part is to set up processing for receiving payments and generating addresses for replenishment.

The process of integrating crypto payment acceptance looks something like this:

  • When a user requests payment, we show him the address where to transfer funds
  • In the background (the simplest option is via cron), we check the list of wallet transactions and when a new one arrives, we credit funds / change the payment status.

To generate receiving addresses, you can use several different approaches - creating a new address for each deposit, or using a permanent address for the user account.

The first option is more secure (since it is more difficult to track repeated payments by the payer) and simple, but can become a problem when using not very powerful hardware (each generated address increases the load on the node, but this becomes noticeable only after several million addresses).

The second option is more convenient if users must register and pay frequently, but is less secure (for example, you can track all receipts of funds to the user’s account).

To generate a replenishment address, you need to call the getnewaddress method, which will return the new address for replenishment in the response. For convenience, you can pass the account as a parameter (account) to which the created address will be linked. Sometimes this can be useful for viewing transactions for a specific user.

Several methods are suitable for checking your balance. The easiest way is to create an entry in the database for each generated address for replenishment, and then check the receipt of funds for each entry through the getreceivedbyaddress method (not the most productive option, but suitable for most situations).

Another good option would be to obtain information through listtransactions about the latest transactions and for them look for the user who receives balances. Which type of implementation to use is up to you.

An important point when checking transactions is to correctly indicate the number of confirmations to protect against various attacks. For most cryptocurrencies, these can usually be found in the White Paper.

For bitcoin, the recommended value at the moment is 6 confirmations for small amounts. Everything is well described here.

I won’t write code examples here anymore, because it highly depends on the technology used.

html - clear browser cache using php code

I have created a dynamic web page. There are three sliding images on the main page. I created another page to change the main page image (sliding). So after submitting the second page, I wrote PHP code to return to the main page. But the images don't change because my browser has this web page in its cache. If I delete the cache manually or reload the browser, it works. How to delete browser cache in PHP encoding? give me a solution. Thank you.

What is cryptocurrency?

Cryptocurrencies are talked about today on central TV channels and written by serious financial analysts. If you ask the first person you meet on the street: “What is cryptocurrency?”, he will answer you - it’s money from the Internet. This answer is only partially true. Yes, cryptocurrencies are distributed on the Internet, but thanks to this they have an impact on the whole world. After all, the World Wide Web opens up great opportunities. We can buy goods anywhere in the world, invest and pay bills without leaving home.

All this can be done using cryptocurrencies. But, nowadays, Bitcoin, Ethereum and various altcoins are an excellent investment tool. The cryptocurrency market is young and, like any other young market, is subject to great volatility. Which makes it possible to quickly get rich from it. But another factor in the growth of cryptocurrencies is their popularity. Thanks to this trend, the most famous cryptocurrencies have long exceeded their original value by hundreds and thousands of times.

Cryptocurrencies are computer code. Most of them (the most promising) do not have an emission center. And this is the most important advantage of the token over ordinary money. After all, the person who gives the command to turn on the printing press is not responsible for its production. Therefore, the depreciation of cryptocurrency due to an increase in the money supply cannot occur. The maximum number of popular tokens is known initially.

Cryptocurrencies have undoubted advantages:

  • Transparency. All information about the use of cryptocurrency is written in the code. At any time you can find out the history of the token and its participation in transactions.
  • High degree of protection. It is impossible to counterfeit cryptocurrency.
  • Anonymity. Banks and tax authorities cannot track the movement of tokens.
  • Independence. Cryptocurrencies are not regulated by government agencies.
  • Convenience. To “open an account” you do not need to go to the bank. All this can be done online.

Of course, in an article about cryptocurrencies one cannot fail to mention their disadvantages. The main ones are:

  • Lack of legal status. At any time, any state can ban cryptocurrency and its use will lead to violations of the law.
  • Use for criminal purposes. The lack of control in the cryptocurrency market leads to the fact that tokens are used by criminal elements. This way they can transfer funds for criminal activities and launder money.
  • Fraud. The popularity of “digital money” has led to the emergence of many scammers in this market.

How to start making money on cryptocurrency? There are several ways. We will focus on the eight most popular.

Mining

The only way to obtain most cryptocurrencies is mining. This process involves solving mathematical problems to carry out token transactions. Miners, using computer technology, decrypt the blocks of the chain and receive digital coins for this.

Initially, it was possible to mine (extract) cryptocurrency using weak technology. But when this business became profitable, computer processors were replaced by video cards. They were united with each other into farms, which brought in a solid income. Later, special equipment for mining began to appear.

Cloud mining

The risks of physical mining can be mitigated using cloud mining of cryptocurrency. Essentially, these two methods are identical. The only difference is that you do not assemble the equipment, but rent it or buy it for a long time. Moreover, the equipment can be located in any part of the world and its maintenance will be carried out by specialists. You, as its owner or tenant, will receive income for mining minus maintenance funds.

In simple terms, cloud mining is an opportunity to mine cryptocurrency without knowledge of this technology. The main thing is to find the right company that will provide you with this opportunity.

Advantages of cloud mining:

  • All equipment settings and maintenance are carried out by professionals
  • Small investment at the initial stage

Disadvantages of this type of token mining:

  • Less income than mining on your own equipment
  • Purchased equipment remains in a remote data center
  • Deception by scammers who can collect money and simply disappear

The most popular and proven cloud mining services are:

  • Hashflare - provides the ability to mine Ethereum
  • Hashing24 - provides the ability to mine popular cryptocurrencies
  • Cryptomining is one of the best mining services in terms of token mining conditions
  • Telcominer – a service with a simple interface and stable income

Other solutions

You can't clear the cache, however you can ask the page not to cache in the first place:

This has already been asked on StackOverflow, and this answer was taken from there solely to thank the same user who already answered this question.

Or, as already said, you can use META tags for this, but you asked for PHP-, so here it is :D You can also add a random string to the image-URI:

If the random string changes every time the main page is reloaded (!), the browser will receive the image from the server.

Or you disable your cache with PHP using header(); function, or you provide a link (imgurl.com/imagename.jpg? r=1234) to your image. I would recommend the second method. For what? Because if you close the cache for the entire page using the op php header function, it will just slow down your site. So give a random string to your images.

There is one trick you can use. It consists of adding a parameter/string to the filename in the script tag and changing it when changes are made to the file.

The browser interprets the entire line as a file path, even though it comes after the "?" options. So what happens now is that the next time you update your file, simply change the number in the script tag on your site (example) and each user's browser will see that the file has changed and get a new copy.

If your files change frequently, if I were you I would simply send the following header along with PHP:

You can add these lines just before the first release of your PHP script to your pages. By doing this, you are telling the browser that it should not cache the page and should request the content each time.

For images you can write the following line in your HTACCESS:

To clear the Bitrix cache, you need to go to the admin panel, section “Autocaching” - “clearing cache files”. Next you need to delete all files in the /bitrix/cache/ folder.

Buying cryptocurrency on the exchange

Another tool for making money on cryptocurrency is buying it on the exchange. Due to the high volatility of the market, buying “digital money” today, after some time you can sell it for a significant profit. An example of Bitcoin is obvious.

But here you need to take into account the risks of this method of investing your funds:

  • There is no regulator who can resolve complaints
  • Possibility of hacking a wallet on an exchange (examples of such hacker “tricks” appear constantly)
  • High volatility can quickly help increase capital, but also reduce it

If you decide to take a risk, then you need to think about which cryptocurrency to invest in. This market lives not only on Bitcoin. And not everyone can buy the first cryptocurrency today. Among the popular altcoins it should be noted:

This list is updated almost daily.

Have you decided on cryptocurrency? Now you need to find an exchange that trades it. Most popular:

  • Polonex.com. Suitable for advanced users only. Polonex doesn’t like Russian-speaking cryptocurrency investors.
  • Livecoin.net. It’s a good exchange; you can transfer money to it through the “Capitalist” payment system.
  • localbitcoins.net. A service that supports the Russian language, but is not an exchange. This is an exchanger, but quite good and proven.

IMPORTANT

: One of the popular places to buy cryptocurrency from Russians is the YObit.net service. You can link it to your Qiwi wallet and transfer money in a couple of clicks.

Today you can buy cryptocurrency in any online exchanger. But investing in “new money” is a very risky undertaking. As for trading on the stock exchange, this is a rather difficult task. Unlike the stock exchange, high volatility does not allow the use of tools used on other exchanges in this process.

Stock speculators involved in the process of buying/selling cryptocurrencies use three tactics here that are sure to suit beginners:

  • trading on kickbacks
  • impulse trading
  • breakout trading

You can learn more about these types of trading from specialized literature. Unfortunately, there is not much of it yet. Moreover, translated into Russian. But you can use “smart” books about working in the stock and foreign exchange markets. True, everything will have to be adjusted to cryptocurrency exchanges. But this shouldn't scare beginners. After all, every successful trader has his own trading system. And without it, even after reading a hundred books about stock trading, it will be impossible to achieve success.

Purchasing and storing cryptocurrency in an electronic wallet

If you decide to store cryptocurrency not on an exchange, but in a wallet, then there are several ways to do this. Most often, wallets are divided into online and local.

An online wallet for cryptocurrency is a place on a remote server, which is managed through a web interface. If you have dealt with Sberbank Online or similar solutions from other banks, you will easily understand online wallets. It's the same thing, but instead of physical money, they store tokens.

Local wallets come in several types. Most often they are divided into thick and thin. Thin ones take up less space on your hard drive and help make transactions faster. Thick ones read the entire chain and provide the participant with the opportunity to be part of the blockchain chain.

There are also physical wallets. They connect to the computer as peripheral equipment.

But the differences between wallets for storing cryptocurrency do not end there. Wallets are divided into universal ones for various cryptocurrencies and those that support only one cryptocurrency.

The best online wallets are:

  • Blockchain
  • Coinkite
  • Coinbase
  • BitGo
  • GreenAddress
  • StrongCoin
  • Xapo

Best local wallets:

  • Electrum
  • Exodus
  • JAXX
  • Mycelium (mobile version)
  • KryptoKit (browser version)

Removing (resetting) the cache of the Composite Site technology in 1C-Bitrix

If the unmanaged site cache from the /bitrix/cache/ folder is not deleted, write the following lines in the dbconn.php , which is located in the /bitrix/php_interface/ folder: Deleting (resetting) the site cache in 1C-Bitrix via FTP or a file manager

3. On the page that opens, switch to the “ Cleaning cache files ” tab, where you mark the desired option and click “ Start ”.

Or through the task scheduler (Cron), specifying the execution of the following command in a specified period of time:

Menu cached site menu;.

2. In the left menu, open the “ Settings ” section, and in the menu that appears, go to “ Product Settings ” - “ Autocaching ”.

Buying cryptocurrency on one exchange and selling on another

The most difficult way to earn tokens is to buy them on one exchange and sell them on another. This method is complicated and time-consuming. You need to view cryptocurrency quotes on several exchanges at once and compare them with each other. There is special software for this purpose that will greatly simplify the task. True, such programs are expensive.

The second “trouble” of this method is the need to have accounts on all verified exchanges. Although this method is quite complicated to implement, it can bring a stable income.

By the way, there is no fundamental difference between exchanges and cryptocurrency exchangers. Therefore, such services can be included in the above scheme. But, unlike the exchange, exchanging money for cryptocurrency in exchangers is less profitable. This happens due to service fees. It is also worth considering that most exchangers work only with the most popular cryptocurrencies. Unlike exchanges, where you can buy hundreds of different tokens.

Want to know how to make money on today's cryptocurrency rates? Then analyze the quotes of the main tokens. You should only look at altcoins if you are confident that you will sell them.

How to get cryptocurrency on Bitcoin Core

In this article we will try to add Bitcoin as a payment method on the site.
Receiving information from the Bitcoin network

  • chain.com
  • blockchain.info/ru/api (not recommended)
  • www.blockcypher.com
  • chain.so/api
  • coinalytics.co
  • www.blocktrail.com
  • coinkite.com/developers
  • other

1C-Bitrix, as well as other CMS popular at the time of writing, has its own caching system for this site. When you make changes to the theme of the site or any of its components, you must clear this cache to obtain the latest information.

Analogues of mutual funds

The increased interest in cryptocurrencies has prompted the application of time-tested financial instruments to this market. For example, mutual funds. Such funds will help reduce the risks of independent investing and reduce the barrier to entry into the cryptocurrency market.

As with conventional mutual funds, the meaning of such investing is simple. You entrust your funds to a manager who forms an investment portfolio with their help, as well as with the help of other mutual fund participants. But instead of shares and other securities, it contains tokens. How to start earning cryptocurrencies? Use analogues of mutual funds. This method is good for beginners.

The advantages of this form of investment:

  • Profitability
  • Low entry threshold
  • Opportunity to receive weekly interest

Of the minuses, we note:

  • Time threshold at which money cannot be withdrawn from the account
  • Risk of a cryptocurrency market collapse

Analogue of trust management

Another way to make money on cryptocurrency, which migrated from the traditional financial sector. This method is similar to the previous one in that your finances will be managed by professionals - a community of crypto brokers with the necessary experience and knowledge.

The advantages are identical to the advantages of cryptocurrency mutual funds:

  • Low entry threshold
  • High profitability
  • Possibility to earn interest

But there are more disadvantages:

  • Transactions and communication take place through Telegram
  • Information about participants is hidden
  • Deposited funds cannot be withdrawn
  • Lack of verification

Many market analysts consider this way of earning money to be an analogue of the financial pyramids of the 90s. But maybe you'll get lucky?

How to earn cryptocurrency without investment

The whole truth about how to earn cryptocurrency without investments comes down to faucet sites. Some sites give their visitors tokens as incentives. This free distribution of bonuses is called faucets. There are faucets for almost all types of cryptocurrencies. All you have to do is go to such a site, enter your wallet number and fill in other fields. If you want to make money on cryptocurrency without investments, then this method is the most optimal for this.

Some sites give users cryptocurrency free of charge. Others “ask” to watch an advertisement or perform another action:

  • play a kind of lottery
  • participate in games
  • open captcha
  • click banners

The most popular cryptocurrency faucets:

  • Qoinpro is perhaps the most famous faucet. Gives its visitors several tokens at once.
  • Freebitco.in is a stable and time-tested faucet. Gives tokens for games.
  • Kopilka. Issues Satoshi every 100 minutes of being on the site. Pays for articles.
  • Kraneasyfreebtc is a good faucet with an excellent referral system
  • BonusBitcoin – distributes Satoshi every 15 minutes

Cryptocurrency is a young tool for making money. On the one hand, such confusion in the market allows you to get super profits, but on the other hand, it increases the risk of losing your funds. You need to invest in tokens carefully and headlong, and then you can increase your capital. We hope that you found the answer to the question: “How can you make money on cryptocurrency” from this article.

If Litecoin is sent to a bitcoin address

You will need to enter your name, email address, the URL of the site where you will implement the API, and a description of the products you sell or services you offer on your website.

General principles of operation of a payment gateway (read more...)

In this article we will try to add Bitcoin as a payment method on the site. To accept payments we will use Blockchain.info Receive Payments API V2 as it is simple, secure and can be implemented in less than 10 minutes.

Rating
( 2 ratings, average 4.5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]