text:
In the Taproot implementation of Schnorr signatures, is "e" the hash of R or r?
BIP340 describes the Schnorr signature scheme that will be implemented with Taproot.
The signature scheme involves computing an integer, e, during both signing and verification.
Under Default Signing, e is defined as

Let e = int(hashBIP0340/challenge(bytes(R) || bytes(P) || m)) mod n.

Under Verification, it is defined as

Let e = int(hashBIP0340/challenge(bytes(r) || bytes(P) || m)) mod n.

It seems to me that a the signature is valid only if e has an unambiguous definition.
Does it use the curve point, R, or its x-coordinate, r?
Link to the BIP340-documentation: https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki

The bytes() function is defined in BIP 340 as:

The function bytes(x), where x is an integer, returns the 32-byte
encoding of x, most significant byte first.
The function bytes(P), where P is a point, returns bytes(x(P)).

Hence the bytes() function of a point is defined to return the same as the bytes() function of the x coordinate. The y coordinate is thrown away in the case that a point is fed into the bytes() function.

This clarifies it. Thank you!


text:
Transaction not confirmed
It is the first time I use Bitcoin.
I have made an transaction this earlier today. But the receiver informed me that they did not received the transaction on their end. I have looked on Blockchain Explorer. But I do not really understand.
I can see the transaction in question. It states "unconfirmed". Should I just wait, or is there a way to check how many "conformations" the transaction have?
Transaction ID: 83b8fa7226f7c849840c24f4534de5638b3946d612a49953b6919f9ad2ecaa35
Address:3GsUCvwQ2XcUqHjKB5p2nE4txhbdFn9Ttb
If someone can please assist me to verify the status of this transaction.
Thank you.

The transaction you're commenting on confirmed 6 hours ago.

Thank you, What can I use as proof to send to the receiver?

As proof you can use https://blockchair.com/bitcoin/transaction/83b8fa7226f7c849840c24f4534de5638b3946d612a49953b6919f9ad2ecaa35 and/or https://live.blockcypher.com/btc/tx/83b8fa7226f7c849840c24f4534de5638b3946d612a49953b6919f9ad2ecaa35/ and/or many other "blockchain explorers"

Thank you all. Let me try.

Hi All, Sorry to ask again.

Hi All, Sorry to ask again. I have check the status on Blockchair.  There are 2 entries first: 24 Sept, 2021 07:46 AM UTC - Status: confirmed - But at 24 Sept,2021 09:16 AM UTC - Status: pending conformation. The times are are confusing.  one and half hours after "confirmed", it changes back to "pending"  Could this be a problem?    Thank you in advance.

@LawrencedeSmidt: I'm not sure I follow. The transaction was included 55 blocks ago. Where do you see the "pending confirmation"? It is a common scammer tactic to claim that transactions were not received, but this one definitely has been for multiple hours.

I don't see what you see. I see that transaction ID with a time-stamp 0f 0746 UTC and 55 confirmations. 55 confirmations means the recipient has definitely received the money. What blockchair URL shows something at 0916 UTC?

You may be looking at subsequent transaction 80dfa6ad9b44854d1d18bfb4299df16de931423f2b6b023702451121ef35e644 where the recipient has spent the money you sent them.   ---- to summarise, at 0746 they received your money. At 0916 they spent it.

Thanx again. So bottom line here: Person stole my money. and there is nothing I can do??

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How do I increase the maximum number of outbound peers?
How can I increase the maximum number of outbound peers bitcoin core can connect to? I can't seem to be able to connect to more than 10. I've tried using the -maxconnections flag but it doesn't seem to have any effect.

There's no option for doing this. You won't see any improvement in sync speed, transaction confirmation speed, and it doesn't meaningfully increase security or reliability by increasing the number of outbound transactions.

The comment is an answer.

Bitcoin Core will only make a limited number of outbound connections. In particular:

Up to 10 outbound connections

8 normal outbound connections
2 block-only outbound connections

Up to 8 manual connections (using -addnode command line, addnode= config line, or addnode RPC).

These limits cannot be changed without modifying the source code. In general, there is very little reason for doing so, as it doesn't increase confirmation speed, processing speed, or reliability. Early in Bitcoin's history there have been periods where the network ran out of connection slots (inbound-capable peers times the number of incoming connections they accept), so Bitcoin Core's developers are loathe to add features to go beyond the standard number.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Who are Merawing.net
Hello I have been contacted by this company saying about your withdrawal process.
As I told you at the moment your funds are in the Blockchain system. With the help of artificial intelligence, we have the option of tracking the transaction that was carried out from your account on the Blockchain system.
Approximate amount of withdrawal 3.6btc
The reservation amount 0.05btc
0.05btc this is a requirement of the Blockchain system. This amount will be frozen inside of the system for a period of two hours approximate. The money can't just disappear. By this step you will activate system for the withdrawal.
The above is from Merawing.net. And would like confirmation that this is a SCAM

Yes, what you have described is a scam.

Definitely a scam


text:
Learning bitcoin from scratch
If someone wants to learn bitcoin and blockchain from the cratch please recommend the best resources for     a)free and b) paid sources   thank you   e

"Learn me a bitcoin", the bitcoin.it wiki, the chaincodelabs curriculum...


text:
mining pool with eloipool, fires up port but cannot connect
I am trying to get eloipool up and running in a solo mining configuration using this installation https://bitcointalk.org/index.php?topic=158105.0 eolipool starts up error free but clients cannot connect. The port is up and no visual errors in any log. tcpdump does show the packets hitting the port.
I followed the directions and I get no errors. Port 8338 comes live and can be seen via netstat.
tcp6      15      0 :::8338                 :::*                    LISTEN
tcp6       0      0 :::22                   :::*                    LISTEN
tcp6      70      0 192.168.1.8:8338        192.168.1.8:33885       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33896       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33890       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33897       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33899       CLOSE_WAIT
tcp6      70      0 192.168.1.8:8338        192.168.1.8:33892       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33895       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33891       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33900       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33889       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33894       CLOSE_WAIT
tcp6      71      0 192.168.1.8:8338        192.168.1.8:33898       CLOSE_WAIT
tcp6      70      0 192.168.1.8:8338        192.168.1.8:33887       CLOSE_WAIT
tcp6      70      0 192.168.1.8:8338        192.168.1.8:33884       CLOSE_WAIT
tcp6      70      0 127.0.0.1:8338          127.0.0.1:49649         CLOSE_WAIT

gentoo001 home # ./minerd -o stratum+tcp://192.168.1.8:8338 -u admin -p butthole -q
[2014-01-18 22:51:19] 1 miner threads started, using 'scrypt' algorithm.
[2014-01-18 22:51:19] Starting Stratum on stratum+tcp://192.168.1.8:8338
[2014-01-18 22:51:49] stratum_subscribe timed out
[2014-01-18 22:51:49] ...retry after 30 seconds
[2014-01-18 22:52:49] stratum_subscribe timed out
[2014-01-18 22:52:49] ...retry after 30 seconds

gentoo001 eloipool # cat config.py
# Please note that config files are Python source code!
# A common mistake is to put an option list (such as TemplateChecks,
# JSONRPCAddresses, etc) excluding the final comma.
# For example (this is WRONG):
#     JSONRPCAddresses = (
#         ('', 8337)  # <-- there must be a comma after EVERY item, even last
#     )
# Without the final comma, should the option list ever have only one item in
# it, Python would interpret the "main" parenthesis as a mere sub-expression
# instead of a list of values. If that occurs, you might get crazy errors, or
# things might just not work correctly. Be careful to not miss the commas.

### Settings relating to server identity

# Name of the server
ServerName = 'Whirpools'

### Settings relating to server scaling/load

# Share hashes must be below this to be valid shares
# If dynamic targetting is enabled, this is a minimum
ShareTarget = 0x000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Automatically adjust targets per username
# 0 = disabled
# 1 = arbitrary targets
# 2 = power of two difficulties (zero bit counts)
DynamicTargetting = 2

# How many shares per minute to try to achieve on average
DynamicTargetGoal = 6

# Number of seconds hashrate is measured over
DynamicTargetWindow = 120

# Minimum and maximum of merkle roots to keep queued
WorkQueueSizeRegular = (0x100, 0x1000)

# Minimum and maximum of BLANK merkle roots to keep queued
# (used if we run out of populated ones)
WorkQueueSizeClear = (0x1000, 0x2000)

# Minimum and maximum of BLANK merkle roots to keep queued, one height up
# (used for longpolls)
WorkQueueSizeLongpoll = (0x1000, 0x2000)

# How long to wait between getmemorypool updates normally
MinimumTxnUpdateWait = 5

# How long to wait between retries if getmemorypool fails
TxnUpdateRetryWait = 1

# How long to sleep in idle loops (temporary!)
IdleSleepTime = 0.1

### Settings relating to reward generation

# Address to generate rewards to
TrackerAddr = '13siH3VpL4nwJCXpWnMMAaSZCAz9EVsNCv'  # testnet

# Coinbaser command to control reward delegation
# %d is replaced with the total value of the block reward (in satoshis)
# %p is replaced with the previous block hash in hexadecimal
# NOTE: This example donates 1% of block rewards to Luke-Jr for Eloipool development
#CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'

### Settings relating to upstream data providers

# JSON-RPC servers to get block templates from
# See https://en.bitcoin.it/wiki/BIP_0023#Logical_Services for key details
TemplateSources = (
        {
                'name': 'primary',
                'uri': 'http://admin:"bunghole"@localhost:8332',
                'priority': 0,
                'weight': 1,
        },
        {
                'name': 'secondary',
                'uri': 'http://admin:"bunghole"@localhost:18332',
                'priority': 1,
                'weight': 1,
        },
)

# JSON-RPC servers to check block proposals with
# If none provided, and selected source supports proposals, it alone will also
# be used for checking
# NOTE: Any servers listed here MUST support BIP 23 Block Proposals
# NOTE: Mainline bitcoind (as of 0.8) does NOT support this (though the 0.8.0.eligius branch does)
TemplateChecks = (
#       {
#               'name': 'primary',
#               'uri': 'http://admin:"bunghole"@localhost:8332',
#
#               # If 'unanimous' is true, no template will be used if this node
#               # rejects it
#               'unanimous': False,
#
#               # If check servers disagree on all templates, they will be scored and
#               # the highest score will be used; 'weight' can be used to control the
#               # scoring per-server
#               'weight': 1.1,
#       },
#       {
#               'name': 'secondary',
#               'uri': 'http://admin:"bunghole"@localhost:18332',
#               'unanimous': False,
#               'weight': 1,
#       },
)

# JSON-RPC servers to submit found blocks to (when they meet the full target)
# The specific TemplateSource that the block was based on will always be sent
# the block first.
# If setting is not specified, or None, full TemplateSources list will be used.
# If an empty list, no extra submissions will be attempted.
# If an empty list, and the block was found on a "clear" merkle root (not based
# on any TemplateSource), the full TemplateSources list will be used.
BlockSubmissions = (
        {
                'name': 'primary',
                'uri': 'http://admin:"bunghole"@localhost:8332',
        },
        {
                'name': 'secondary',
                'uri': 'http://admin:"bunghole"@localhost:18332',
        }
)

# Templates will not be used unless they have an acceptance ratio above this
# Range: 0.00 - 1.00
MinimumTemplateAcceptanceRatio = 0

# No template with a combined total score below this will be used
MinimumTemplateScore = 1

# Set to True if you want shares meeting the upstream target to wait for a
# response from an upstream server before logging them. Otherwise, for such
# shares, upstreamResult will always be True and upstreamRejectReason will
# always be None. Note that enabling this may cause shares to be logged out of
# order, or with the wrong timestamp (if your share logger uses the log-time
# rather than share-time).
DelayLogForUpstream = True

# Bitcoin p2p server for announcing blocks found
UpstreamBitcoindNode = ('127.0.0.1', 8333)  # mainnet

# Network ID for the primary blockchain
# Other known network IDs can be found at:
#     https://en.bitcoin.it/wiki/Protocol_specification#Message_structure
#UpstreamNetworkId = b'\x0b\x11\x09\x07'  # testnet3
UpstreamNetworkId = b'\xF9\xBE\xB4\xD9'

# Secret username allowed to use setworkaux
#SecretUser = ""

# URI to send gotwork with info for every share submission
#GotWorkURI = ''

# Share hashes must be below this to be submitted to gotwork
GotWorkTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff

# Aim to produce blocks with transaction counts that are a power of two
# This helps avoid any chance of someone abusing CVE-2012-2459 with them
# 1 = cut out feeless transactions; 2 = cut out even fee-included transactions (if possible)
#POT = 2

# Avoid mining feeless transactions except to satisfy POT
# Note this only works if POT is in fact enabled in the first place
Greedy = False

### Settings relating to network services
# Note that Eloipool only supports IPv6 sockets, and if you want to bind to an
# IPv4 address you will need to prepend it with ::ffff: eg ::ffff:192.168.1.2

# Addresses to listen on for JSON-RPC GBT/getwork server
JSONRPCAddresses = (
        ('', 8337),
)

# Addresses to listen on for Stratum mining server
StratumAddresses = (
        ('', 3334),
)

# Addresses to listen on for Bitcoin node
# Note this will only be used to distribute blocks the pool finds, nothing else
BitcoinNodeAddresses = (
        ('', 8338),
)

# Addresses that are allowed to "spoof" from address with the X-Forwarded-For header
TrustedForwarders = ('::ffff:127.0.0.1',)

# Logging of shares:
ShareLogging = (
        {
                'type': 'logfile',
                'filename': 'share-logfile',
                'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n",
        },
        {
                'type': 'sql',
                'engine': 'mysql',
                'dbopts': {
                        'host': 'localhost',
                        'db': 'pools',
                        'user': 'admin',
                        'password': 'bunghole',
                },
                'statement': "insert into shares (rem_host, username, our_result, upstream_result, reason, solution) values ({Q(remoteHost)}, {username}, {YN(not(rejectReason))}, {YN(upstreamResult)}, {rejectReason}, unhex({solution}))",
#       },
#       {
#               'type': 'sql',
#               'engine': 'sqlite',
#               'dbopts': {
#                       'database': 'share.db',
#               },
#               'statement': "insert into shares (remoteHost, username, rejectReason, upstreamResult, solution) values ({remoteHost}, {username}, {rejectReason}, {upstreamResult}, {solution})",
        },
)

# Authentication
# There currently are 2 modules.
# - allowall will allow every username/password combination
# - simplefile will use the username/passwords from a file, which contains username<tab>password\n with no \n on the last line.
Authentication =  (
        {
                'module': 'allowall',
        },
#       {
#               'module': 'simplefile',
#               'filename': 'userdatabase',
#       },
)

### Settings related to poolserver logging

# By default, significant events will be printed to the interactive console
# You can customize your logging using either simple parameters, or Python's advanced logging framework
# Note that using Python's logging framework will override the default console logging!

# To simply log everything to the system log (syslog) as well:
# LogToSysLog = True

# To make a log file:
# LogFile = 'filename.log'

# For a rotating log file:
LogFile = {
        'filename': 'eolipool.log',
        'when': 'midnight',
        'backupCount': 7,
}
# For details, see:
# http://docs.python.org/3/library/logging.handlers.html#logging.handlers.TimedRotatingFileHandler

Maybe you're being blocked from using the port? Are you on windows?

no windows, only Linux. I tried minerd for cpu and cgminer for ASIC. Both failed in the same manner. Firewall is off and I can bring port 8338 up and down via script.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
worker keeps getting temp banned with sgminer
I have 3 R9 280x sapphires I use with sgminer
On almost every single pool, with or without --no-submit-stale, after about 5 min of hashing, my worker get's banned and hashing drops to zero. If I lower the intensity, I barely get 500mh/s if that. If I set it to 13, it runs normal, but I get banned?
sgminer -o stratum+tcp://neo.cryptcoins.net:3331 -u user.worker -p x -I 13 -D -P --no-submit-stale

How can I prevent from getting banned with a decent hash rate?
[18:58:33] RECVD: , "Worker is temporarily banned", null], "id": 666, "result":

Here's a mention of banning I found looking through the stratum-miner source code. Excessive sending of invalid shares or shares above indicated target (see Stratum mining docs for set_target()) may lead to temporary or permanent ban of user,worker or IP address.. Maybe your config settings are wrong?

@Jacob Torba That sounds correct. But I have no idea where to begin looking. sgminer doesn't have a .conf  :(

Look for error messages in output?

@Jacob Torba  Just this, and nothing else, in any log file.  [18:58:33] RECVD: , "Worker is temporarily banned", null], "id": 666, "result":
null}
JSON decode failed(1): end of file expected near ','

@dooode Post your issue here - https://github.com/veox/sgminer/issues?milestone=2&state=open

@Jacob Torba I posted there and they blamed the pool. I have since built a second miner using non sapphire r9 290 and on a different ASUS board but exact same settings and they don't get banned and I crank them up. It's got to be a hardware or driver conflict, but I see nothing in the logs.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Stratum + MPOS pool question
This is the first pool I have configured so forgive my n00bness.
https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide
I completed the guide and everything appears to fire up correctly though when a client connects, he only receives rejections.
What step am I missing?
I have a suspicion that being on a 'test network' vs the Litecoin network via the 'how to' is a little suspicious, but I am new to the software and not sure how it works yet.
http://bpaste.net/show/z0oOnziLKekXmuW7pEKy/

I have no firewall

http://bpaste.net/show/jssOUYVrMP3ckdaZomfq/

asterisk1 home # ./minerd -o stratum+tcp://domain.com:19334 -O my.my:pass -t 1
[2014-01-26 19:42:40] Starting Stratum on stratum+tcp://digitaldriller.com:19334
[2014-01-26 19:42:40] 1 miner threads started, using 'scrypt' algorithm.
[2014-01-26 19:42:40] stratum_recv_line failed
[2014-01-26 19:42:40] ...retry after 30 seconds
^C
asterisk1 home # ./minerd -o stratum+tcp://domain.com:3333 -O my.my:pass -t 1
[2014-01-26 19:43:21] Starting Stratum on stratum+tcp://digitaldriller.com:3333
[2014-01-26 19:43:21] 1 miner threads started, using 'scrypt' algorithm.
[2014-01-26 19:43:21] Stratum connection failed: Failed connect to digitaldriller.com:3333; Connection refused
[2014-01-26 19:43:21] ...retry after 30 seconds

or at best  http://i.imgur.com/xEl0qVs.png

Did you do these steps to make sure stratum had the correct stuff compiled?

sudo apt-get install python-twisted python-mysqldb python-dev python-setuptools python-memcache python-simplejson
  easy_install -U distribute
  git clone http://github.com/Tydus/litecoin_scrypt.git
  git clone http://github.com/ahmedbodi/stratum-mining.git
  git clone http://github.com/ahmedbodi/stratum.git
  cd stratum-mining
  git submodule init
  git submodule update
  cd externals/litecoin_scrypt
  sudo python setup.py install
  cd ~
  cd stratum-mining/externals/stratum
  sudo python setup.py install

I added some linebreaks there, and I assumed that you wanted those double asterisks to be asterisks, so I escaped them. If that wasn't your intention please feel free to edit.

no sorry, I should have been more clear, was a bit rushed before.... the github should be changed to  github.com  I put that in as I am a new member and am limited to number of URL's in single post...

Ahh. I hope this is how you meant it. :)


text:
Bitcoin walet not updated
I have setup'd bitcoin core(Version 22.0) on my centos server with pruning set to 3GB.
Now, My friend sent me some bitcoins but my wallet still show me 0. The transactions has 41 confirmations. Please help.

is it because of bitcoin syncing is still in progress ? just a guess

Bitcoin core tells in the display whether the wallet is synchronised yet. If it isn't yet fully synchronised, it yet can't show the results of recent transactions.
Pruning affects the amount of data retained on disk. It does not reduce the amount of data that has to be obtained over the network for synchronisation.


text:
Where get list of all bitcoin data store changes?
I want to create my own database with bitcoin transactions, blocks and etc. I understand that bitcoin changes some times, added segwit and other. For support this thing i need remastered storage, create all needed columns. Any body have list with blocks in which storage has changed? thx

There are no such changes at specific blocks.
Segregated witness changed the definition of what data exists in a transaction, but it did that retroactively for every transaction. So, from the perspective of a post-segwit node, every transaction has an input witness for each of its inputs. For old transactions that witness is just empty. From the perspective of pre-segwit nodes, nothing changed, because they don't know, care, or see the input witnesses (other nodes will drop the witness when relaying to pre-segwit nodes).
So really the choice for you is whether you want to present information as seen by post- or pre-segwit nodes. Both are perfectly consistent and meaningful, and neither needs any special casing of transition from one format to another.
There are also no other changes like this since Bitcoin's release in 2009, as far as I know.


text:
Mini private key format
I want to understand why the format for a mini private key necessarily has to start with an "S". Why is this? Is there a specific reason for it? I would imagine so, but I don't know what it might be.

It was not obligatory but the creator of the mini private key Mike Caldwell decided to use this system of using an S before to help users distinguish between regular private keys and mini private keys.
notice that it is not recommended to use those type of key because they are less secure than regular private key, also the S stand for Spend

@reticus you welcome, dont forget to validate the answer if you satisfied with it


text:
What is "collection" for Ordinals? Where are "collections" stored?
Right now, there are collections in Ordinals marketplaces.
For example:

https://openordex.org/collections
https://ordinalswallet.com/collections
https://ordswap.io/collections/

But I failed to find the collection related params in the Ordinals' docs
So my questions are:

Where are "collections" stored? Are they also stored on chain? or they are just indexed off chain?
If on chain, how to write "metadata"-like info to specify the collections? What is the format?
If off chain, are they indexed by creators or marketplaces, or both? How these indexes are passed/aligned across marketplaces?

It appears to me that "collections" isn't something defined by the Ordinals protocol, and it's not something that gets stored on chain. Rather, there appear to be centralized repositories to which people can submit their collections to be indexed as such.
The Ordinals Wallet has a GitHub repository that accepts collection submissions via pull requests. OpenOrdex uses the same repository. Ordswap appears to be accepting them using a Discord bot. These use two very different submission formats. There might be other repositories, but these were the easiest to find. I am not sure if there is any exchange of data between the marketplaces, but I would guess that creators are expected to submit their collections to every marketplace where they want to be listed.

I see. That solves my confusions. Thanks Vojtěch!

As for now, this GitHub repo is not maintained anymore. I'm wondering where to find the metadata of each "collection"...


text:
Why do you need to connect to a software wallet if you have a hardware wallet
I have read multiple times about people asking to connect to a computer based software wallet to their hardware wallet. I dont understand the need to do that? Is not a hardware wallet sufficient enough to hold tokens? Even if you have to connect to a dapp to interact why would you need to connect your Bitcoin hardware wallet to lets say Electrum on your computer?
Also how will electrum read and understand what's happening on your hardware wallet? Would you not have to enter your seeds on the electrum application to use your wallet? That would make the purpose of accessing your wallet on the HW wallet useless if you are going to make that cold wallet hot like that.
Thanks.

In Bitcoin, wallets do not actually store coins. Wallets hold private key material that enables the user to spend specific Unspent Transaction Outputs (UTXOs) that are tracked on the blockchain.
Hardware signing devices generally do not have the capability to process the blockchain. Therefore they cannot by themselves learn which UTXOs are owned by the user. This is where the software wallet comes into play: The software wallet keeps track of a "watch-only" wallet and therefore learns about the UTXOs and transactions relevant to the user. This information is used to create transactions. The hardware signing device only keeps track of the private key material and will provide signatures for the transaction created by the software wallet. To that end, the transaction needs to be presented in a specific format to the hardware signer’s interface. This translation layer is usually implemented in some software wallets.
The keys do not need to leave the hardware signing device. Rather the partially signed (or unsigned) transaction is transferred to the hardware signing device, the hardware signing device adds the relevant signatures, and the signed transaction is returned from the hardware signing device to the software wallet. There are various ways to get the transaction data to the hardware signing device, the simplest is to plug it into the computer with the software wallet, but some hardware signers e.g. read animated QR codes, or some users create the transaction on the online device and use a separate airgapped offline device to connect to the hardware signing device.


text:
How can I set up the passphrase

To set up the passphrase can I use a passphrase that has alphabets, numbers and special characters mixed together?

Also how many characters in the passphrase does the blockchain allow?

Can I set up the passphrase using words separated by spaces? or does it have to be one long word?

If the above answer is yes i.e I can use words separated by spaces then can I use 10 words separated by 5 spaces between each word? just an example.

If I set up a wallet with a seed phrase and a passphrase and deposit 1 BTC, then later delete that wallet and set it up again without the passphrase, will the new wallet that I see have the same address as the seeds with passphrase or not? IMO that should be a different address than the one with seeds + passphrase.

The way BIP 39 wallets are created is to combine the passphrase along with the seed phrase (12/24 words) to generate a master key, which is then used to derive a hierarchical series of private and public keys. In Bitcoin, you are allowed to do all of what you are asking including:

Large number of characters (theoretically limitless)
Special Characters
Sequence of spaces (2 or more spaces back to back)

Although Bitcoin itself does not have constraints as to what you can include as a passphrase, many implementations of BIP 39 wallets do. You may encounter passphrase length limits based on the wallet implementation, such as Trezor allowing around 50 characters and some other wallets permitting more or fewer characters. It’s recommended to check the documentation of the specific wallet you’re using before creating your passphrase. Generally, software wallets like Sparrow and Electrum will have fewer constraints than hardware wallets like Trezor and Ledger. Also, given that most hardware wallets do not store the passphrase, it may be tedious to re-enter a 250+ character passphrase every time you want to access your bitcoin.
Passphrases provide an extra layer of security that is compelling to anyone serious about keeping their bitcoin safe. That's because without the passphrase, an attacker cannot access your funds even if they have the seed phrase. It’s important to make sure that your passphrase is secure and memorable and/or safely stored, because losing it means permanent loss of access to the funds tied to the wallet derived with that passphrase. The seed phrase alone will not be enough to recover the wallet. As previously mentioned, it's the combination of the seed and pass phrases that creates the wallet, so the seed phrase alone (or the seed phrase along with a different pass phrase) will create a new (most likely empty) wallet with a different master seed and different addresses, etc.

so the seed phrase alone should create new addresses but not new seeds. your last line is the seed phrase alone will create a new empty wallet with a different master seed and new addresses. can you tell me the difference between mnemonic and seed phrases and master seeds. am I missing something? Thanks for your reply. it cleared up my query.

Public and private keys in Bitcoin are just really really big numbers. Because of this, they are often encoded as hexadecimal representations. BIP 39 is just a way of encoding these large hexadecimal numbers even further into a human readable string: each word corresponds to a number between 0 and 2047. Seed phrases on their own are sufficient to create new wallets as they represent these large numbers hence public keys, however when you add a pass phrase, you must hash the seed phrase and pass phrases together to create a new large number/public key - this is a brand new wallet

So my understanding is this
'abc' set of seeds + 'random' passphrase will create a wallet with 'asd456' wallet address
The same 'abc' set of seeds entered without the passphrase will show 'uisd7888' wallet address.
The 12/24 words seedphrase remain the same throughout whether I put the passphrase or not or even different passphrases to have multiple hidden addresses. But the primary 12/24 word seeds always remain the same which may or may not be complemented with the passphrases.
Thanks for clarifying.


text:
Ignoring the difficulty set by the pool
Scenario:

The pool sends a mining.set_difficulty message with difficulty = 8.
The miner ignores the message and submits shares that qualify at
difficulty = 1.
Most shares will be rejected by the pool with error = high-hash.

Question: what is the cost of submitting shares that get rejected? Are the accepted shares as valuable with an acceptance rate of 5% as if they were submitted with an acceptance rate of 100%?

The pool will typically ignore invalid shares. They should have no effect on shares that are actually accepted.
Some pools might consider excessive submission of invalid shares abusive, especially if done at high rates. The point of an increased difficulty is precisely to avoid this. So you might find you get suspended or disconnected. But most pools would probably just tolerate it unless it actually caused them an operational issue.


text:
What is the role of bitcoin wallets?
I'm trying to get involved in bitcoins, but first it seems I need further clarification on the concepts involved in bitcoins.
First let me clarify what I know (at least what I believe to be correct): miners race to solve mathematical problems, and whoever (or whatever pool) manages to solve the most complex block at a given time is awarded the bitcoins to their wallet address.
Now, what I want to know is, what exactly makes a wallet wallet? Other than providing an address, what does it do? A pair of cryptographic keys make up a wallet, which I understand, is used to transact the bitcoins associated with an address; but is that all? Other than safeguarding the private key, is there anything else to mind about a wallet, i.e. does it record anything else?
I did not find anything explanatory aside from the key-pair mention on the Wikipedia article, and I do not have enough technical expertise to go through the bitcoin protocol to understand the concepts. Please help me with understanding wallets.

Mining: neither racing for a given time nor for the most complex. Racing to solve a problem of given difficulty until one randomly stumbles upon the answer after on average 10 minutes (currently 8 if you're nitpicking).

A wallet is merely a collection of pairs of private/public keys. Every normal Bitcoin address is just a hash of a public key. The corresponding private key is needed to sign transactions that spend coins from the address.
So wallet security really is all about protecting your private keys - making sure you have access to them, and nobody else does. There are several ways to do this. A basic client software manages a wallet file for you and uses the keys within to sign transactions.
There are more advanced address that correspond to multisig or other scripts.
Re mining - almost true, instead of the miner finding the most complex block winning, every miner finding a sufficiently difficult block is rewarded. What is considered "sufficiently difficult" changes periodically.

How is a bitcoin assigned to an address? Simply by being recorded on the blockchain? And then how is the keys used to transfer those bitcoins?

@Oxwivi: The blockchain is built out of transactions. Every transaction moves bitcoins from some addresses to other addresses. For a transaction to be valid, its hash must be digitally signed with the key corresponding to the input addresses.

Wallets don't exist, simply put, for each address you have a public and private key, a wallet is just a local ledger of all of these. Some people use multiple different wallets for different places they've received bitcoins (And/or different aliases, such as Work, Online, Investment, etc...), but, to anyone's eye's past yours (And your bitcoin client), the wallet doesn't exist.
Addresses are really the only thing that exist, and, a wallet is just a local collection of said addresses, as, not to confuse them with other addresses for different uses.
EDIT:- Just a note, if you own the public/private keys to multiple addresses, you can combine then on a transaction, it's not like a bank where if you need to pay half on one 'account' (address), and, half on another, you have to send two payments, you can just create a transaction referencing both, then, sign it with both private keys. In fact, the addresses don't even have to be on the same wallet, if me and my friend want to go 50/50 on a subscription fee for watchvideoswithbitcoins.tld, then, I can create a transaction referencing his TXIN (transaction input, where he got money) and the same for mine, sign it with my address, then, give him the transaction (Which at this point is still invalid, as, only one of the two inputs agree to pay) and let him sign his part of the transaction, then broadcast it. Currently, however, lots of people assume "Oh, if you signed both you must both be the same owner", which, is what "coinjoin" is based on:-
https://bitcointalk.org/index.php?topic=279249.0

Sorry you lost me with the multiple addresses. I don't really get your point there. What exactly happen when you, say for example, send two bitcoins addressed to two wallet/hashes/whateveryouwanttocallit? A bitcoin goes to either of them?

You are correct on the Mining.
A wallet provides a secure place to store your bitcoins but it can also be more. You can encrypt messages with your bitcoin address and send it to someone. This will show the reciever that you are the holder of that bitcoin address.
However, The main purpose is to send and receive bitcoins.


text:
Can we have more than one address in transaction inputs and outputs addresses attribute?
In the transaction data of bitcoin can we have more than one address element in adresses attribute of inputs and outputs of a transaction.

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

Despite what blockchain explorers might show you, The network format for Bitcoin transactions contains no addresses.
Transactions can have multiple inputs and multiple outputs. Each output has a locking script. An address is a convenient abstraction of a script. Thus a transaction can have at least two and sometimes thousands of associated addresses.
Each input and each output for common types of transaction are only associated with one address.
A multi-signature transaction can be more complex. This might be what you are thinking of.

Related

In what format does a block store the transaction data?


text:
How to explore hardened addresses in bitcoin core descriptor wallet
I created an blank descriptor wallet and imported a xprv key.
importdescriptors '[{ "desc":"wpkh(tpr..../0h/*h)#td3snsa4", "timestamp":"now", "internal": true,"range": [0,5],"active":true}]'

I want to get the hardened address of path m/0h, but getnewaddress reports an error:
￼
Error: This wallet has no available keys (code -4).

I know deriveaddresses can show the hardened address, but it requires the private key to be included in the command.
I have imported the xprv key via the importdescriptors method, and I don't carry the xprv in daily use. I think the wallet can show the hardened address, but I don't know how to make it.

You've imported the descriptor with "internal": true which means that the descriptor will be used only for change addresses. You cannot retrieve any addresses from it with getnewaddress as that only retrieves receiving addresses. You can use getrawchangeaddress instead.
If you want to use getnewaddress, then either don't specify internal, or set it to false.

As you said, I set "internal":false, and it works! May I ask you, could I retrieve the addresses before the next index in  a descriptor?

Oh, I find them in address book, Thx~!


text:
Sample implementation of Merkle Block Retrieval not working
This is the code from https://developer.bitcoin.org/examples/p2p_networking.html on how to retrieve a merkle block:
#!/usr/bin/env python

from time import sleep
from hashlib import sha256
import struct
import sys

network_string = "f9beb4d9".decode("hex")  # Mainnet

def send(msg,payload):
    ## Command is ASCII text, null padded to 12 bytes
    command = msg + ( ( 12 - len(msg) ) * "\00" )

    ## Payload length is a uint32_t
    payload_raw = payload.decode("hex")
    payload_len = struct.pack("I", len(payload_raw))

    ## Checksum is first 4 bytes of SHA256(SHA256(<payload>))
    checksum = sha256(sha256(payload_raw).digest()).digest()[:4]

    sys.stdout.write(
        network_string
        + command
        + payload_len
        + checksum
        + payload_raw
    )
    sys.stdout.flush()

## Create a version message
send("version",
      "71110100" # ........................ Protocol Version: 70001
    + "0000000000000000" # ................ Services: Headers Only (SPV)
    + "c6925e5400000000" # ................ Time: 1415484102
    + "00000000000000000000000000000000"
    + "0000ffff7f000001208d" # ............ Receiver IP Address/Port
    + "00000000000000000000000000000000"
    + "0000ffff7f000001208d" # ............ Sender IP Address/Port
    + "0000000000000000" # ................ Nonce (not used here)
    + "1b" # .............................. Bytes in version string
    + "2f426974636f696e2e6f726720457861"
    + "6d706c653a302e392e332f" # .......... Version string
    + "93050500" # ........................ Starting block height: 329107
    + "00" # .............................. Relay transactions: false
)

sleep(1)
send("verack", "")
send("filterload",
      "02"  # ........ Filter bytes: 2
    + "b50f" # ....... Filter: 1010 1101 1111 0000
    + "0b000000" # ... nHashFuncs: 11
    + "00000000" # ... nTweak: 0/none
    + "00" # ......... nFlags: BLOOM_UPDATE_NONE
)
send("getdata",
      "01" # ................................. Number of inventories: 1
    + "03000000" # ........................... Inventory type: filtered block
    + "a4deb66c0d726b0aefb03ed51be407fb"
    + "ad7331c6e8f9eef231b7000000000000" # ... Block header hash
)

But the code above doesn't run, thus I made some amendments (if not the error that 'bytes can't concat to strings' will be displayed) to this part:
sys.stdout.write(
    str(network_string)
    + command
    + str(payload_len)
    + str(checksum)
    + str(payload_raw)
)

Thereafter, I ran -bitcoind daemon before piping the script to Unix netcat command:
# Connect to the Bitcoin Core peer running on localhost
python get-merkle.py | nc localhost 8333 | hd

But to no response.
The expected response is:
7f16c5962e8bd963659c793ce370d95f
093bc7e367117b3c30c1f8fdd0d97287 ... Merkle root

07000000 ........................... Transaction count: 7
04 ................................. Hash count: 4

3612262624047ee87660be1a707519a4
43b1c1ce3d248cbfc6c15870f6c5daa2 ... Hash #1
019f5b01d4195ecbc9398fbf3c3b1fa9
bb3183301d7a1fb3bd174fcfa40a2b65 ... Hash #2
41ed70551dd7e841883ab8f0b16bf041
76b7d1480e4f0af9f3d4c3595768d068 ... Hash #3
20d2a7bc994987302e5b1ac80fc425fe
25f8b63169ea78e68fbaaefa59379bbf ... Hash #4

01 ................................. Flag bytes: 1
1d ................................. Flags: 1 0 1 1 1 0 0 0

Are you connected to a node that has BIP37 enabled? In Bitcoin Core it is off by default, unless started with -peerbloomfilters. See BIP111 for details.

Ok. It still doesn’t work even after setting -peerbloomfilters=1.

Do you receive a "version" message?

Nope no message at all.

Then you must be doing something wrong before sending the filter commands.


text:
Active vs inactive bitcoin nodes
The protocol documentation states "The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours."
Does this mean any message coming from the node? or a specific message?
Also, when are unsolicited addr messages sent out from a node? I know of one scenario where if a node decides to listen to incoming connections it sends out an addr message with its info in it.
Does a node send addr messages without receiving a getaddr, and what is the frequency of these messages?


text:
LN nodes with no network addresses
I'm trying to create a graph of the LN network using data from https://ln.fiatjaf.com/.
I used the channel data to get all the active channels for any given duration and created a graph using the nodes of the said channels.
The next step was to find the largest connected component that yielded 20k LN nodes. Of 20k LN nodes, a good portion (~5k nodes) do not have an address field. This data was queried using https://1ml.com/.
I was just trying to find if there is any reason behind it, because based on my understanding if a node is part of a fully connected component, it should have one of IPv4, IPv6, or an onion address.

Lightning nodes do not need to advertise an external IP address. This does prevent other nodes from connecting to you, but you can still connect to other nodes (as long as they have a public address) and open channels to them. Other nodes will not be able to open a channel to you unless you're already connected to them.

So how are gossip messages propagated to these non-ip nodes? and 2. What about connections that need to be formed if the node in question is the recipient of a transaction? 3. Does this apply to LN nodes running on TOR too?

Update: So when a node connects to a node in the LN network, is a peer-to-peer connection, and all communication happens on this connection. With communication, on the connection I mean, channel creation, channel updates, and all the gossip messages. Basically, this connection is persistent until the node goes offline. Is my understanding correct?

@VinayShetty: The nodes to have an ip-address but just don't list it publicly. These nodes can create connections to their peers and get gossip + information about receiving transactions from them.


text:
How resolving nonce validates transactions?
I'm going to explain a bit more about my question, by talking first about what I understand about blockchain and transaction in a decentralized network. Correct me if I'm wrong somewhere.

In a decentralized network, every node has a copy of the ledger. If node A sends to node B an amount of bitcoins, he does it by broadcasting a message containing [sender - receiver - amount] together with a digital signature. Every other node in the network verifies the message with the signature, and if they (or the majority of them) consent that it is correct, the transaction is written into the ledger. Note that a node is not necessarily a miner, and here, to verify a message is no other than to compare 2 hashes.
Miners validate transactions/blocks by solving a math problem which is to find nonces.

So my question is, what is the link between these 2 things? If nodes in the network are enough to verify transactions, why do we need miners? When do miners enter in the game of validating transactions? And how come that to verify transaction is relied with to find a nonce?

Does this answer your question? 1-CPU-1 Vote Bitcoin confusion

So my question is, what is the link between these 2 things? If nodes in the network are enough to verify transactions, why do we need miners?

Suppose Alice forms two valid transactions, one sending a bitcoin to Bob and another sending the same bitcoin to Charlie. Without the miners, how can Bob or Charlie ever know which of them gets to keep the bitcoin?
And you might think that if Alice does that, well, neither Bob nor Charlie will assume they get to keep the bitcoin and Alice just played herself. But that won't work. Say Alice is buying a phone from Bob and Bob only sees the transaction giving him the bitcoin. Without the miners, how can Bob be assured that nobody will ever see a transaction from Alice giving that same bitcoin to someone else and decide that Bob didn't get a bitcoin from Alice. How can Bob ever send Alice her phone if he can never be sure the transaction to Charlie will never be accepted by anyone?

When do miners enter in the game of validating transactions?

Miners produce a blockchain that eventually contains only one of those two transactions, allowing Bob to know for sure that he will get the bitcoin from Alice and nobody else will.

And how come that to verify transaction is relied with to find a nonce?

It has to take some significant amount of work to build valid blocks, otherwise a massive number of valid blocks could be created and Bob would never be finished trying to figure out which of them would be accepted. By making it extremely expensive to create a valid block, Bob only has a small amount of work to do and an attacker can't create large numbers of valid blocks to stymie him.

So you say the point of miners is to avoid double-spending. Why can't we just put a timestamp to each transaction and the one that is created first is valid and the other one is rejected?

And if I understand correctly, the purpose of mining - or solving the hashing problem - is to ensure that blocks are enchained in the blockchain one by one, each after 10 minutes in the case of Bitcoin?

@HiImEins Yes, we can - arguably that is exactly what miners do: provide a decentralized timestamp on transactions (= the time of the block they end up in). You can imagine alternative sources of timestamps, but they inevitably rely on some trusted party's clock (because just because you see transaction A before transaction B does not mean that everyone sees them in the same order; communication takes time, and distance to the source is subjective).


text:
What is the incentive for a bitcoin node to broadcast the newly received block as fast as possible?
I understand that a bitcoin node will broadcast a new mined block to all the other nodes as quickly as possible so that the other miner nodes can work on the longest chain. But why would a node help other nodes by broadcasting to them the longest chain?
What if most of the nodes don't broadcast the longest chains in order to delay the mining of other nodes?

But why would a node help other nodes

Because anyone with any stake in Bitcoin needs the existence of a healthy Bitcoin network in order to be able to use their money and for it to retain any value.
Since the network is a mesh, there are, in general, no strategic nodes that can maliciously act as a bottleneck or filter. I would expect miners to take care that their selected peers are diverse.
Even if most nodes were malicious, it is very likely that almost any honest node would be in contact with at least one other honest node and would detect the malicious nature of the malicious nodes.


text:
Are stale blocks permanently discarded?
I know that stale blocks usually happen by accidents and the chain that has more blocks will be chosen as canonical chain by default and the stale chain is discarded.
My question is about what it means to be discarded?
Is it permanently discarded?
Or does it mean that if those stale blocks become longer (from 51% hash rate mining), they will stop being stale and be preferred by nodes?
I simply want to know whether it's possible to alternate mining between 2 chains making them roughly equal in length when you have 51% hash rate so that the network becomes useless. I think that it doesn't make sense that stale blocks are completely discarded. Because that means the longest-chain rule is not obeyed.
If you obey longest-chain rule, stale blocks must always have a chance to become part of the canonical chain no matter what.

Bitcoin Core does not discard stale blocks. All blocks which are on a most-work headers chain (except those known to be invalid) are downloaded, and once downloaded, no block is discarded (unless pruning is enabled, in which case all blocks older than a certain age are discarded, stale or not).
It is very much possible to flip-flop between two valid chains, if they are alternatingly extended. This doesn't even require an attack, though it becomes less and less likely to continue this pattern as the length of the chains since the fork point grows.

Can an attacker indefinitely flip-flop if he always control 51% hash rate?

I believe you are right. Bitcoin nodes must mark stale blocks as stale but not discard them completely. As you note, the node knows they are not part of the current chain. It is possible that a node may later find that a formerly stale block is now part of the "longest" chain. It must then be included in that node's active chain.


text:
How to check transactions on blockchain
I am assuming all BTC blockchain explorers are either centralized services or hosted on servers which are a centralized service. In the case of something going wrong with these centralized servers and if these explorers are not accessible then how to check transactions on the blockchain. Till now all I know about verifying transactions on the blockchain means going to the explorers. What other ways are there to see blockchain activities?

You can run any open-source blockchain explorer on your own PC. Typically by compiling source code
You can run a program such as Bitcoin core without using its wallet features and turn on relevant features such as transaction indexing. This is less than ideal but might suffice for some basic requirements.
A watch-only wallet is useful if you only need to track transactions related to a limited set of public keys.
Any fully synchronised full-node wallet can tell you everything you need to know about the blockchain records relating to your own transactions.

Related

Blockchain Explorer for local full node
How can I take a "snapshot" of the bitcoin blockchain and analyze it?
Is blockchain.com the only place where you can see the blockchain?
Example code in answer to What are the mean, median, range, limits and trends in the size of coinbase transactions?


text:
Where are the seeds on the blockchain stored?
Since BTC is decentralized and there is no central server, where are the seeds stored on the blockchain? How is it prevented from getting exposed to others who view the blockchain?

Seeds are not stored on the blockchain. Rather seeds are used to generate private keys, which are then used to create digital signatures, which serve as proof that the owner of it agrees to the transaction.
Bitcoin transactions create transaction outputs that contain the value in Bitcoin assigned to them, as well as the conditions required to spend that output as an input to another transaction. The owner of that output, and therefore the Bitcoin value associated with it, is the persons who can satisfy the conditions specified in the output. The most common condition is that of a digital signature - the output specifies a public key (or its hash) and so the condition is that the spending input must contain a digital signature created by the private key corresponding to the specified public key.
As their name suggests, public keys are meant to be public and can be shared publicly without exposure of the private key. The private key, as the name suggests, must be kept private. It is then used to generate the signature. The math works out such that it is not possible to compute the private key for a public key, nor is it possible to create a signature for that public key without also having the private key.
A seed is simply another private key, as it is used to generate other private keys. Although seeds are not typically used directly as private keys for producing signatures.
Lastly, Bitcoin does not require any sort of registration of public keys when their private keys are generated. The space of possible private keys is so large that it is basically impossible for two people to generate the same private key if they are generating their keys correctly. However, given that ownership is basically defined as the ability to spend an output, if private keys are improperly generated, or an output has insecure spending conditions, multiple people may "own" the output and be able to spend it independently of each other.


text:
How do transactions on the BTC blockchain get processed
From what I understand, miners deploy their GPU's and whatnot to solve complex mathematical problem and when they do, that doing is called discovering a block and thus they get rewarded with BTC(currently 3.125 BTC per block if I am not wrong). also, can miners earn less than 3.125 BTC from mining if they don't mine a whole block? can a part of a block be mined?
So, if I send my BTC from 1 wallet to another then who processes that transaction? miners? then how is it done since miners are solving math problems to discover blocks to earn BTC? This might be a very silly question but I have always wondered how this works.


text:
Can Quantum computing really affect Bitcon network?
I was watching a video which mentioned that bitcoin uses a prime number which is 10^77 and a computer doing a trillion computations every trillionth of a second for a trillion years would be less than 10^56. Also there are 10^80 atoms in the universe approx was another claim. Now please let me understand what does that mean and how will quantum computing will not be able to easily affect the security of bitcoin chain?


text:
How can I recover funds recovery from coldcard?
I recently bought a Coldcard mk4 and did some tries to understand how it works. I moved a tiny amount to test it but now I can't recover it.
What I think happened is: I exported the wallet created with the CC and imported in Blue Wallet app on my iPhone, then I used one of the addresses generated by the watch only blue wallet.
I have:
24 words mnemonics
passphrase
the addresses I used to transact those lost sats
the xpub associated to those address
my fear is having played around with derivetion paths settings I may have used some path that I don’t know or remember anymore.
Do you think is it doable to recover them starting from this?
thanks

Yes it may have to do with the path you used.

Check what address type you're using on BlueWallet. Usually people use bc1 addresses.
Re-export the wallet file to something like sparrow or electrum and the funds may show up again.
Here's a great sparrow tutorial video that may help: https://www.youtube.com/watch?v=FAYmE5-40PQ
If you can't remember the path you can guess as many times as you want but you will need the correct path to access those funds. Here's our path docs: https://coldcard.com/docs/paths

Cheers,
Coinkite Team


text:
How do I get a Wallet address?
New to this (obvious)
Using armory.
To send/receive BC's I need and address for the wallet.
How do I get this address?
Simple question and have searched but no direct answer??
Thanks

There should be a receive bitcoins button. Also welcome to Bitcoin SE, the question you asked could be figured out through a google search and this really isn't that useful of a question.

You can also try Electrum a very user friendly wallet, alternatively to get you started off you could simply set up a web wallet somewhere like blockchain.info.
I suggest having a look over the bitcoin.org page here:
Choosing Your First Wallet

In the top right corner there is a button that says "Create Wallet" and "Import or restore wallet". Click "create Wallet". Enter a wallet name and a description. You can then enter a passphrase for the wallet. You should right this down too in a safe spot.
To view your bitcoin address open up "Receive Bitcoins" or "Send Bitcoins"

Now the question is how do I uninstall Armory.


text:
How to get difficulty for Bitcoin and other coins
How do I get access to the latest Bitcoin/Altcoin difficulties from the original "source/network"? I want to develop a C#/.NET application that collect this information.
I know that there are web sites that provide information about Bitcoin and Altcoin difficulty. Coinchoose and Coinwarz provides JSON APIs for example. There are also blockexporers like http://blockexplorer.com/q/nethash/2016 that could give me the current Bitcoin difficulty.
The problem with Coinchoose and Coinwarz is that they are not complete, not fully real-time and Coinwarz cost money in addition to that. The block explorer above is for Bitcoin only. Are there block explorers for all AltCoins as well? And are they all providing different API's?
There must be some "original source", like the mining network or similar, where you can connect and get this information in real-time? Or is that also completely different for each coin? I understand that each coin has its own mining network, but are they different except having different IP-addresses for example?
So the question is basically how do I get access to real-time coin difficulty information for Bitcoins and all other coins - not from an existing web site, but more on the API / programming level?

I guess you could take out the original C++ code of each coin (will be 99% the same on them all) that listens on the network for new blocks, drop everything but the part that gets the block number and the target difficulty, then convert to C#...

Bitcoins as well as all of the altcoins that I know of have their own API. For example here is bitcoins API. It has a method called getdifficulty which

Returns the proof-of-work difficulty as a multiple of the minimum difficulty.

So if you had bitcoind installed, you could then just type in the terminal
bitcoind getdifficulty

getinfo and getmininginfo also return current difficulty

This commands show LAST block difficulty, don't show real time DIFF


text:
Test in a box duplicating addresses how come?
I copied the whole directory for bitcoin data and then ran two instances one for the first directory and the other for the copied one, and then I generated a new address from the old instance go to the new instance and ran validate address it showed "ismine":true !!
Could you please explain this ?

Bitcoin Core uses a "keypool".  When it first runs, it generates a list of 100 new addresses.  After that, each time the user asks to "generate a new address" (or an address is needed for change, etc), the next address from the keypool list is used, and a freshly generated address is added to the end of the list to replace it.  The keypool keys are stored in wallet.dat along with your other private keys.
The purpose of this feature is so that when you back up wallet.dat, you get not only the keys you have already used, but also the next 100 you will use.  If this were not the case, then everytime you generated an address or made a transaction (generating a change address), you would have to immediately backup wallet.dat again, and you'd be vulnerable to losing coins if your disk crashed in the meantime.
So when you copied the entire Bitcoin data directory, including wallet.dat, you also copied the keypool.  As such, the next 100 addresses "generated" by both installations will be the same.    After that they will differ.
But you probably didn't really want to share the wallet between both installations, since this can cause confusion unless you really pay attention to what you are doing.  So you can delete the wallet.dat from one of the installations (if you have made real transactions with it, back it up first) and let it be regenerated.


text:
Is multisig address belong to the same wallet created by?
I created 2-of-3 multisig address using bitcoinqt by three public keys from my wallet . when I tried to validate this address after creation it shows :
"isvalid" : true
"ismine" : false
should it be is mine as it is created by 3 of my addresses ? can you explain me why it does not belong to the wallet ?

TL;DR: Bitcoin Core currently (as of v.0.9.3) does not support spending from a multi signature address even even you create a multi signature address with public keys of addresses inside your wallet. Therefore it does not show the generated multi signature address in the UI or return "ismine:true".
Spending from a multisig address requires including the generated "redeem script" within the transaction. Additionally, the raw transaction has to be signed by 2 of the 3 public keys provided to "createmultisig" (also included in the script) in the order they were provided to "createmultisig". As of now, the wallet does not store these redeem scripts, nor does it know in which order the raw transaction needs to be signed. Because of this, you cannot spend from a Multisig address via the UI. Therefore, it doesn't make sense for Multisig address  to be included within the wallet UI.
Using Multisig addresses is still considered an "advanced feature." Therefore, they don't show up in the UI. This requires understanding what Multisig addresses actually are and how they work.
A Multisig address is a type of "Pay-to-Script" address. The addresses created using bitcoin-qt create a script like this:
OP_x (x = number of required signatures)
PUSH next 33 bytes
[33-byte public key (compressed)]
PUSH next 33 bytes
[33-byte public key (compressed)]
...
OP_y (y = total number of public keys)
OP_CHECKMULTISIG

This script is hashed to create your address. So, since this script is unique to you (your public keys), it does belong to you.
In order to spend coins from this address, you have to create a raw transaction that spends from the address and sign it with the private keys that correspond to at least x of the public keys (in the order they were given when creating the address/script).
Part of this spending transaction is the script itself such as the one above (in hex form). This is a required part of the transaction. Of course, the script could be built from the UI, but the UI would have to have to know the exact order the keys were presented to build the original address in order to re-build the script.
This brings us to the next problem. In the current UI, there is no way to sign a transaction. However, even if you could, the UI would not know (based off the address alone) in which order the transaction must be signed to be valid.
One way to alleviate these problems would be to store the script in the client itself, however this might pose a security risk to some degree. If the wallet were to store the address and the script in the wallet, somebody (perhaps malware) that is able to access your wallet would be able to get your private keys as well as the script required to spend from the address -- which is also in your wallet. If you know what you're looking for, it's fairly easy read the script, find the corresponding keys in the wallet and create a transaction to spend the coins.
At least with the current Multisig pains such as manual transaction signing and such there is a layer of obscurity. If you were to send all of your BTC to a Multisig address, an attacker wouldn't be able to just up and run off with all your BTC. They would have to have a few key pieces of information: the original Multisig script (which I don't believe is known until a successful spending transaction has occurred), the private keys, and they'd have to know both the correct private keys and the correct order to sign the spending transaction in. Of course, that's a lot of information that would be needed just to make a successful spending transaction -- none of which (other than the private keys) is actually stored in the wallet.
So, while it may be difficult to deal with Multisig transactions/addresses in bitcoin-qt, it may be a good thing!
However, I don't see why once you've generated a multisig address that it couldn't be added to your receiving addresses. I have a feeling it has to do with the difference between how regular and pay-to-script addresses are generated and the fact that regular addresses use a fixed-width private key, where as a script (which is basically the private key of a Multisig address) is an arbitrary length: 1+(34*num_public_keys)+2.


text:
Two private keys whose corresponding public keys have the same x-value?
For a given integer m, there are at most two points in the secp256k1 curve whose x-value is m.
Have we ever actually found a pair of distinct private keys whose corresponding public keys have the same x-value?

Yes, trivially. If private key d has public key X coordinate m, then so does private key n-d, where n is the order of the curve (as n-d equals -d modulo n).
This follows from a basic rule in elliptic curve point arithmetic: -(x, y) is defined as (x, -y). From this is follows that if dG = (x, y) then (-d)G = (n-d)G = (x, -y) = (x, p-y).

Right, the sum of two points with the same x-value is the point at infinity (the identity element of the Elliptic curve group) so the two points are actually inverses of each other, so their preimages by the group isomorphism d--->dG are inverses of each other too. Thank Pieter !


text:
Why does Bitcoin have 128 bits of security?
It is commonly said that Bitcoin has 128 bits of security because there is an algorithm that can find the private key of a given public key in an average of 2^128 steps.
However, this assumes that the attacker knows the public key associated with the funds, so this attack is only possible with P2PK outputs or with addresses that have already been spent from.
In the case of an unspent P2PKH or P2WPKH, the attacker only knows the 160-bit address. Therefore, they must first brute force to find the public key associated with the given address. For each attempt, they have a 1 in 2^160 chance of succeeding, meaning the security here is effectively 160 bits. Once the attacker finds the public key, they can then apply the algorithm to find the private key.
So doesn't this imply 160 bits of security? Even if the attacker immediately found the private key corresponding to a public key, they would still need to perform a 160-bit brute-force attack first.

There are ~ 2^256 private keys and 2^160 p2pkh addresses.
Each private key produces two p2pkh addresses (hash of classic public key and hash of compressed public key).
So, there are ~ 2^97 private keys for each p2pkh address.
You do not need to find original public key. You can find any private key (from a set of 2^97) which corresponds to p2pkh address.


text:
How was this transaction validated?
I'm having trouble understanding how the following transaction was valided (Block 364845 July 2015) :
2c6c27639e79038cf446e795e267dc8abbe96d1f21cdd17518cc6b57ad2d86d9
It has one input, and is redeeming a P2PKH output.
It's ScriptSig is (95 bytes):
3c303902153b78ce563f89a0ed9414f5aa28ad0d96d6795f9c6302207cb21ff771e841b5706df6f7e26bbea177d05129b1fe1ec49af65f4bb0ba744a03210265939df6b81b4d5ecb3b913d7013efda1498349b65b61847825c37bfde5b87fe
The bold bytes are data-pushes. The second data-push is the public key, it is the first one that I'm having a problem with. It is supposed to be the signature, but I don't understand it, it doesn't even seem to be DER encoded. The s-value seems to be 0x7cb21ff771e841b5706df6f7e26bbea177d05129b1fe1ec49af65f4bb0ba744a and the sighash x03, but I can't read the r-value.

I think you got confused because you changed the order of signature and public key in scriptSig which consumes P2PKH output.
First comes the signature, then the public key. Here you can see the complete list for all standard transactions.
Since the signature is the first data-push in scriptSig, the DER format of the signature in the transaction you specified is as follows:
DER sequence:30
sequence_length:39
integer_value:02
length:15
R:3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63
integer_value:02
length:20
S:7cb21ff771e841b5706df6f7e26bbea177d05129b1fe1ec49af65f4bb0ba744a

Thanks, actually what destabilized me was the unusually low value for r

@mathboi You're welcome


text:
My bitcoin node is down again, not binding to my home ip:8333
I am getting the following error;
[net:error] Unable to bind to xxx.xx.147.xxx:8333 on this computer (bind returned error Cannot assign requested address (99)). I did a restart after trying to get some docker files, don't know if that caused, but I cant figure out how to fix it

You don't really provide anything like enough information, so what follows is inevitably guesswork.

bind returned error Cannot assign requested address

Your PC no longer has the specified address

I did a restart after trying to get some docker files,

DHCP allocated a new IP-address?
or
IPV6 not enabled in Docker

Possible fixes

https://stackoverflow.com/q/55844788/477035
alter bitcoin.conf to bind to any IPV4 address allocated to any active network interface
DHCP reservation
statically allocated IP-address


text:
source address is .onion in peers.dat
I recently wrote a tool to decode the peers.dat in bitcoin core. Something peculiar that I noticed is how there were some addresses in the tables that had the source address as a .onion address.
Does this not beat the privacy that TOR inherently provides? and why does this happen? Is the information of the source passed on in the version message during the initial handshake?

The only way this can happen is when you connected out to a Bitcoin Node running on a Tor hidden service (so you know its .onion address), and then that node gave you some IP/Tor addresses, which you stored in peers.dat.

Does this not beat the privacy that TOR inherently provides?

How so?

I performed a wireshark on my node running the hidden service and the traffic between nodes is indistinguishable. So the source address has to be sent somehow. Is it via the version message you think?

Your node already knew the onion address before it made a connection - otherwise how would it connect?

The may be because you specified it explicitly (through -addnode or -connect), or because it learned about this onion address from yet another node (nodes exchange IP addresses and onion addresses of known/rumoured nodes on the network to each other).


text:
Why are hashSequence and hashPrevouts computed separately?
When a Segwit transaction is signed, among the many hashes that are calculated to create the data that is going to be signed, the hash of the concatenated [input + index] is calculated (hashPrevouts) and so is the hash of the concatenated [nSequence] numbers (hashSequence).
My question is why are those hashes computed separately, instead of just hashing the concatenation of the [inputs + indexes + Sequence number].

The reason is increasing the ability to precompute and/or cache those hash values once for the whole transaction (potentially allowing them to be used for many signatures).
In "normal" (SIGHASH_ALL) signatures, both the prevouts and sequence values of all inputs are committed to by the sighash. However:

With sighash types that include SIGHASH_ANYONECANPAY, neither prevouts or sequence values are included.
With sighash types that include SIGHASH_NONE or SIGHASH_SINGLE, but not SIGHASH_ANYONECANPAY, the prevouts are included in the hash, but the sequence values are not.

Splitting the two pieces of data up means that all sighashes can be computed based on just these two precomputed values, even when non-SIGHASH_ALL signatures occur.


text:
Import BitcoinCore's blockchain into bitcoinj
I'm a newbie in bitcoin. I've started programming some software using bitcoinj to make some transactions in bitcoin's testnet.
But there is a huge problem I faced with. I cannot normally download the blockchain with bitcoinj. The speed is so slow and what is more when I tried to save all the data into PostgreSql, the speed dropped down much more...
If I use BitcoinCore to download the blockchain, the speed is okay and it's about 1 day to download everything. What's pretty good for me. So, I'm here to ask if there is some way to import BitcoinCore's downloaded blockchain into bitcoinj ?

My impression was that bitcoinj is not a full node implementation but a library. You’d usually pair it with a full node to get local access to blockchain data.


text:
Automatic Bitcoin signer
I'm not that technical, but is it possible to run a script that automatically signs a Bitcoin transaction once some conditions are met? For example, a date -I understand that with Bitcoin smart contracts you can play with dates via block height, but what if you are looking for a precise date-, or a fiat payment gateway, or any kind of external input (or the absence of it).

Sure. Here’s a real world example for you: Greenwallet has a wallet type called “multisig-shield” where your wallet is a 2/2 multisig with one key on your phone/computer and the other key is on a server that blockstream runs. You can turn on MFA for your wallet. So then what happens is when you want to make a spend, your phone/computer sends the transaction to the blockstream server, and if you have passed an MFA check, then the server signs the transaction. If you haven’t done the MFA challenge, then the server refuses to sign.
You can write your own signing servers/oracles that can decide to sign or not sign based on whatever logic or rules you want!

Oh thank you so much!! Yeah I was imagining something like this. What kind of tools could be useful to build an oracle like this?

can be pretty much whatever you want. At the end of the day, you need to be able to have users send you a psbt, you need to evaluate it against whatever policy/logic you want, then sign it (or not) and send back the psbt. So a reasonable toolkit could be something like https://bitcoindevkit.org to write your signing oracle and then host it as a web-app or a serverless app or whatever.


text:
Should my bitcoin core node be reachable before it has fully synchronized with the block chain?
I just set up Umbrel on a Raspberry Pi 4 and my internet connection is fairly lacking so the blockchain synchronization is taking a long time (currently it is at 1.65%).
While that's going on, I'm trying to get my Wasabi Wallet hooked up to my node. In Wasabi I've gone to Tools -> Settings -> Alternative Block Source for Main and entered my Umbrel hostname + port as: umbrel.local:8333 (also tried the IP address I reserved for the device in my router settings). Unfortunately, it seems like Wasabi may not actually be connecting to my node.
How do I know? Well, I've ssh'ed into my Umbrel, then docker exec'ed into the bitcoind container running on there, and then ran the following:
bitcoin-cli getpeerinfo | grep 'inbound'

The output does not show any inbound peers:
/ $ bitcoin-cli getpeerinfo | grep 'inbound'
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
    "inbound": false,
/ $

Also, I set up port forwarding on my router so the node should be accessible externally so I tried to confirm this by going to Bitnodes and using the "Check Node" utility -- it reports <IP> is unreachable
Is this normal? Will I just not see any inbound peers until I'm completely synced with the blockchain?

I did some digging and it seems that your node will only accept incoming connections once you're completely synced.
Reference: answer for post 'Checking if full node is running'


text:
paytxfee vs maxtxfee which one overrides the other
In wallet options section it shows these two settings
-paytxfee=<amt>  Fee (in BTC/kB) to add to transactions you send (default: 0.00)
-maxtxfee=<amt>  Maximum total fees to use in a single wallet transaction, setting too low may abort large transactions (default: 0.10)

If I set these two settings in the bitcoin.conf which one will override the other ? or how does in work ?

One is per kilobyte, the other is a limit on the total.
The second will prevent a transaction from happening if it, following the first, has a too large fee.

Is it possible to pay fixed amount per transaction regardless the kilobytes?

@Mohamed No, that wouldn't make sense. You're paying for space inside blocks, and miners prioritize transactions based on fee per byte. As you don't know the size of a transaction before creating it, specifying its exact fee would likely lead to unexpected behaviour.

https://btc.com/stats/unconfirmed-tx tells you how long your transaction will take to "clear" if you pay a certain transaction fee. Paying 0 may take too long, but you can get away with paying very little if you don't mind a delay in your transaction entering the blockchain.


text:
Importing keys to a brand new wallet
After I imported keys to the brand new wallet I tried to test that it is imported properly so I ran salvagewallet command to verify my new wallet but got these errors!
2014-08-21 12:17:28 WARNING: CWalletDB::Recover skipping key:
2014-08-21 12:17:28 WARNING: CWalletDB::Recover skipping key: Error reading wallet database: CPubKey/CPrivKey corrupt

Could you please help me to understand/solve this problem?

How can you verify a wallet ?
I think you should use
"C:\Program Files\Bitcoin\bitcoin-qt.exe" -zapwallettxes  -dbcache=3000
it will clean the transactions and give you the edge of faster reload.

salvagewallet is a disaster recovery tool, you should never be using it as a "verify" for your wallet. Some of the time salvagewallet will actually result in loss of funds rather than doing anything useful. Not running the command will fix your problem.


text:
sending Satoshi to a output of a unconfirmed transaction
this is a hypothetical question, reason is that my own incoming transaction is stuck because of another ancestor transaction that is already in mempool. for almost 1 day.
since I am neither the sender or receiver of this transaction that is stuck. would it be still possible for me to send coins to the output of the unconfirmed transaction with a higher fee so that the one that is in limbo due to low fees will pass through?
I have a full bitcoin node running locally. however I don't have mining power to mine those stuck transaction. so i am looking for alternatives.
Thanks in advance
why I don't just to CPFP on my own is because mine hasn't reached mempool yet, I get the pending que from chain.so which is hashflare.io private block chain gui which includes pending widthtawals

Do you own the recipient output?

nope, but I was thinking that somehow I could target one of that outputs of that unconfirmed transaction as a output on my transaction. or such concept doesn't exist?

under the impression that outputs consists of address + some sort of a positional entry in the ledger

my output is 1000 transactions behind the one that is stuck and its not even on the mempool, sad situation where mining operator company who claims to be expert in crypto is unable to produce a multi-pay transaction

I hope that I have more experience to help you but as you said, it's really sad situation.


text:
Tx to a multisig address in testnet not working
I've sent a tx to a newly created multisig address on testnet, but I don't understand why I didn't get the funds yet.
What I've done so far was to create 3 separate wallets, and get the 3 pubkeys to create the multisig address from python bitcoinrpc, and just in case I've used the command line too:
>>> multi_list = ['0355f3c263aeb7859e53d3549d3c9bc99cd581154d16e259fe390e029d6bda5b78',
...     '030a53f844570b8c26794276e205cdeab87ab0d7802d2abb5116a5472e3adc7dc1',
...     '0210b58f846754a9d0d70e226688e0693a241fd58e315d738399e40e68308b88f9']
>>> btc.createmultisig(2, multi_list)
{u'redeemScript': u'52210355f3c263aeb7859e53d3549d3c9bc99cd581154d16e259fe390e029d6bda5b7821030a53f844570b8c26794276e205cdeab87ab0d7802d2abb5116a5472e3adc7dc1210210b58f846754a9d0d70e226688e0693a241fd58e315d738399e40e68308b88f953ae', u'address': u'2N8DirDvhxVEm61b3JMc75Hsdqe8aWg9Vvu'}

Then, I've sent from another account some coins
>>> btc.sendfrom('myaccount', '2N8DirDvhxVEm61b3JMc75Hsdqe8aWg9Vvu', 0.15)
u'fa9982d579877ba31ed9c530ae99df1f67c1632ae8f3c7e4db8af1fbc442dfe8'

But on blockexplorer the vout address is marked as "unknown", and on btclook also the output was marked as "???"
The raw tx says, in the ScriptPub of the vout marks the "type': 'scripthash'"
What have I done wrong?
Are multisig addresses working on testnet? (I assume yes)
Additionaly, I'm using bitcoin core v0.9.1 which was recently released.

You could post your update as an answer.

UPDATE: looks like the testnet blockexporer don't know how to handle the multisig addresses (probably because it was hardcoded the p2sh magicbyte from mainnet) and shows them as "strange", but my TX was confirmed ok and i was able to spend the incoming txs.


text:
Where do I get my Bitcoin address
How do I get my address so someone can send me bitcoin. I am new to this and trying to get paid from an entity that only uses Bitcoin.

What wallet are you using?

what exchanges operate in your jurisdiction?

If you don't have a Bitcoin wallet, choose one
Many wallets have a Receive button you can click to generate a fresh address that you can give to someone so they can send money.
Exact details depend on which wallet software you are using.

See also

I am new to Bitcoin, how can I get started?


text:
How to get Segwit address from OKX wallet
I am going to connect OKX wallet in my bitcoin based game app and have one problem in getting native segwit address from okx wallet. I read their developer doc and there are two way to get address. https://www.okx.com/web3/build/docs/sdks/chains/bitcoin/provider
const result = await okxwallet.bitcoin.connect()

let accounts = await okxwallet.bitcoin.requestAccounts();

both return taproot address and I can't get native segwit and other types of address when user connect wallet.

I have read the doc you posted here, and yes, there are no parameters about the address type, so maybe it defaults to return the segwit address. Maybe you can propose an issue to the dev team to add a new address type parameter.

I sent email but no response, and their support chat is AI chat. not helped for me

https://github.com/okx/js-wallet-sdk/blob/main/packages/coin-bitcoin/src/wallet/BtcWallet.ts#L96

I found the related code in their bitcoin wallet code, and there actually is the address type param to choose from, but it does not exist in the okx wallet doc.


text:
Bitcoin RPC not reachable: Cant bind RPC server to IPV6
I tried every different combination in bitcoin.conf to make my bitcoin node (hosted in AWS protected behind VPN) reachable but nothing seems to work...
Just to clear it out of the way, I opened the port 8332 on the machine.
Here is my bitcoin.conf:
txindex=1
server=1
rest=1
# Auth Credentials For JSON-RPC server
rpcuser=your_username
rpcpassword=your_password

#chain=test
testnet=1

#rpcallowip=0.0.0.0/0

[test]
rest=1
rpcallowip=0.0.0.0/0
rpcallowip=::/0

rpcbind=0.0.0.0:8332

# Listen for JSON-RPC connections on this port
#rpcport=8332

Here is the netstat:
ubuntu@blahblah:~$ sudo ss -ltpn
State                      Recv-Q                      Send-Q                                              Local Address:Port                                              Peer Address:Port
LISTEN                     0                           128                                                       0.0.0.0:18333                                                  0.0.0.0:*                          users:(("bitcoind",pid=14485,fd=29))
LISTEN                     0                           128                                                       0.0.0.0:8332                                                   0.0.0.0:*                          users:(("bitcoind",pid=14485,fd=9))
LISTEN                     0                           128                                                 127.0.0.53%lo:53                                                     0.0.0.0:*                          users:(("systemd-resolve",pid=644,fd=13))
LISTEN                     0                           128                                                       0.0.0.0:22                                                     0.0.0.0:*                          users:(("sshd",pid=760,fd=3))
LISTEN                     0                           128                                                          [::]:18333                                                     [::]:*                          users:(("bitcoind",pid=14485,fd=28))
LISTEN                     0                           128                                                          [::]:22                                                        [::]:*                          users:(("sshd",pid=760,fd=4))

I cant reach my node with the following RPC call: (locally I can)
curl --data-binary '{"jsonrpc":"1.0","id":"curltext","method":"getblockchaininfo","params":[]}' -H 'content-type:text/plain;' http://your_username:your_password@my_machine_ip:8332

I get timeout:
curl: (28) Failed to connect to my_machine_ip port 8332: Connection timed out

But when I run:
docker run --name mynginx1 -p 8332:80 -d nginx

I can curl to 8332 from my own computer and get a response.
my netstat with the docker running:
ubuntu@blahblah:~$ sudo ss -ltpn
State              Recv-Q              Send-Q                            Local Address:Port                           Peer Address:Port
LISTEN             0                   4096                                    0.0.0.0:8332                                0.0.0.0:*                 users:(("docker-proxy",pid=13131,fd=4))
LISTEN             0                   128                               127.0.0.53%lo:53                                  0.0.0.0:*                 users:(("systemd-resolve",pid=644,fd=13))
LISTEN             0                   128                                     0.0.0.0:22                                  0.0.0.0:*                 users:(("sshd",pid=760,fd=3))
LISTEN             0                   4096                                       [::]:8332                                   [::]:*                 users:(("docker-proxy",pid=13139,fd=4))
LISTEN             0                   128                                        [::]:22                                     [::]:*                 users:(("sshd",pid=760,fd=4))

What's lead me to the conclusion that my problem is that I dont have IPv6 rpc bind with the bitcoin node.
I went to the manual and read the following:

-rpcbind=[:port]
Bind to given address to listen for JSON-RPC connections. Do not expose
the RPC server to untrusted networks such as the public internet!
This option is ignored unless -rpcallowip is also passed. Port is
optional and overrides -rpcport. Use [host]:port notation for
IPv6. This option can be specified multiple times (default:
127.0.0.1 and ::1 i.e., localhost)

But every way I tried to specify the IPv6 in the rpcbind is not helping.

At least for IPv4, you can't specify 0.0.0.0 for rpcbind. You'll get this error in bitcoind logs if you try:

Binding RPC on address 0.0.0.0 port 18443 failed.

Try 127.0.0.1 for IPv4, or ::1/128 for IPv6.
bitcoind -rpcbind=127.0.0.1

Thanks for the input. So I should I expose the RPC for outside communication?

Your answer gave me the right direction, and the following answer provided me the further information i needed: https://askubuntu.com/a/1000779/1464279 (for future visitors).
Thank you.

no, do NOT expose the RPC port to the internet, or any untrusted network. RPC is used to control the bitcoin node, it is not used to relay transactions or otherwise participate in the network. If you don't know you need it, you don't need it.

Its behind VPN as I wrote in my question. "If you don't know you need it" what? I didnt understand you point. Anyway I have a service that query the btc-node, and its uses the RPC to communicate.


text:
Is it not possible to have password reset feature in Bitcoin Core Wallet?
I would like to know why there is no feature to retrieve forgot password or reset with a new password ?
Thanks

Because it could be used by anyone with access to your device. You may as well have no passphrase and leave the wallet completely unprotected.
Businesses can offer a password reset for an account because they have details of their customers including ways to weakly check identity. Bitcoin core, by design, is not a business, has no lists of customers and no ways to verify their identity.
It is important that developers do not have any back door access to everyone else's money.

Thank you. It makes sense to me. Can't we have security questions at least ?

You may be able to find a password manager with the features you desire. A master password to retrieve your subsequently forgotten Bitcoin Core wallet-passphrase and some security questions to recover or reset a forgotten master password.


text:
How and when do nodes stop broadcasting a transaction?
Suppose a node begins broadcasting a signed transaction.
Question 1. At what stage is the signature verified? In §5 of the whitepaper, verification only appears during block acceptance after mining. Isn't it more sensible for a node to verify the signature on any transaction it tentatively places in a block?
Question 2. For how long does a node broadcast a transaction? How does it know when to stop broadcasting a transaction, either because it was accepted, or because it is invalid?

The whitepaper is only a high-level overview of Bitcoin, basically a marketing document. You may be interested in this errata and associated comments for the whitepaper created by David Harding.
Every node will verify the signatures on a transaction when it first receives it. If the transaction is deemed valid and passes is_standard policies, the node will then add the transaction to its mempool and relay it to the node's peers. The node will cache the result of the transaction verification for some time, to be able to skip repeating this check if the transaction is included in a block soon after.
A node will only rebroadcast a transaction once to all of its peers. However, the receivers and senders of transactions may rebroadcast transactions more often given their personal investment in the transaction's success if it doesn't confirm promptly.

The receiver's wallet may also rebroadcast regularly.

Thanks for the very instructive answer! A few follow-ups. 1. So how does a transaction enter the network? Is it broadcast by something other than a node at first? 2. You wrote a node rebroadcasts once - I'm assuming this refers to verified transactions. What about signed-but-unverified transactions? 3. How does a node know when to use the single rebroadcast?

A wallet creates the transaction and submits it to at least one Bitcoin Node. Bitcoin Core nodes track all the Unspent Transaction Outputs, i.e. all pieces of bitcoin that are available for spending, so each node can unilaterally assess whether a transaction could currently be included in the blockchain. That's the check that each node performs on unconfirmed transactions when it receives them. Then the node will forward the unconfirmed transaction once to each of its peers, right after receiving it and deeming it valid.

I don't know what you mean with "verified" and "signed-but-unverified" transactions. Bitcoin nodes will simply discard any transactions they assess to be invalid, and only forward valid transactions. When a transaction is included in the blockchain it's confirmed, which means it's probabilistically final and gets "more final" the more blocks get found (i.e. unchangeable unless the chaintip gets reorganized which happens seldom, and less likely the more other blocks have followed).

Anyway, since each node forwards each of the unconfirmed transactions it sees to all of its peers, (or rather, offers to forward them via an inventory announcement), the transactions get gossiped through the network and generally every other online node should hear about them within a minute or so. Nodes that aren't online don't get them until they're included in a block, since everyone gets every block when they synchronize with the network to catch up to the chaintip. You may also find this post interesting: https://bitcoin.stackexchange.com/q/12427/5406

Huge thanks for your patience and detailed replies!

I guess the confusion was probably in the terminology of "invalid/valid" and unconfirmed/confirmed. An invalid transaction would for example be one that spends money which doesn't exist or has an invalid signature. A valid transaction would be one that a node thinks could be included in the blockchain as is. Unconfirmed or confirmed on the other hand means whether or not a transaction has been included in the blockchain.

@Murch maybe soon I'll have the reputation to upvote :)


text:
gettransaction (The remote server returned an error: (500) Internal Server Error.)
Im trying to get how many confirmations a transaction has. However I just get error when I try to get gettransaction.
http://block-explorer.com/tx/e15e0edd6d6b07531c146a91528ba628b28d37acb28e6a271a563a2284092e16
GetBlock works fine with the transaction here.. also getrawtransaction works.
However when I try gettransaction I get this error.
The remote server returned an error: (500) Internal Server Error.
This is how my request looks like
{"id":"0","method":"gettransaction","params":["e15e0edd6d6b07531c146a91528ba628b28d37acb28e6a271a563a2284092e16"]}
Any ideas of what Im doing wrong here?

Doesnt work for transactions that are not your own.


text:
What trust am I placing where when I use Electrum?
I have read that Electrum never is given your private keys (which makes sense), but I'm still unsure what sacrifices it makes in order to not require you to not store the entire ~14GB blockchain.
So is the gist of it "you make transactions on your own using your information, but we watch the blockchain and tell you anything relevant that happens"?  Am I understanding this at all correctly?
If so, who is "we" in that?  And can't whoever I am trusting lie to me about how many bitcoins I have?

"We" are volunteers running Electrum servers. There's almost no trust in them, the absolute worst they can do is feed you false negatives about the balance of your wallet, or they can also choose not to broadcast your transactions and pretend that they have. You trade some privacy in that they can see the contents of your entire wallet and associate it with your IP address. The client supports Tor connections if this is an issue for you.
The blockchain is 22Gb now, actually.

According to Blockchain Size, the raw size is just about 14 GB today. The extra size on your client may be due to additional indexes or other tracking data.

Yeah, the size of my Bitcoin-Qt (OS X) data directory is 17 GB. It varies by client.

"the absolute worst they can do is feed you false negatives about the balance of your wallet"
According to the new version this not possible anymore.

A Patricia tree data structure, also called "Ultimate Blockchain Compression", will be implemented in Electrum servers. This data structure allows a client to get the balance of any address instantly, and it will also generate a "proof of completeness" (the root hash of the patricia tree), that can be used to check that the server sent all UTXOs related to a given address to the client.<<

https://bitcointalk.org/index.php?topic=427617.0

@GregHewgill With indexes it's a bit larger, and it depends quite a bit on your node. Some are smaller than others.

@rdymac Yep, I wasn't sure if that was applicable or not yet though.