how to generate bitcoin adddres using seed?

Hi i am new to bitcoin all i want to know is how to generate address using mnemonic seed?

let testnet =Bitcoin.networks.testnet;
let keypair =Bitcoin.ECPair.makeRandom({network:testnet});
let address=keypair.getAddress();
let privateKey=keypair.toWIF();
res.json("Public Address  "+ address+ "  "+privateKey)

Proof of work – lottery approach

I’m sure I am missing something here. But not sure what …

Proof of work – after all is said and done, when a hash is found (about 10 min), it is said to be like someone hitting the lottery. Anyone that wins the lottery should be able to prove that a cost was incurred. So there are two things:

  1. Include a cost to finding the hash.
  2. The winner is considered “random” because finding the hash is an iterative guessing process.

The result is a huge energy burn and the result “mimics” a random winner.

QUESTION: Can the bitcoin network randomly select a subset of the existing nodes, for each block, who then compete to solve the hash? For example, if there are 100,000 nodes, the network randomly selects 10% or 10,000 nodes who are allowed to compete to find the hash. Or take it to a smaller number like 1% or 1,000 nodes, etc.

The burning question is: Why can we not mimic the proof of work process and save a ton of energy along the way?

Why not have all the nodes that wish to enter each block lottery pay a small fee. They all currently incur electricity cost so from a financial standpoint, does it matter whether they pay a small lottery fee or pay a small fee to the electric company?

EXAMPLE: for the next block, here is the process:

  1. All 100,000 nodes pay (arbitrary number for now to make point) 1000
    satoshis.
  2. The bitcoin network randomly (maybe this is tricky part)
    selects a subset percentage. Say 10% or 10,000 nodes. These are the nodes that compete for the next block entry.

BENEFITS:

  1. There is still a cost incurred by each participant without the energy usage.
  2. The energy usage is now a fraction of the total network participation for the iterative hash search.
  3. It can allow more node participation by less powerful computers. A laptop will still be at a disadvantage, but is now competing against 9,999 other computers instead of the hashing power of the entire network.

To make sense of this is the fact that the end result of the current process is a “random” winner that can prove a cost has been incurred.

Can the lottery fee approach achieve the same goal without sacrificing security?

How do nodes come to consensus on whether a timestamp is valid?

From bitcoin wiki:

A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours.

If a miner submits a block timestamp on the cusp of the network-adjusted time + 2 hours threshold, some nodes will see the block as valid and some will see the block as invalid, regardless of the work done on the block. How do nodes come to consensus on whether the block is valid?

Why future Bitcoin Core release shouldn’t be in python?

Python offers various advantages including simplified rules of coding and ease of readability. It offers OOP, cross platform compatibility and has numerous libraries that have been added over time. It can be understood why the original Bitcoin Core client was in C++ as python was not that popular as it is now.

Apart, from having to tear down the entire code, and re-write it in python and check for vulnerabilities, why aren’t the core bitcoin developers thinking of migrating the entire reference client implementation language to python?

How to backup seed in lightning and give your channel to watchtower

this is followup on question #85475:

I have learned in previous question that there is an automatic refund mechanism in case of force closure of a channel, except for some very rare circumstances. I would like to ask about two of those circumstances:
,

1-how to “back up your channel state” or how to back up your seed in lightning?
(is “channel state” here a synonym for “seed”?)

And why do people say the “seed” works differently in lightning compared to btc – differently how?
,

2-how can you “give your channel to a watchtower” ? IN practical terms, if you use a current lightning wallet

thanks

Are Bitcoin wallet apps on iOS truly decentralised

The only offering for p2p support on iOS that I’m aware of is the MultipeerConnectivity framework. Based on its documentation, it only seems to support nearby devices (ref: https://developer.apple.com/documentation/multipeerconnectivity).

Now, by “truly decentralised”, I mean no use of a backend whatsoever.

Perhaps there’s something I might be missing. If wallet apps are indeed, truly decentralised, how do they achieve this?

Need to use two bitcoin core but issue with syncing

Need to know how we can use two bitcoin node for example. I do have two bitcoin full nodes A and B. Created wallet address at A and has all transaction details at wallet.db in node A. But I need to keep PK in DB and take those and send request to B node, but it fails as it dont have all transaction details, I dont want to re scan B node every time, is there any way we can achieve this. So that i dont need to worry on which node my request is going.

Thanks,
Prad