Search content
Sort by

Showing 5 of 5 results by Kirsting
Post
Topic
Board Trading Discussion
Re: High Frequency Trading
by
Kirsting
on 13/03/2021, 12:27:03 UTC
Biggest challenge relies on exchanges themselves. They have to propose such technology to let crypto traders act as fast as usual HFT traders do.
That's correct. Classic stock exchanges have hundreds of times more power (> 10m orders per second), compared to "web exchanges"(< 100k orders per second) which are sometimes done entirely on PHP and API works only on websockets.
Post
Topic
Board Wallet software
Re: BtcIO - Open source, cold, BTC wallet
by
Kirsting
on 12/03/2021, 12:51:28 UTC
A desktop app(console and with a GUI) for Windows and Linux, written in .NET CORE, designed to quickly generate privates and addresses by seed phrase, view balances and send transactions from your private accounts and wallets.

Github https://github.com/avadhuta/BtcIO/releases

screenshots:
https://i.imgur.com/ZxuXYuV.jpeg
https://i.imgur.com/6evZ7YW.jpeg
https://i.imgur.com/M8tslVi.jpg
https://i.imgur.com/kjvhsnS.jpg


The example of use with a test network (with a mainnet it works the same way):

For console https://youtu.be/Mnm2dWqRP8g

For GUI variant https://youtu.be/JiTr551-veE


The libraries used are NBitcoin and QbitNinja, as well as the blockcypher.com API.

It is better to hide private keys, they cannot be entered from the keyboard:o or by copying, it is not safe.

The seed phrase generates an encrypted wallet with a password.

User entropy is also needed, one RNG is not reliable.
Post
Topic
Board Trading Discussion
Re: High Frequency Trading
by
Kirsting
on 12/03/2021, 12:11:45 UTC
I am not that active on this discussion but sometimes I do lurk. And I think that this post is going to be relevant to the future of trading in general. I was watching a Youtube video about High Frequency Trading and I think that it will be the future of trading because the program can do trading faster than any human being. There is more in depth in the video but I will try my best to summarize HFT, consider that the stock price is around 10 USD and you ordered at that price but the prices dropped to 9 USD and HFT swoops in and buys at that price and then when your order arrives at 10 USD they are going to sell it to you with the profit of 1 USD. I am using stock as an example because the documentary that I watched was mostly focused on that. My question is, will HFT be feasible in the cryptocurrency market? Will it face any problem?

Link to the documentary: The Wild World of High Frequency Stock Trading (Documentary)
HFT has been present since the beginning of trading on exchanges.
Will it be used on the cryptocurrency market?

Surely, but the resources needed are not given to everyone. Mainly banks, hedge funds, etc are using it. In the US, they even use what we use to call the "dark fiber" to get a super-high-speed internet connection. Oh, I should mention, the infrastructures for this fiber are paid with citizens' taxes. It's like if, during a war, you pay the tanks for your enemies.

It also needs very developed algorithms and I'm not exaggerating telling you some worth more than a million-dollar
When these entities will enter the market, it is more than likely that they will use the same methods in their race for profits.

Will it face any problem?

I don't see why. If this is not a problem in traditional finance there is no reason it should be any different in the crypto market.
Except for the problem that we could ask ourselves some ethical questions. Namely that as in finance it disadvantages people who do not have the resources I was talking about previously. We will not be on an equal level.

But since people don't seem to care, I don't see why they would start when HTF will be used with the crypto market.
Perhaps it's already in use without we notice it.
HFT is a fairly broad concept, from slow intraday trading (1-10 trades in the day) with closing positions at night(if the market closes) and the so-called UHFT with hundreds of orders per second and dozens of trades.

The requirements for infrastructure and specialists are also very different, from a couple of thousand dollars spent on programming your scalping strategy and connectors to the API of exchanges, to hundreds of millions if you want to compete with Jim Simons funds.
Post
Topic
Board Altcoin Discussion
Get the ether address from private key using C # and the BouncyCastle library
by
Kirsting
on 26/02/2021, 14:47:31 UTC
Hi all.

I want to get the ether address from private key using C # and the BouncyCastle library, but the correct result does not come out Sad

Code:

Code:
using System;
using Org.BouncyCastle.Crypto.Digests;

namespace EthTest
{

    public static class ConvertExt
    {
        public static byte[] Hex2Bytes(this string source)
        {
            source = source.Trim().ToLower();

            var bytes = new byte[source.Length / 2];

            for (int i = 0; i < source.Length / 2; i++)
            {
                int v = 0;

                for (int j = i * 2; j < i * 2 + 2; j++)
                {
                    var c = source[j];
                    v *= 16;
                    if (c >= '0' && c <= '9') v += (c - '0');
                    else if (c >= 'a' && c <= 'f') v += (c - 'a' + 10);
                }
                v &= 0xff;
                bytes[i] = (byte)v;
            }

            return bytes;
        }

        public static string ToHex(this byte[] ba)
        {
            string rv = "";
            for (int i = 0; i < ba.Length; i++) rv += $"{ba[i]:x2}";
            return rv;
        }
    }

    class Program
    {

        static byte[] Keccak256(byte[] src)
        {
            var digest = new Sha3Digest();
            var result = new byte[digest.GetDigestSize()];
            digest.BlockUpdate(src, 0, src.Length);
            digest.DoFinal(result, 0);
            return result;
        }

        static (string privKey, string pubKey, string address) CreateEthAddr(byte[] privKey)
        {

            var secp256k1 = Org.BouncyCastle.Asn1.Sec.SecNamedCurves.GetByName("secp256k1");
            var privBi = new Org.BouncyCastle.Math.BigInteger(privKey);
            var mult = secp256k1.G.Multiply(privBi);

            var x = mult.Normalize().XCoord.ToBigInteger().ToByteArray().ToHex();
            var y = mult.Normalize().YCoord.ToBigInteger().ToByteArray().ToHex();
            string pubKey = x + y;

            var hash = Keccak256(pubKey.Hex2Bytes());

            string address = "0x";
            for (int i = hash.Length - 20; i < hash.Length; i++) address += $"{hash[i]:x2}";


            return (privKey.ToHex(), pubKey, address);

        }



        static void Main(string[] args)
        {
            var privKey = new byte[32];
            privKey[0] = 1;

            var eth = CreateEthAddr(privKey);
            Console.WriteLine($"privKey: {eth.privKey}\npubKey: {eth.pubKey}\naddress: {eth.address}\n ");
            Console.WriteLine("right address: 0xDC5b20847F43d67928F49Cd4f85D696b5A7617B5");

            Console.ReadLine();
        }
    }
}


Please help!

Thanks.
Post
Topic
Board Development & Technical Discussion
Topic OP
Ether address from private key using C# BouncyCastle
by
Kirsting
on 26/02/2021, 12:38:27 UTC
Hi all.

I want to get the ether address from private key using C # and the BouncyCastle library, but the correct result does not come out Sad

Code:

Code:

using System;
using Org.BouncyCastle.Crypto.Digests;

namespace EthTest
{

    public static class ConvertExt
    {
        public static byte[] Hex2Bytes(this string source)
        {
            source = source.Trim().ToLower();

            var bytes = new byte[source.Length / 2];

            for (int i = 0; i < source.Length / 2; i++)
            {
                int v = 0;

                for (int j = i * 2; j < i * 2 + 2; j++)
                {
                    var c = source[j];
                    v *= 16;
                    if (c >= '0' && c <= '9') v += (c - '0');
                    else if (c >= 'a' && c <= 'f') v += (c - 'a' + 10);
                }
                v &= 0xff;
                bytes[i] = (byte)v;
            }

            return bytes;
        }

        public static string ToHex(this byte[] ba)
        {
            string rv = "";
            for (int i = 0; i < ba.Length; i++) rv += $"{ba[i]:x2}";
            return rv;
        }
    }

    class Program
    {

        static byte[] Keccak256(byte[] src)
        {
            var digest = new Sha3Digest();
            var result = new byte[digest.GetDigestSize()];
            digest.BlockUpdate(src, 0, src.Length);
            digest.DoFinal(result, 0);
            return result;
        }

        static (string privKey, string pubKey, string address) CreateEthAddr(byte[] privKey)
        {

            var secp256k1 = Org.BouncyCastle.Asn1.Sec.SecNamedCurves.GetByName("secp256k1");
            var privBi = new Org.BouncyCastle.Math.BigInteger(privKey);
            var mult = secp256k1.G.Multiply(privBi);

            var x = mult.Normalize().XCoord.ToBigInteger().ToByteArray().ToHex();
            var y = mult.Normalize().YCoord.ToBigInteger().ToByteArray().ToHex();
            string pubKey = x + y;

            var hash = Keccak256(pubKey.Hex2Bytes());

            string address = "0x";
            for (int i = hash.Length - 20; i < hash.Length; i++) address += $"{hash[i]:x2}";


            return (privKey.ToHex(), pubKey, address);

        }



        static void Main(string[] args)
        {
            var privKey = new byte[32];
            privKey[0] = 1;

            var eth = CreateEthAddr(privKey);
            Console.WriteLine($"privKey: {eth.privKey}\npubKey: {eth.pubKey}\naddress: {eth.address}\n ");
            Console.WriteLine("right address: 0xDC5b20847F43d67928F49Cd4f85D696b5A7617B5");

            Console.ReadLine();
        }
    }
}


Please help!

Thanks.