Bitcoin Forum
June 22, 2024, 04:32:24 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Bitcoin Technical Support / Re: 401 Unauthorized when try to connect to bitcoin-core using curl on: September 12, 2023, 02:53:10 PM
Good to see your problem solved. Although your thread doesn't mention usage of --http1.1 parameter on curl though.

It was mentioned in the link sent by @pinggoki.

Re: reloading: yep, lessons learned.
2  Bitcoin / Bitcoin Technical Support / Re: 401 Unauthorized when try to connect to bitcoin-core using curl on: September 10, 2023, 07:42:38 AM
I know how it sounds, but it works now without any intervention from my side, using both `--user testuser` only and with password. Without adding `--http1.1`

The only idea I can think of is that the daemon reloads config not immediately but after some time.
Anyway, it's solved. Thanks to everyone who tried to help.
3  Bitcoin / Bitcoin Technical Support / Re: 401 Unauthorized when try to connect to bitcoin-core using curl on: September 09, 2023, 02:50:07 PM
Quote
you are not passing in credentials
Not exactly. When I do not give the password to `curl`, it asks directly:
Code:
Enter host password for user 'testuser':
You can see it in the very first code snippet in this thread.

Nevertheless, I have just tried: re-created and added the `rpcauth` string, sent -HUP, then tried
Code:
curl --user testuser:testpass
and
Code:
http://testuser:testpass@127.0.0.1:8332/ 
the same result, 401 Unauthorized.
And yes, the curl request was taken directly from the doc.

Anything else I can try here?

4  Bitcoin / Bitcoin Technical Support / 401 Unauthorized when try to connect to bitcoin-core using curl on: September 08, 2023, 07:08:46 PM
Hello All, could you help, please?

The problem: I try to run a `curl` request but get "401 Unauthorized error"
    
Code:
curl --user testuser --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "getrawtransaction", "params": ["e0cee...47ac5", true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/ -D -

    Enter host password for user 'testuser':
    HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Basic realm="jsonrpc"
    Date: Sat, 02 Sep 2023 18:12:46 GMT
    Content-Length: 0
    Content-Type: text/html; charset=ISO-8859-1

The messages in the debug log of the daemon:
    
Code:
2023-09-02T15:59:44Z ThreadRPCServer incorrect password attempt from 127.0.0.1:36472

I run `bitcoind` this way:
    
Code:
/mnt/bitcoin/bin/bitcoind -conf=/mnt/bitcoin/bitcoin.conf

Also, I have a symlink for this config:
    
Code:
ll ~/.bitcoin/bitcoin.conf
    lrwxrwxrwx 1 user user 25 Sep  1 18:42 /home/user/.bitcoin/bitcoin.conf -> /mnt/bitcoin/bitcoin.conf

Config:
    
Code:
grep -v "#" /mnt/bitcoin/bitcoin.conf | grep -v "^$"                                                                daemon=1
    daemonwait=1
    ...
    rest=1
    rpcallowip=192.168.0.128/25
    rpcallowip=127.0.0.1
    rpcauth=testuser:3ad8c2e058a161304a911bcc60c208d2$a364136d41edda037d267e909f9f0355537aefee08b6fd29da2eee59559cf084
    server=1
    [main]
    [test]
    [signet]
    [regtest]

`rpcauth` was created this way, and then inserted in the config:
    
Code:
python3 bitcoin/share/rpcauth/rpcauth.py testuser testpasst                                                                                            String to be appended to bitcoin.conf:
    rpcauth=testuser:3ad8c2e058a161304a911bcc60c208d2$a364136d41edda037d267e909f9f0355537aefee08b6fd29da2eee59559cf084
    Your password:
    testpasst

Also, I tried to replace `rpcauth` with
Code:
rpcuser=testuser
rpcpassword=testpasst

And did
    
Code:
kill -HUP `cat /mnt/btc_data/bitcoind.pid`

after every config change (idk wether it's needed or not)

Yes, I have "t" at the end of pass everywhere (I'm too frustrated to re-do all this solely to remove the typo, but the password was copy-pasted many times so I 100% sure there's no mistype answering curl)

I tried:
https://bitcoin.stackexchange.com/questions/115668/401-unauthorized-connection-using-python-bitcoinrpc
https://bitcoin.stackexchange.com/questions/106395/bitcoinrpc-authproxy-jsonrpcexception-342-non-json-http-response-with-401-u
https://bitcoin.stackexchange.com/questions/36433/bitcoin-rpc-works-in-bitcoin-cli-but-not-in-python-bitcoinrpc-no-json-object
https://bitcoin.stackexchange.com/questions/77214/bitcoin-rpc-returning-401

Bitcoin Core ver 25.0

What am I doing wrong?
Thank you.
5  Bitcoin / Development & Technical Discussion / Any good doc on Bitcoin keys explained? on: July 07, 2023, 03:45:27 PM
Hello All,

I found a diagram, which explains in an excellent way how to convert a public key to a P2PKH address here(1).  In fact, the schema from that doc is the best element. Also, I found a good map of types of addresses/keys here(2) and a list of all possible address prefixes here(3).

I'd like to understand how exactly private keys are converted into pub keys and addresses - like in (1) but for all elements (well, except testnet), starting from the private key. In other words, I need a doc, as clear as (1), that describes all way from random 256bit to other formats.

Is there any documentation on that, ideally - as clear as (1)? Thank you.

(1) https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
(2) https://en.bitcoin.it/wiki/Invoice_address
(3) https://en.bitcoin.it/wiki/List_of_address_prefixes
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!