[Solved] Blockchain-Homework 5

30 $

SKU: [Solved] Blockchain-Homework 5 Category: Tag:
  • The term “mainnet” refers to the actual Bitcoin blockchain network. The term “testnet” is an alternative to mainnet to be used for testing. Testnet coins are separate and distinct from actual bitcoins, and are never supposed to have any value. This allows application developers or bitcoin testers to experiment, without having to use real bitcoins or worrying about breaking the main bitcoin chain. You can obtain testnet coins for free from the faucet at https://testnet.coinfaucet.eu/en/. It is courteous to send the testnet coins back to the faucet after you are done experimenting with them.
  1. Read:
    1. Bitcoin addresses:
      1. https://en.bitcoin.it/wiki/Address
      2. https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
  1. Base58 encoding: https://en.bitcoin.it/wiki/Base58Check_encoding
  2. Bitcoin address reuse and privacy: https://en.bitcoin.it/wiki/Address_reuse
  3. Testnet: https://en.bitcoin.it/wiki/Testnet
  4. BitcoinJ
    1. https://bitcoinj.github.io/#gettingstarted
    2. https://bitcoinj.github.io/workingwithtransactions https://bitcoinj.github.io/workingwiththewallet
  5. Set the hw5.WalletInit.WALLETS_DIR constant to a directory that stores all the wallets.
  6. Read and thoroughly understand hw5.WalletInit.
  7. Run the hw5.WalletInitTest class to create a wallet on testnet. This class will download and sync the testnet block chain on to your computer and thus may take a few minutes. Skim through the logging output to get a basic understanding of what’s happening. Submit the current receive address of your wallet as your solution to question 4 in a text file called homework5solutions.txt.
  8. Use the testnet faucet to send testnet coins to the testnet wallet’s receive address. Look up the transaction ID at the testnet blockchain explorer at https://www.blocktrail.com/tBTC to see if the transaction was submitted to the network. Be sure to receive at least one confirmation in case a double-spend attack prevented you from receiving the coins. The faucet may send the same coin to you in multiple different transactions, so the blockchain explorer may tell you that the coin has been double-spent. To find the actual transaction that successfully sent you coins, run the WalletInitTest and watch the WalletInitTest.monitor method’s periodic reporting of the transactions it receives from its peers. The output will tell you which transaction succeeded and which is dead. Submit the transaction ID and the amount of testnet coins sent to your receive address as your solution to question 5 in homework5solutions.txt. Answer the following questions: how many outputs does the transaction have? What is the purpose of the output that locks coins to the address that’s not yours?
  9. Run the hw5.WalletInitTest class again to update your wallet’s blockchain and confirm that it contains the amount given to you in question 3.
  10. Use BitcoinJ to write a custom Bitcoin address generator for mainnet. Place your implementation in the method CustomAddressGenerator.get(String). This method has one parameter which is a string called prefix encoded in base58. The method returns a bitcoin address on mainnet that begins with 1 followed by prefix. Submit your CustomAddressGenerator class.
  11. Use the CustomAddressGenerator.get(String) method to generate a mainnet address that begins with 1 followed by the first four letters of your last name in uppercase. If your last name is shorter than four letters, append as many “X” characters as necessary. If the first four letters of your last name in uppercase includes a letter not allowed in a Bitcoin address, then use “X” instead of the letter. Submit your custom bitcoin address as your solution to question 8 in a text file called homework5solutions.txt.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] Blockchain-Homework 5
30 $