Skip to content

Commit

Permalink
Merge branch 'master' into updates_to_guide_selector
Browse files Browse the repository at this point in the history
  • Loading branch information
Bayernatoor authored Feb 7, 2024
2 parents 314f68e + d03cd88 commit ff831d1
Show file tree
Hide file tree
Showing 29 changed files with 176 additions and 1,932 deletions.
Binary file added assets/bitcoin_whitepaper.pdf
Binary file not shown.
Binary file added bitcoin_whitepaper.pdf
Binary file not shown.
1,896 changes: 0 additions & 1,896 deletions btc-self-custody.excalidraw

This file was deleted.

2 changes: 1 addition & 1 deletion src/extras/accordion_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fn Menu(faq_title: String, faq_content: String) -> impl IntoView {
text-left text-gray-900 border border-b-0 border-gray-500 rounded-xl
hover:bg-[#3c6594]") aria-expanded="true" aria-controls="accordion-collapse-body"
on:click=move |_| { set_menu_clicked.update(|menu| *menu = !*menu)} >
<span class="text-white text-sm" inner_html=faq_title/>
<span class="text-white text-md" inner_html=faq_title/>
<svg data-accordion-icon class="w-3 h-3 rotate-180 shrink-0" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="white" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5 5 1 1 5"/>
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/faqs/bluewallet/blue_faq1.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**4\.** You'll be presented with 12 words - **WRITE THEM DOWN**.

&emsp; - *Seriously write down all **12 words** in the correct order on paper, these words*
&emsp; * *Seriously write down all **12 words** in the correct order on paper, these words*

&emsp; *are the **only way to recover** your bitcoin if you lose your phone*.

Expand Down
9 changes: 9 additions & 0 deletions src/faqs/general/general_faq01.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### What is bitcoin?

Bitcoin is money. Bitcoin is a store of value. Bitcoin is an exit.

&nbsp;

Bitcoin is as a trust minimized, permissionless, censorship resistant, peer to peer digital monetary system.
It's money for the digital age, controlled by no one, usable by everyone. It's an exit from the incumbent monetary system
which has grown old and tired.
11 changes: 11 additions & 0 deletions src/faqs/general/general_faq02.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Why Bitcoin?

Bitcoin is an exit. An exit from government issued fiat currencies. Currencies that undergo constant inflation, robbing you of your hard earned savings.
Bitcoin is the best savings mechanism ever discovered. It preserves your wealth as everything <ins><a href="https://www.pricedinbitcoin21.com/landing" target="_blank" rel="noopener noreferrer">priced in bitcoin</a></ins>
trends towards zero.

&nbsp;

Bitcoin allows you to store your energy and time in a decentralized, censorship resistant,
borderless and scarce bearer asset backed by <ins><a href="https://medium.com/bitcoin-tech-talk/the-anatomy-of-proof-of-work-98c85b6f6667" target="_blank" rel="noopener noreferrer">Proof of Work.</a></ins>

12 changes: 12 additions & 0 deletions src/faqs/general/general_faq03.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### Who invented bitcoin?

Bitcoin is the result of decades of research in cryptography and dozens of attempts at creating a digitally native money.

&nbsp;

In 2008 an anonymous person by the name of Satoshi Nakamoto released a whitepaper entitled
<ins><a href="/bitcoin_whitepaper.pdf" download="bitcoin_whitepaper.pdf" target="_blank">"Bitcoin: A Peer-to-Peer Electronic Cash System."</a></ins>
The bitcoin network went live on January 3rd, 2009 with the mining of the first block. The block itself
contained the following text in it's **op_return** data: *The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.*
See it <ins><a href="https://mempool.space/block/000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f"
target="_blank" rel="noopener noreferrer">here.</a></ins>
11 changes: 11 additions & 0 deletions src/faqs/general/general_faq04.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### Why bitcoin self-custody?

For the first time in human history bitcoin allows anyone to become financially self-sovereign.
That is to say, someone who owns and controls their bitcoin private keys and therefore their
wealth, without the need for a third party intermediary (e.g. banks).

&nbsp;

As the old bitcoin adage goes
**not your keys, not your coins**. For a deep dive on self-sovereignty and it's importance see this article by
<ins><a href="https://bitcoinmagazine.com/culture/bitcoin-self-custody-and-financial-sovereignty" target="_blank" ref="noopener noreferrer">Kudzai Kutukwa.</a></ins>
17 changes: 17 additions & 0 deletions src/faqs/general/general_faq05.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### What is a bitcoin transaction?

Simply put, a bitcoin transaction represents the transfer of value between 1 or more participants of the bitcoin network.

&nbsp;

A bitcoin transaction consists of 1 or more inputs and 1 or more outputs. Ultimately, all inputs/ouputs are
called *unspent transaction ouputs* or UTXO for short. The collection of all UTXOs is called the UXTO set, which
can be calculated & verified by anyone running a bitcoin node. This UTXO set is equal to all "bitcoins" in circulation.

&nbsp;

The UTXO set is constantly growing and shrinking depending on the transactions being broadcasted to the network.
UTXOs themselves are indivisible so in order to divide them, new UTXOs must be created.
You can consolidate multiple UTXOs into a single one or you can divide 1 UTXO into multiples. All of this
is done via bitcoin transactions.

12 changes: 12 additions & 0 deletions src/faqs/general/general_faq06.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
### What's a bitcoin mempool?

A <ins><a href="https://mempool.space/" target="_blank" rel="noopener noreferrer">bitcoin mempool</a></ins> contains a temporary record of all unconfirmed transactions.
Every node on the network maintains it's own mempool.

&nbsp;

You can visualize a mempool as follows. Imagine going to the dentist, you'll check-in at reception then wait in the waiting room. However,
this dentist is somewhat of a capitalist and will see patients based on the fee that they are willing to pay. The higher the fee, the quicker
you get to see the dentist. The lower the fee the longer you wait. Although simplified, the mempool works in a similar fashion. As transactions
get broadcasted they sit unconfirmed in the mempool waiting for a bitcoin miner to include them in their block template. Miners are incentivized to include
transactions based on their fee rate, the higher the fee, the sooner your transaction gets confirmed.
17 changes: 17 additions & 0 deletions src/faqs/general/general_faq07.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### How does bitcoin mining work?

Bitcoin mining consists of a person or group of people who use specialized mining computers & electricity to secure
the bitcoin network. These "miners" compete against one another by expending electricity to find a solution to a mathematical problem, also
known as the Proof of Work. The mathematical problem is meant to be solved on average every 10 minutes. When a miner finds a solution that matches
a predetermined pattern, they may add the block to the bitcoin blockchain. Miners who find solutions are rewarded with the fees included in the
transactions, as well as a coinbase transaction which rewards them with the current <ins><a href="https://en.bitcoin.it/wiki/Controlled_supply" target="_blank"
rel="noopener noferrer">block reward.</a></ins>

&nbsp;

The protocol stipulates that on average 1 block should be found every 10 minutes. It's important to remember
that this will fluctuate but that over the course of 2016 blocks the average block time should be ~10 minutes. In order to
account for additional miners joining the network and increasing the hashrate, the difficulty of the problem is adjusted
every 2016 blocks (~2 weeks). This is called *the difficulty adjustment* and is vital to the proper functioning of the protocol.


20 changes: 20 additions & 0 deletions src/faqs/general/general_faq08.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### What are transaction fees?

The bitcoin network is secured by miners and fees are paid to miners to include
your transaction in a block. Since each bitcoin block has limited space (~4mb) a fee market is created
based on market demand. As demand goes up (more transactions) the fee required to get included into a block
will increase. Fees are optional but highly recommended. In a high demand environment a transaction with no fee
will likely never get confirmed. Most wallets calculate the best fee for you based on when you'd like the transaction
to confirm, however, I always recommend double checking a <ins><a href="https://mempool.space" target="_blank" rel="noopened noreferrer">block explorer</a></ins>
to see the current feerate.

&nbsp;

Fees are calculated based on the size of the transaction in kilobytes and not the value in bitcoin. This is important to keep
in mind and has important considerations when receiving bitcoin, if you end up with many small UTXOs, the fee required to spend
them may outweigh their actual worth. Therefore, it's important to consolidate (combine) your UTXOs into larger ones when fees are low.

&nbsp;

For detailed information on fees, transactions and everything else bitcoin, I highly recommend the book
<ins><a href="https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1098150090/ref=sr_1_1?keywords=mastering+bitcoin+3rd+edition&sr=8-1" target="_blank" rel="noopener noreferrer">Mastering Bitcoin</a></ins> by Andreas Antonopoulos & David Harding.
File renamed without changes.
3 changes: 0 additions & 3 deletions src/faqs/general/general_faq1.md

This file was deleted.

1 change: 1 addition & 0 deletions src/faqs/general/general_faq10.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
### How should I store my private key?
11 changes: 11 additions & 0 deletions src/faqs/general/general_faq11.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
### What's a bitcoin wallet?

A bitcoin wallet is software that you download and install on your device. The wallet stores
your bitcoin private key. It does not itself store any actual bitcoin. Another term for bitcoin wallet is
bitcoin signing device. This term is more appropriate since a bitcoin wallet simply stores your keys and allows you
to create transactions and sign them using your private key. As long as you keep your bitcoin private key safe and secure you can access your funds using any modern bitcoin wallet.
See the <ins><a href="/guides">guides</a></ins> for our wallet recommendation.

&nbsp;

Wallets allow you to easily manage your UTXOs, view your balance and create transactions.
Empty file.
35 changes: 35 additions & 0 deletions src/faqs/general/general_faq13.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### What are some book recommendations?

**1\.** <ins><a href="https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1098150090/ref=sr_1_1?keywords=mastering+bitcoin+3rd+edition&sr=8-1" target="_blank" rel="noopener noreferrer">Mastering Bitcoin</a></ins> by Andreas Antonopoulos & David Harding

**2\.** <ins><a href="https://www.amazon.com/Grokking-Bitcoin-Kalle-Rosenbaum/dp/1617294641/ref=sr_1_1?keywords=grokking+bitcoin&sr=8-1" target="_blank" rel="noopener noreferrer">Grokking Bitcoin</a></ins> by Kalle Rosenbaum

**3\.** <ins><a href="https://www.amazon.com/Bullish-Case-Bitcoin-Vijay-Boyapati/dp/1737204118/ref=tmm_pap_swatch_0?_encoding=UTF8&sr=8-1" target="_blank" rel="noopener noreferrer">The Bullish Case For Bitcoin</a></ins> by Vijay Boyapati

**4\.** <ins><a href="https://www.amazon.com/21-Lessons-Learned-Falling-Bitcoin/dp/1697526349/ref=tmm_pap_swatch_0?_encoding=UTF8&sr=8-2" target="_blank" rel="noopener noreferrer">21 Lessons</a></ins> by Gigi

**5\.** <ins><a href="https://academy.saifedean.com/product/broken-money-hardcover/" target="_blank" rel="noopener noreferrer">Broken Money</a></ins> by Lyn Alden

**6\.** <ins><a href="https://academy.saifedean.com/product/tbs-hardcover/" target="_blank" rel="noopener noreferrer">The Bitcoin Standard</a></ins> by Saifedaen Ammous

**7\.** <ins><a href="https://www.amazon.com/Bitcoin-Technical-innovations-Sjors-Provoost/dp/9090360425" target="_blank" rel="noopener noreferrer">Bitcoin: A Work In Progress</a></ins> by Sjors Provoost

**8\.** <ins><a href="https://academy.saifedean.com/product/gradually-then-suddenly-hardcover/" target="_blank" rel="noopener noreferrer">Gradually, Then Suddenly</a></ins> by Parker A. Lewis

**9\.** <ins><a href="https://store.bitcoinmagazine.com/collections/books/products/check-your-financial-privilege" target="_blank" rel="noopener noreferrer">Check Your Financial Privilege</a></ins> Alex Gladstein

**10\.** <ins><a href="" target="_blank" rel="noopener noreferrer">Mastering The Lightning Network</a></ins> by Andreas Antonopoulos & Olaoluwa Osuntokun

**11\.** <ins><a href="" target="_blank" rel="noopener noreferrer">Layered Money</a></ins> Nik Bhatia

**12\.** <ins><a href="https://braiins.com/books/bitcoin-mining-handbook" target="_blank" rel="noopener noreferrer">Bitcoin Mining Handbook</a></ins> by Daniel Frumkin

**14\.** <ins><a href="https://braiins.com/books/bitcoin-mining-economics" target="_blank" rel="noopener noreferrer">Bitcoin Mining Economics</a></ins> by Daniel Frumkin

**14\.** <ins><a href="https://braiins.com/books/bitcoin-separation-of-money-and-state" target="_blank" rel="noopener noreferrer">Bitcoin: Separation of Money and State </a></ins> by Josef Tětek

**15\.** <ins><a href="https://store.bitcoinmagazine.com/collections/books/products/cryptosovereignty" target="_blank" rel="noopener noreferrer">Cryptosovereignty</a></ins> by Erik Cason

**16\.** <ins><a href="https://store.bitcoinmagazine.com/collections/books/products/bitcoin-is-venice" target="_blank" rel="noopener noreferrer">Bitcoin is Venice</a></ins> by Allen Farrington & Sacha Meyers

**17\.** <ins><a href="https://store.bitcoinmagazine.com/collections/books/products/the-genesis-book" target="_blank" rel="noopener noreferrer">The Genesis Book</a></ins> by Aaron van Wirdum
1 change: 0 additions & 1 deletion src/faqs/general/general_faq2.md

This file was deleted.

2 changes: 0 additions & 2 deletions src/faqs/general/general_faq3.md

This file was deleted.

1 change: 0 additions & 1 deletion src/faqs/general/general_faq5.md

This file was deleted.

1 change: 0 additions & 1 deletion src/faqs/general/general_faq6.md

This file was deleted.

1 change: 0 additions & 1 deletion src/faqs/general/general_faq7.md

This file was deleted.

1 change: 0 additions & 1 deletion src/faqs/general/general_faq8.md

This file was deleted.

1 change: 0 additions & 1 deletion src/faqs/general/general_faq9.md

This file was deleted.

31 changes: 15 additions & 16 deletions src/routes/beginner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ pub fn BeginnerPageTemplate(
intro: String,
) -> impl IntoView {
// used for onlick to determine which button was clicked
let (_samourai_clicked, _set_samourai_clicked) = create_signal(false);
let (_samourai_clicked, set_samourai_clicked) = create_signal(false);
let (_blue_clicked, set_blue_clicked) = create_signal(false);
let (_green_clicked, _set_green_clicked) = create_signal(false);
let (_green_clicked, set_green_clicked) = create_signal(false);

// set the button details
let (_samourai_details, set_samourai_details) = create_signal(false);
let (_blue_details, set_blue_details) = create_signal(false);
let (_green_details, _set_green_details) = create_signal(false);
let (_green_details, set_green_details) = create_signal(false);

// get current path via RouteContext
let path = get_current_path();
Expand All @@ -141,11 +141,11 @@ pub fn BeginnerPageTemplate(
let text_color_blue = "#1a578f".to_string();

// BlockStream Green wallet assets
let _wallet_name_green = "BlockStream Green".to_string();
let _short_desc_green = "Self-Custody Made Easy".to_string();
let _img_url_green = "./../../nav_green.svg".to_string();
let _img_alt_green = "BlockStream Green".to_string();
let _text_color_green = "#0a7b46ff".to_string();
let wallet_name_green = "BlockStream Green".to_string();
let short_desc_green = "Self-Custody Made Easy".to_string();
let img_url_green = "./../../nav_green.svg".to_string();
let img_alt_green = "BlockStream Green".to_string();
let text_color_green = "#0a7b46ff".to_string();

// DOM elements are only available when used within a create_effect see --> https://leptos-rs.github.io/leptos/ssr/24_hydration_bugs.html#not-all-client-code-can-run-on-the-server
// create_effect(move |_| {
Expand Down Expand Up @@ -190,16 +190,15 @@ pub fn BeginnerPageTemplate(
<Show
when=move || platform() == *"android"
fallback= move || view! {
// comment out greenWallet for now leaving 1 wallet option for IOS
// { <WalletButton on_click = move |_| {set_green_clicked(true);
// set_green_details(true)}
// samourai=false blue=false _green=true platform=platform()
// wallet_title=wallet_name_green.clone() short_desc=short_desc_green.clone() img_url=img_url_green.clone() img_alt=img_alt_green.clone()
// text_color=text_color_green.clone()
// />}
<WalletButton on_click = move |_| {set_green_clicked(true);
set_green_details(true)}
selected_wallet=WalletName::Green platform=platform()
wallet_title=wallet_name_green.clone() short_desc=short_desc_green.clone() img_url=img_url_green.clone() img_alt=img_alt_green.clone()
text_color=text_color_green.clone()
/>
}
>
<WalletButton on_click = move |_| {_set_samourai_clicked(true); set_samourai_details(true);}
<WalletButton on_click = move |_| {set_samourai_clicked(true); set_samourai_details(true);}
selected_wallet=WalletName::Samourai platform=platform()
wallet_title=wallet_name_samourai.clone() short_desc=short_desc_samourai.clone() img_url=img_url_samourai.clone() img_alt=img_alt_samourai.clone()
text_color=text_color_samourai.clone()
Expand Down
8 changes: 2 additions & 6 deletions src/routes/faq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ use leptos::*;
#[component]
pub fn FaqPage() -> impl IntoView {
view! {
<div id="about" class="flex flex-col max-w-3xl mx-auto pb-10 animate-fadeinone">
<div class="flex flex-col p-6 pt-10 max-w-3xl mx-auto">
<h1 class="flex text-[36px] text-white font-semibold">"The Bitcoin Barrack Help Desk"</h1>
<div id="about" class="flex flex-col max-w-3xl mx-auto p-6 md:pt-10 animate-fadeinone">
<h1 class="flex text-[36px] text-white font-semibold text-center justify-center">"The Bitcoin Help Desk"</h1>
<div class="flex flex-col items-center w-full py-4">
<h2 class="text-xl text-white py-2">"Commonly asked questions:"</h2>
</div>
<div>
<AccordionMenu faq_name="general".to_string()/>
</div>
<div class="flex flex-col items-center pt-6">
<p class="text-sm text-white">"Need additional help? Reach out to me by email: "<a class="underline text-[#678096] hover:text-[#3c6594]" href="mailto:Bayernator@protonmail.com" target="_blank" rel="noopener noreferrer">Bayernator@protonmail.com</a></p>
<br />
Expand All @@ -23,7 +20,6 @@ pub fn FaqPage() -> impl IntoView {
<img src="./../../../simplexqr.png" alt="simplex_qr_code" width="150" height="150"/>
</div>
</div>
</div>
</div>
}
}
2 changes: 1 addition & 1 deletion tests/health_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ async fn spawn_app() -> TestApp {
TcpListener::bind("127.0.0.1:0").expect("Failed to bind random port");
// retrieve random port assigned to us by OS
let port = listener.local_addr().unwrap().port();
println!("spawn app port: {:?}", &port);
let address = format!("http://127.0.0.1:{}", port);

let mut configuration =
get_configuration().expect("Failed to read configuration.");

configuration.database.database_name = Uuid::new_v4().to_string();
let connection_pool = configure_database(&configuration.database).await;

Expand Down

0 comments on commit ff831d1

Please sign in to comment.