英语毕业论文代写范例:区块链作业代写 Introduction to Blockchain, Cryptocurrency

APANPS5470: Introduction to Blockchain, Cryptocurrency, and Analytics
Assignment

区块链作业代写 We’ll use Unique Addresses which in the Bitcoin ecosystem correspond to addresses that have a “non-zero balance” (or more

Please submit your homework as a single attachment on the Canvass class website.

Preliminary  区块链作业代写

R is a popular language in the applied analytics circles; it is also a pre-requisite for this class and it’s important to make the effort to read and understand some of the code as some of the lectures feature it.

 

Make sure you refer to the course material which contains all the core R code that you’ll need for this assignment.

For reference, here’s an R cheat sheet. It won’t cover all that is addressed in the sample R files of the class. Use Google if you want to know what a specific function does.

 

We’re going to walk our way into the R code discussed in class.

 

But first, let’s get setup.

 

Step 1: Gain access to R

If you already have R installed on your computer and know how to use it, you can skip this step

 

If you don’t have R already installed

You can use this free Jupyter virtual environment (sign up for the free version): https://www.kaggle.com or Google’s https://colab.research.google.com/

 

Note: The way Jupyter works is simple. You enter a query and click on the play button (or press command+enter on a mac, or ctrl+enter on a PC) and it executes it. You can write one line or multiple lines and it will execute what you have in the block when you ask it to do so, and keep everything in memory all through it.

 

Step 2: Get started

Start a new R notebook


  • in Jupyter, you can select new on the top right and select R (which must be installed to appear in your Jupyter notebook).

  • in Kaggle, you can create a free account, click on “Notebooks”, “New Notebook”. You can select you language of choice in the menu File -> Language -> R

  • Google Colab has similar steps as Kaggle

 

For the exercises below, you’ll need igraph installed AND loaded in memory:

1/ install the igraph package


  • In Jupyter use instructions: packages("igraph")

  • In Kaggle or Colab: skip this step (it’s already installed)

2/ load the library


  • Use instruction: library(igraph)


Note on double quotes: Note that you might have to re-type the double quotes as Word changes the standard double quote character we need to use in R for other double quote characters (word has an open and close double quote vs. a single non-slanted double quote in R)

And… We’re ready to graph!

 

 

Mini-tutorial using the class material

To get warmed up, here’s a simple example taken directly from the lecture (copy and paste from the lecture’s slide into Jupyter)

区块链作业代写

And… We’re ready to graph!

Mini-tutorial using the class material

To get warmed up, here’s a simple example taken directly from the lecture (copy and paste from the lecture’s slide into Jupyter)

区块链作业代写

Here’s what the edges matrix looks like

区块链作业代写

Question 1 (8 points) – A simple graph  区块链作业代写


  1. Modifying the above example, create a new edges matrix and plot the graph as in Fig 1 below using R (or Python optionally) – copy a screen capture of your code and the output as your solution. Note that in this graph the vertices are directed only one way.

  2. Using R to generate the adjacency matrix [use the code from the class material]

  3. Using R to calculate the betweenness centrality

What’s the closeness of node d, ? Explain why closeness cannot be properly calculated.
[hint: it’s a directed graph – not all paths lead to all nodes]

区块链作业代写

Fig 1: Q1 simple graph

Question 2 (15 points) – Application to BTC transaction analysis

In this question, we’ll put our investigative hat on.

 

Preliminary (no points – do on your own, don’t report your findings) – below are the guidelines to get setup in R (optional: you can use python but all guidelines map to the R code from the lecture)


  1. Download the file 1block_200003_092212_BCA_Class.csv from the coursework and take note of where it was saved.

setwd(“/Users/fd2481/Downloads”) # MAKE SURE TO REPLACE WITH THE DIRECTORY WHERE YOU SAVED THE CSV ON YOUR COMPUTER!

problock<-read.csv(“1block_200003_092212.csv”,as.is=1:15)

problock  区块链作业代写

 

Here’s the output showing we successfully loaded the CSV file in memory.

Now we can start using it for our calculations.

1

If you open the CSV file in Excel or your favorite spreadsheet application (or jut scroll left/right in R’s previous view above!), you’ll see that it contains various columns capturing data from block 200003, including the input and output addresses, as well as the amount of BTC moved (in satoshi units which is worth 10^-8 BTC). We’re going to use this matrix to construct our transaction graph.


  1. We only want the addresses and the amount moved. The below creates a list with from, to address, and value transferred (see c function in R)

problock<-problock[,c(“fromAddress”,”ToAddress”,”aggcoin” )]

This is now a weighted edge matrix similar to what we are used to in Lecture 6.

 


  1. Before we can actually use it using the same functions (from library igraph) as in lecture 6, we need to turn it into a graph

 

actors_problock<-data.frame(names=union(problock[,1],problock[,2]),stringsAsFactors = FALSE)

relations_problock<-data.frame(from=problock[,1],to=problock[,2],stringsAsFactors = FALSE,satoshi=problock[,3])

g_problock <- graph_from_data_frame(relations_problock, directed=TRUE, vertices=actors_problock)

 

we can now plot it:

 

library(igraph) # load the igraph library

plot(g_problock,layout=layout_with_gem,main="gem layout,Block 200003, unweighted",vertex.label=NA,vertex.size=2,edge.arrow.size=.2)

 


  1. Let’s go one step further and use the cluster_walktrap function in R to identify clusters and obtain striking visuals of key groupings of transactions in your graphs (just like is done in the sample R provided after the lecture)

wc <- cluster_walktrap(g_problock,weights = E(g_problock)$weight,membership=TRUE)

plot(wc,g_problock,vertex.label=NA,vertex.size=2,edge.arrow.size=.2)

 

To complete the questions, you’ll need to first successfully execute the above instructions.


The below questions will receive points.


  1. (6pts) For the graph in the edge matrix “problock”, based on what you know about the content of the CSV:

    1. What do the nodes of the corresponding graph represent?

    2. What do the edges represent?

    3. What do the weights represent?



  2. (3 pts) Paste the graph obtained from the preliminary instructions in section d.
    Comment in a very short explanation what you find striking about the transactions in this block based on the chart in preliminary section d.

  3. (6 pts) Using the graph obtained in preliminary.c. “g_problock” [TIP: you can use the exact same code as in lecture 6 if you create a variable g such that: g<- g_problock ]

    1. Analyze the group level centrality by charting the histogram of neighbor degree (use the function hist() to plot a histogram)

    2. Calculate the in-betweeness and sort it in a decreasing manner just like in lecture. What do you notice about the distribution?

    3. You can place the last sorted matrix into a variable v <- sort(b_bet,decreasing = TRUE) and extract the top address v[1] – are you able to find the address in popular known addresses from this page: https://ciphertrace.com/popular-addresses/? Provide a short explanation why this address would take the top rank in the in-betweenness matrix



Question 3 (10 Points)  区块链作业代写

We’re going to estimate Bitcoin’s value based on its user network.

 

Part 1

We’ll use Unique Addresses which in the Bitcoin ecosystem correspond to addresses that have a “non-zero balance” (or more specifically, addresses for which at least one UTXO>0).
These unique addresses will serve as a proxy to the number of users on the BTC network.

 


  1. Provide 2 reasons or factors that would cause an increase in unique addresses

  2. Provide 2 reasons or factors that would cause a decrease in unique addresses

 

Part 2

Metcalfe Law states that the value of a network is commensurate with the square of the number of users of that network. We’re going to see how well Bitcoin follows this law.

 

If Bitcoin were to follow this law it would mean that:

MV = alpha * UA ^ Beta, where beta = 2 for Metcalfe law and alpha is a constant

Or:

Ln(MV) =Ln(Alpha) + Beta * Ln(UA)

 

 

Preliminary – let’s load up user and market data:  区块链作业代写


  • Download Bitcoin’s unique address dataset


  • Similarly, download all market values for Bitcoin from: https://www.blockchain.com/charts/market-cap

  • Starting at Jan 2011, summarize the data by year and month such that you have the following columns:

    • Year

    • Month

    • Average count of unique addresses for the month - label this column UA

    • Average market value for the month – label this column MV



  • If you are not able to complete the above, I prepared a gsheet with the end result accessible via your lionmail account on google (you will not need to request access – if you do not have access, it means you are not loged into your Columbia google account).

 


  1. Calculate LN(UA) and LN(MV) for each month.
    If we assume that: Ln(MV) =Ln(Alpha) + Beta * Ln(UA), what is Beta equal to?
    (run a linear regression with LN(UA) and LN(MV) being known values – Gsheet can do so using the LINEST function but you can use another software if you prefer such as R)In one or two sentences max, comment on whether BTC appears to be following the Metcalfe Law.Python程序代写

    更多代写: HomeWork cs作业     金融代考    postgreSQL代写         IT assignment代写     统计代写   交通专业硕士毕业论文代写


发表回复

客服一号:点击这里给我发消息
客服二号:点击这里给我发消息
微信客服1:essay-kathrine
微信客服2:essay-gloria