web service – How to import a .cer x509 certificate into Net Core for WSDL integration

I'm trying to import a .cer x509 certificate for the web service integration to make the comparison and allow me to get the requested data, but in Net Core I do not get them .

I'm trying this way:

        var pathCert = conf.getValueConfig("configApplication", "pathCert");
        var certs = new X509Certificate(File.ReadAllBytes(pathCert));
        X509Certificate2 cert = new X509Certificate2(certs);
        Uri uri = new Uri("https://website/");
        ws.ClientCredentials.ServiceCertificate.ScopedCertificates.Add(uri, cert);


Custom Distributions – Which Linux Distros Is Best for the Intel Core 2 Duo 2 GB RAM

I will install Linux in my system, which is very old, and I will use it for occasional tasks and basic programming. Configuration:

Intel Core 2 Duo processor E7400 2.80 GH;
Ram 2 GB; 500 GB disk;

I already use Ubuntu Disco 19 on my laptop. So I want to try something new, lighter and faster. I will completely remove the windows and install Linux. Suggest an operating system that runs fast in this configuration and does not freeze.

Do not give the best suggestion of any Linux distribution outside of Ubuntu 19

bitcoin core – How to put a comment using sendrawtransaction in bitcoincore?

I'm using sendrawtransaction to submit my transaction and I want to put a comment or comment in a transaction, like the sendtoaddress fields that are stored in the wallet and that are not sent with the transactions. I think the "data": "hex" field in createrawtransaction is for that, but I can not use it.

I'm using the following list as recipient fields in createrawtransaction, but I get an error: bitcoinrpc.authproxy.JSONRPCException: -8: Invalid parameter, key-value pair must contain exactly one key

 ({'mowMh2bocyV97NUP9vqVsuCPcJ2XhJUuoH': Decimal('0.000123'),
 '2NAJPzU1pVTcNABNrdrD336eRWRrbKBBuSe': Decimal('0.03149347')},
 {'data': 'happy birthday'})

How to use it? Is there a good idea to do that?

asp.net core – controllers in different assemblies

I have seen many solutions with controllers in a separate assembly, basically starting and program in one project and controllers in another.

What are the benefits of doing this? Is it a better performance or just a personal preference?

(These are only controllers, the solutions have different projects for the interfaces, implementations and other elements necessary for the DI).

bitcoin core – Resolve BTC long memory pool (lots of unconfirmed messages)

I started with the Bitcoin exchange service, creating rawtransaction and broadcasting it. The problem I have to deal with is the mempool string too long (more than 25 unconfirmed transactions), for example:
64: chain too long

Using limitancestorcount and limitdescendantcount Just solve on the local node, these late txs (transaction after the first 25) have to wait a long time to be rebroadcast like this:
Transaction not found in blockchain

Here is my testnet address has a lot of unconfirmed txs and still waiting, if I search on another explorer, I can not see 45 unconfirmed txs, same for getrawtransaction on the node, respose is No such mempool or blockchain transaction:


So, how can I avoid this problem, I just think of several methods, such as: divide the main address into a few sub-addresses, which divides the main UTXO into a few UTXOs, create a many-to-many transaction (currently 1 to 2, 1 target and 1 changeAddress back), using UTXO first with high confirmation, … Which options can bring better results and performance for a long scaling? term? Any advice is really appreciated. And last question, is there a way to mark 1 UTXO used 25 times (for example, I use UTXO X first, then it is returned, Y is used, Z is returned, total using X = 2, I have no related information to calculate it because the node returns, UTXO only contains txId).

c # – ASP.Net Core WebAPI Authorization Policy for User or Administrator

I have a controller that returns data on users. I want to set the authorization so that an administrator can access this controller and retrieve data for any user, and that a non-administrator user can access the controller and retrieve data for himself.

I have excluded to use (Authorize (Roles = "Admin")) because it means that users can not get their own data. I've therefore inserted the following logic in the controller action:

var userId = _httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.Name).Value;
var roles = _httpContextAccessor.HttpContext.User.FindAll(ClaimTypes.Role);

var query = roles.Select(r => r.Value).Contains("Admin");

Customer customer =await _context.Customers.FindAsync(id);

if (!(customer.EmailAddress == userId || query))
 return Unauthorized();

This is roughly equivalent to this Stack Overflow response, but for ASP.Net Core rather than MVC.

My question is: is there a way to do that with an authorization policy? The addition of the RequireRole verification is simple and is covered in Microsoft's documentation as well as in countless blogs, but I have not found nor found a way to use a strategy for verify that the data that the user is trying to access is theirs.

I'm sure this is not a rare requirement, is there a way to do that, or is what I'm doing right now? The only other approach I could think of was to have two separate endpoints, but both options seem inelegant.

bitcoin core – Creating a P2SH address is not the same as an address registered on an rpc node

I have a private key and I try to create a P2SH address on testnet as my node was created, but they are not identical. Please help me a little, thank you very much.

Private key: c5964e19634e473e9c8fed3b149c4d44b6d62d62724035aad3eb911a1495ae27

P2SH address from 1 threshold and 1 public key:

P2WPKH address: 2NGA8uGdnaQ21phNpVyV5uye5cbUtudxBWh || tb1qld2fzw9gj30wxjamsz73fug62das7cyq0em4mn

Node address: 2N8qKVKuR3QAy2cA5fF2QbuCpBGfGCmbUHx

Here are more details of getaddressinfo:

    "result": {
        "address": "2N8qKVKuR3QAy2cA5fF2QbuCpBGfGCmbUHx",
        "scriptPubKey": "a914aafc9f09b99cbb1ba46001ec4868ba4fb32543ca87",
        "ismine": true,
        "solvable": true,
        "desc": "sh(wpkh((a1696bdc/0'/0'/375509')02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7))#hrgzj3gs",
        "iswatchonly": false,
        "isscript": true,
        "iswitness": false,
        "script": "witness_v0_keyhash",
        "hex": "00146da71bc5de0c0b59bbf73520df7e7d4048d02594",
        "pubkey": "02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7",
        "embedded": {
            "isscript": false,
            "iswitness": true,
            "witness_version": 0,
            "witness_program": "6da71bc5de0c0b59bbf73520df7e7d4048d02594",
            "pubkey": "02a7065a210c28d27a591e55ac6be092111349fc4b23927bb4d13c46a683bcfff7",
            "address": "tb1qdkn3h3w7ps94nwlhx5sd7lnagpydqfv5pyqurf",
            "scriptPubKey": "00146da71bc5de0c0b59bbf73520df7e7d4048d02594"
        "label": "test",
        "ischange": false,
        "timestamp": 1561438016,
        "hdkeypath": "m/0'/0'/375509'",
        "hdseedid": "e2e9dd17501f967b789c28c4be1dbf64897ad8d2",
        "hdmasterfingerprint": "a1696bdc",
        "labels": (
                "name": "test",
                "purpose": "receive"
    "error": null,
    "id": 1

Can I run a Lightning node on the same computer as the Bitcoin Core node?

I have a Windows 10 laptop that runs a complete Bitcoin node with the help of Bitcoin Core. Is it possible to simultaneously run a Lightning node on the same laptop with the Bitcoin node?

offline transactions – Bitcoin Core signing with the help of signrawtransactionwithkey returns null

I'm trying to sign a transaction to spend funds from a multisig address 3 out of 7.

signrawtransactionwithkey 0200000001df84bf87bee6e5ef37252bee0aefffff01570400000000000017a914ab7810c333815366e268a8e21cdd516a73e353348700000000 "(   "L19iWVPKJLUm316JUSwuKanZ1aUNk",
    "txid": "a9d4599e15b53f3eb56bda871e8b34f2f430c",
    "vout": 0,
    "scriptPubKey": "a9142371a0f091d72061f52b3a87",
    "redeemScript": "53210386c5bb843616d7e504997778707701b5245904a48d0e2e7b64e0fe346bee975d321023bd5cef26304c25450933da1dd50d6d39625ae8154319e14884c76b0300336a22102ed48db7649ae65433f6c46bbdbf143927411c9c12878f85b64815183a458b5ea210379371734a424889ded7f8de018d7e4c6f1ce7196980c80e9d6f3bb748668415d2102051d068ac8dee4aa46af230ea46d96a860c4c65f000831e748b866ffdfb74f3d21029c7cc1f53494ae3ce3f44adbdf9bee34ce5f8e70cb099b9c72ba31f71cf1617c57ae",
    "amount": "0.00001234"

I've redacted some of the private keys, etc. – although there are only a few sats, so if someone guessed that he is taking advantage of it, enjoy it.

The answer I get is "null" instead of the expected output of signrawtransaction (including the signed transaction).

bitcoin core – How can I determine the descriptor of a given extended public key?

I'm trying to run the bitcoin-cli getdescriptorinfo on a ypub... extended public key. Whenever I do that, I get the message:

error code: -5
error message:
Invalid descriptor

How can I determine the correct descriptor for a given ypub?

I'm trying to derive the addresses using bitcoin core and import them into my wallet. I'm using pretty bitcoin-core for the first time, so I'm not even sure that's the best way to do it. If not, what other method could I use?