What is a mechanism of providing Merkle Path?

In the Bitcoin, SPV node can query that its transaction is included specific block to full node that provides merkle path which has super fast calculation.

In terms of full nodes, they have full-ledger and merkle tree that is consist of transaction tree. so they can find some transaction queried by SPV node(light node) but my question is that how they can efficiently find it?

They may dislike compute to find transaction if they have to sequence search because they are busy to find hash value of block to earn block reward.

Sorry for my English.

For how long has a channel been inactive?

I would like to close channels for which there is enough evidence that the remote node disappeared and won’t come back.
So my idea was to check for how long a channel has been inactive, and if it is > two months to close that channel.

How could I find out for how long a channel has been inactive (in LND)? Finding out which channels are inactive is easy by queryinglncli listchannels --inactive_only, but the result does not show any indicator about how long that channel has been inactive.

Why does bitcoin-cli not know about working directory of bitcoind?

I have a /ect/systemd/system/bitcoin.service with the following content and I am wondering, why bitcoin-cli getinfo tells me about a configuration file elsewhere:

error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set.  See -rpcpassword and -stdinrpcpass.  Configuration file: (/home/pi/.bitcoin/bitcoin.conf)

Content of bitcoin.service, especially -conf=/home/bitcoin/.bitcoin/bitcoin.conf:

[Unit]
Description=Bitcoin daemon
After=network.target
[Service]
ExecStart=/usr/local/bin/bitcoind -conf=/home/bitcoin/.bitcoin/bitcoin.conf -pid=/home/bitcoin/.bitcoin/bitcoind.pid
# Creates /run/bitcoind owned by bitcoin
RuntimeDirectory=bitcoind
User=bitcoin
Type=forking
PIDFile=/home/bitcoin/.bitcoin/bitcoind.pid
Restart=on-failure
# Hardening measures
####################
# Provide a private /tmp and /var/tmp.
PrivateTmp=true
# Mount /usr, /boot/ and /etc read-only for the process.
ProtectSystem=full
# Disallow the process and all of its children to gain
# new privileges through execve().
NoNewPrivileges=true
# Use a new /dev namespace only populated with API pseudo devices
# such as /dev/null, /dev/zero and /dev/random.
PrivateDevices=true
# Deny the creation of writable and executable memory mappings.
MemoryDenyWriteExecute=true
[Install]
WantedBy=multi-user.target

Ironically, encryption is not an important part of bitcoin (?)

The above statement is taken out of a book which I’ve been reading: Mastering Bitcoin 2nd Edition.

…as its communications and transaction data are not encrypted and do
not need to be encrypted to protect the funds…

Just started about bitcoin, going through the third chapter and when I come across the above lines, I merely struck by one question, and that is, if the communication happens between (peers’ / wallet to bitcoin network) is not encrypted…then I am just thinking a scenario

X is sending BTC to Z (obviously by mentioning Z’s address in txn)

Y (bad guy) cuts in the communication which is not encrypted (as per the above reading) and tampers the transaction that X has been sent ( by Just putting his address in beneficiary )

I mean, honestly, it is a very naive scenario that anyone could think of and I know there would be something in bitcoin (which I am not aware of) could prevent this from happening, so, giving clarification on how this kind of attacks being handled or mitigated in Bitcoin would be much helpful for this post.

Send or receive bitcoins with bitcoin-cli without downloading full blockchain

I have successfully downloaded, compiled and installed bitcoin-cli from github.

I can send or receive bitcoins with sendtoaddress and getnewaddress methods.

It works great and i am happy to do that without install third party software (i do not trust them)

But i have a problem: I need to download the full blockchain files (with bitcoind) on my computer.

Is there a way to run sendtoaddress and getnewaddress methods with having only wallet.dat file on my computer ? I do not want to download the full blockchain files. Is it possible ?

How works ledger wallet key ? This small key does not contain a copy of the blockchain. And it works !

Thanks

can we make a blockchain that works like torrent?

Is it possible to make a blockchain system that allows you to download specific blocks from the blockchain instead of the whole blockchain?

In my case for example, I only need 1 giga of the whole chain, so why do I have to download all the blocks? I understand that this is done to make sure that the chain doesn’t get tampered with and so on…

But is it possible to make it like a torrent file? where you can download only the files that you need, and no need to download everything with it.

bitcoin-cli getnewaddress

can i customize my address start through getnewaddress?

for example instead the address start with 1asdjIOAWJRA

i write getnewaddress 1xxxx then it continues as it wish

also what’s the difference between addresses starting with 1 and addresses starting with 3?

can i choose from bitcoin-cli to get my address starting with 1 or it must be random and can be started by 3 while i dont wish that?

the reason of the need to customized addresses to make sure that it really creates this offline addresses instantly and is not in a hidden database installed while installing the bitcoin-cli

Why is the winner of Pow different everytime?

I just read about how miners have to change the nonce bit in order to find an hash below a certain result.

Granted each miner process it the same way, incrementally, adding 1 and hashing, adding one and hashing, what prevents the most powerful computer on the network to snatch all rewards?

I feel like beside the moment each miner starts mining a block, there’s no room for luck and a lesser powerful machine, to ever add a block.