Saturday 1 December 2018

My first currency AlexToken and ICO


My first currency and ICO

AlexToken: https://bloxy.info/address/0x41104edb2cefbb66cc28b17d507f0b4ba559f455

I strikethrough by blue the 18 last zeroes because all tokens in the Ethereum are counted in 1/1 000 000 000 000 000 000 parts. For instance 1 Ethereum consists of Wei witch is 1/(10 power 18) of 1 Ethereum.


What these numbers means? The main numbers are:

  • cap (1 billion) - it is how many tokens I'm going to get
  • tokenReserve (500 millions) - it is how many tokens I've rest for myself
  • totalSupply (500 millions + 1) and remainingTokens (999 999 999) - it shows the current progress of the ICO
  • basePrice (100) - the price of one AlexToken is 1/100 Ethereum

So as you can see my ICO doesn't have great success... And I don't have any idea why! ;)


Thursday 29 November 2018

AlexToken - technical explanation


The short instruction


The short instruction is:
Write your Smart Contract code on Solidity language, go to the online compiler: https://remix.ethereum.org

  • Copy/Paste your source code there. 
  • Do not forget choice correct version of the compiler. 
  • Choose AlexToken in the "Swarm" list
  • Push the button "Start the compile"
  • Everything must be green at the bottom
  • Push the "Details" button to get the compilation results



Copy very long string of the "object" field. It is the "binary code" of the Smart Contract:



Now we are going to deploy the Smart Contract to the Ethereum network. Go to your favorite Ethereum wallet (mine is https://www.myetherwallet.com):
  • Go to the "Contracts" menu item, click on the "Deploy Contract" link
  • Paste into the "Byte Code" field our string
  • Look at the Gas Limit 2144779 and Gas Price 42 Gwei and calculate the contract deployment price:
(42000000000 × 2144779) / 1000000000000000000 = 0,090080718 ETH

  • So the contract deployment will cost about 0.09 Ethereum or about 720 RUB for the current price: 8000 RUB for 1 ETH
  • Authentificate yourself




Sign the transaction and deploy the contract:







Go to the contract: https://etherscan.io/address/0x41104edb2cefbb66cc28b17d507f0b4ba559f455
Now it is nesessary to "Verify and Publish" the contrat. Go to "Code" and click the link "Verify and Publish". I do not have one because I already done the task:



After you click the "Verify and Publish" link you'll get the form in which you need correctly:
  • Set the contract number
  • Set the contract name: AlexToken
  • Paste the source code 
  • Set the exact compiler version
  • Set optimisation to "No" if you are not sure about setting "Yes"
If everything is correct you'll get some green text. After that you can interact with the contract. For this copy the "Contract ABI" string:


Go to https://www.myetherwallet.com/ and paste the string, choice the function and get the result:




Amazing you can interact with you contract without logging into the wallet and not to spend any Ethereum!


Full instruction

Follow the tech manual:

"6 Steps to ERC20 Tokens and ICO Smart Contracts"
https://medium.com/coinmonks/6-steps-to-erc20-tokens-and-ico-smart-contracts-e90523afafa1




Tuesday 27 November 2018

New currency exchanges

I've made account on the following currency exchange: https://www.coinbase.com/

But when I tried to buy some Ethereum, I've got the following message:

Coinbase does not currently support buys in your country. Subscribe to our blog to be notified when we add support for your country!

So I went to the list of exchangeshttps://www.bestchange.com
And tried to choose the exchange with the best exchange course, for instance such way:
https://www.bestchange.com/visa-mastercard-rur-to-ethereum.html

But at the exchange with the best price was the minimum amount of exchange 5000 RUB. So I was not ready to spend the sum on experiments. I tried the next exchange in the list, but it had the 24h delay in the money transfer. So I returned to the https://kassa.cc/en/ with bad course and high commission but it transfers money fast and doesn't asks unnecessary questions! ;)




Monday 22 October 2018

What is Nonce?


Nonce is the number that defined to every transaction in Ethereum network. It must be increased every time you send the transaction. When you send "online" transaction in the MyEtherWallet the Nonce and Gas price are set automatically. In offline transaction you can set Nonce and Gas price. But if you set wrong Nonce (smaller or the same that the last mined transaction) then the transaction will fail... if you set Nonce too hight the transaction will wait until you don't fill all the numbers in the gap...
For what it is done? Nonce prevents accidental double spending of your money from one side. And from other side Nonce prevents good people from cheater's transactions. When they try to spend money several times that they don't have...
To get the next valid number Nonce for your transaction you can go to  MyEtherWallet and in offline transaction input your public key. For my the first wallet I've got the number "3". Or you can use API, which gives access to Ethereum ledger for instance:
If send HTTP POST request to the address: 
With body:
{"jsonrpc":"2.0","method":"eth_getTransactionCount","params": ["0x34A79a202F3712Bd3Fa30A2A7D9e0D4d87Cc8653","latest"],"id":1}
It returns the same "3":
{"jsonrpc":"2.0","id":1,"result":"0x3"}



Sunday 21 October 2018

Your transactions are public!

Be careful - your transactions are public! If you send somebody money he will know you public address. For instance go to my second wallet:

https://etherscan.io/address/0x350aDD1660330020B40cfE8035B5B06f0FBC692B

I can see that somebody send me 0.001 Ether. I go to transaction:

https://etherscan.io/tx/0x617ede331e8a99f46a363b32b239542bb4006e4fa9a2727a6636ffe3eb095cef

I can see the sender's public address, then I click on it:

https://etherscan.io/address/0x34a79a202f3712bd3fa30a2a7d9e0d4d87cc8653

and I can see all sender's transaction!!! So be carefull and don't send money to you mother from the wallet from what you buy alcohol! )))

Saturday 20 October 2018

The results of brave experiments with Gas price...


 Eventually two transactions successfully finished at 4 am and one disappeared. Because of wrong "Nonce" I think. Total waiting time was 14 hours. My two transactions:

https://etherscan.io/tx/0x617ede331e8a99f46a363b32b239542bb4006e4fa9a2727a6636ffe3eb095cef
https://etherscan.io/tx/0xb4a739191832dcea79b53beb6944bd0f26240c52159306d79d1d9a3089329e3c

Equal values in transactions:
0.001 Ether ($0.21)
Gas Limit: 21000
Gas Used By Transaction: 21000

The first transacton:
Gas Price: 0.000000002 Ether (2 Gwei)
Actual Tx Cost/Fee: 0.000042 Ether ($0.008615)
Nonce & {Position}: 1 | {85}

The second:
Gas Price: 0.000000003 Ether (3 Gwei)
Actual Tx Cost/Fee: 0.000063 Ether ($0.01)
Nonce & {Position}: 2 | {124}

Price of transactions in percent was:   
0.000042 / 0,00001 = 4,2%
0,000063 / 0,00001 = 6,3%

It is much better than in my previous experiment ;)))

Friday 19 October 2018

Brave experiments with Gas price




At the picture and we see that we can set Gas price equal 2 or even 1 GWEI!

On the site we can predict the approximate time of transaction execution: https://ethgasstation.info/calculatorTxV.php

The calculator shows that for the 2 GWEI the time of the transaction will be  33335 sec. Hm almost 10 hours... The other prices and estimated times:
  • 1 GWEI = 35290 sec
  • 2 GWEI = 33335  sec
  • 3 GWEI = 13328 sec
I have enought time so let's try!

I went to my wallet and made 3 offline transactions. In the offline transactions it is possible to set the Gas price: https://www.myetherwallet.com/#offline-transaction
I set the Gas prices equal "1", "2" and "3" GWEI and the amount of transaction is 0.001 ETH (0.001 * ($203.92 USD / 1 ETH)* 60 = 12 RUB). Additionally it is necessary to set the new magic parameter: Nonce. I'm sure it is very important to set correct "Nonce" but for now I left default value "1".

The transactions start time was:


  • 14:00 (Gas price 1, Nonce = 1)
  • 14:20 (Gas price 2, Nonce = 1)  this transaction should eventually rejected by network because it is not allowed set the same values for Nonce. They should always increased by one. 
  • 14:29 (Gas price 3, Nonce = 2)

    • Now waiting and look at the wallets here:

      What is the Gas? WTF?


      As usual I've gone to the internet... After I read several articles I've understand the following not very obvious things... 

      To make transaction or execute smart contract you need to pay fee. In the real banks the calculation is very simple, for instance you need to pay 3% from the amount of the transaction. In the case of Ethereum the calculation of transaction price is more complicated.

      To make transaction or execute smart contract in Ethereum you need to pay some amount of "Gas". For instance for single money transfer you need to pay 21000 Gas units. But what is the cost of one unit of gas? You must set it by yourself... The price is defined in GWEI (I didn't found what means the abbrewiation) but 1,000,000,000 GWEI = 1 ETH. So in my transaction was:

      Gas Limit: 21000
      Gas Price: 41 GWEI (0.000000041 ETH)

      So the fee of my transaction was 21000*0.000000041 = 0.000861 ETH. Ok I've found my money! ;) But stop... In rubels it is approximately 10 RUB but the amount of the transaction was only 0,0044 RUB so I've paid  223102% !!! WTF?!!!

      From my point of view it is too much... And the next Big question - can I decrease by myself the "Gas Limit" and "Gas Price" ? After interesting reading I understand that it is not recommended decrease "Gas Limit", but you can set "Gas Price". What is correct gas price? To know it you can visit Gas Station! ;) https://ethgasstation.info/ What we can see for this moment?




      Recommended safe price is 5.1 GWEI. It means that if you set the price 5.1 than your transaction for sure will executed in the next 30 minutes. If you need to execute your payment less than in 2 minutes it is necessary set the Gas price equal 14 GWEI. Why default price of Gas for my transaction was 41 GWEI ?!!! It is very looks like some kind of cheating... (((  Um no cheating I found the info about default 41 GWEI... It is the price to make instant online transactions...

      But I have enough time to make brave experiments with Gas!

      Wednesday 17 October 2018

      The first transaction


      Ok let's do the first transaction... But to whom I can send money? Hm... at this moment I have no reliable recipients except may be one - it's me!  Said -  done:

      I've made the second wallet on MyEtherWallet:

      0x350aDD1660330020B40cfE8035B5B06f0FBC692B

      than went to my first wallet and sent 0.000000368 ETH to the new wallet. Than I waited for a couple minutes and magic:

      Account balance of the new wallet was: 0.0 ETH and has become: 0.000000368 ETH. Account balance of mine first wallet was: 0.033151368 ETH and has become... 0.03229 ETH. Hm why the balace has become less than I expected: 0.033151 ETH ?!!! Where is my 0,000861 ETH ?
      I look at the description of transaction and it says:

      Gas Limit: 21000
      Gas Price: 41 GWEI (0.000000041 ETH)
      Max TX Fee: 0.000861 ETH (861000 GWEI)

      A-a-a I found my 0.000861 ETH  - it is "Max TX Fee", but what it means? It costs 233967% from amount of transaction: 0,000861 / (0.000000368 / 100) What the F?!!! New Big question and I'll try to to understand tomorrow...

      Tuesday 16 October 2018

      The first Ethereums

      Yesterday I've got the first Ethereum wallet. But it is empty... How to fill it up? The next Big question... As usual I don't believe advertisement and start to read descriptions of possible options.

      • First of all you should choose the currency exchange. I choose this one https://kassa.cc/
      • Main idea is - to get something virtual you should first have something virtual. I remembered that I have Yandex Money money with 500 RUB in it. So I am ready to spend this huge amount of currency for my grand goal!
      • Of course and Yandex Money and kassa.cc will charge you for the transaction, but at this moment I don't care about it. So i went on kassa.cc and followed instruction steps. Was surprised that Yandex Money doesn't make transactions from anonymous wallet, so I had to exit from shadow...
      • Waiting 20 minutes and at the end I've become happy owner of  0.033151368 ETH !!!

      What I do with these wealth I'll think tomorrow ) 

      Monday 15 October 2018

      The first wallet

      Today I've decided to learn cryptocurrency! The best way to study is to participate by self! So let's make the first wallet... Hm... but how? What crypto currency to choose? What site or application? How not to became victims of cheaters? 

      I've studied several sites with cryptocurrency wallets descriptions and have choice for the begin the MyEtherWallet https://www.myetherwallet.com It is on-line wallet for Ethereum cryptocurrency, but secure because you keep your private key by self. I think the most secure way is use the official Ethereum wallet "Mist" https://github.com/Ethereum/mist/releases but it requares about 200 Gb free space beause it keep all Ethereum transactions.. 

      The first wallet

      The public key for my wallet is 0x34A79a202F3712Bd3Fa30A2A7D9e0D4d87Cc8653 So if you want to send me a little of Ethereum I'll not decline )

      Tomorrow I'll try put there some money..