wallet – How are the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY derived?

I want to know how the prefixes for EXT_PUBLIC_KEY and EXT_PRIVATE_KEY are derived. For example in bitcoin you have:

base58Prefixes(PUBKEY_ADDRESS) = std::vector<unsigned char>(1,0);
base58Prefixes(SCRIPT_ADDRESS) = std::vector<unsigned char>(1,5);
base58Prefixes(SECRET_KEY) =     std::vector<unsigned char>(1,128);
base58Prefixes(EXT_PUBLIC_KEY) = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes(EXT_SECRET_KEY) = {0x04, 0x88, 0xAD, 0xE4};

And I another cryptocurrency has:

base58Prefixes(PUBKEY_ADDRESS) = std::vector<unsigned char>(1,25); 
base58Prefixes(SCRIPT_ADDRESS) = std::vector<unsigned char>(1,5);
base58Prefixes(SECRET_KEY)     = std::vector<unsigned char>(1,153); // 25 + 128
base58Prefixes(SECRET_KEY_OLD) = std::vector<unsigned char>(1,151);
base58Prefixes(EXT_PUBLIC_KEY) = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes(EXT_SECRET_KEY) = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container<std::vector<unsigned char> >();

Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I’ve been running into some problems. I want to understand how the EXT_PUBLIC_KEY is derived as for the development and how it is used to generate addresses. I’m trying to implement it into pywallet (https://github.com/ranaroussi/pywallet) but it seems to not support this kind of EXT_PUBLIC_KEY

wallet – How is EXT_PUBLIC_KEY and EXT_PRIVATE_KEY derived?

I want to know how EXT_PUBLIC_KEY and EXT_PRIVATE_KEY is derived. For example in bitcoin you have:

base58Prefixes(PUBKEY_ADDRESS) = std::vector<unsigned char>(1,0);
base58Prefixes(SCRIPT_ADDRESS) = std::vector<unsigned char>(1,5);
base58Prefixes(SECRET_KEY) =     std::vector<unsigned char>(1,128);
base58Prefixes(EXT_PUBLIC_KEY) = {0x04, 0x88, 0xB2, 0x1E};
base58Prefixes(EXT_SECRET_KEY) = {0x04, 0x88, 0xAD, 0xE4};

And I another cryptocurrency has:

base58Prefixes(PUBKEY_ADDRESS) = std::vector<unsigned char>(1,25); 
base58Prefixes(SCRIPT_ADDRESS) = std::vector<unsigned char>(1,5);
base58Prefixes(SECRET_KEY)     = std::vector<unsigned char>(1,153); // 25 + 128
base58Prefixes(SECRET_KEY_OLD) = std::vector<unsigned char>(1,151);
base58Prefixes(EXT_PUBLIC_KEY) = list_of(0x1E)(0x56)(0x2D)(0x9A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes(EXT_SECRET_KEY) = list_of(0x1E)(0x56)(0x31)(0xBC).convert_to_container<std::vector<unsigned char> >();

Im trying to make a server that generates addresses from the Extended public key without exposing the private key on the latter cryptocurrency but I’ve been running into some problems. I want to understand how the EXT_PUBLIC_KEY is derived as for the development and how it is used to generate addresses. I’m trying to implement it into pywallet (https://github.com/ranaroussi/pywallet) but it seems to not support this kind of EXT_PUBLIC_KEY

Can I know if a bitcoin private/public key or address was derived from another key in an HD wallet by its structure?

If I have a bitcoin private key, public key or address, can I know if it is a root private key or some other part which derived from a root private key in an HD wallet by the structure of it?

To be more specific – I don’t need to know any details about the parent keys or to connect a hierarchy between two keys – just to know by the structure if to treat this key/address as “unique” one in my program.

c# – Base constructor vs protected method for constructing derived class

So, I got a question here that appears to be opinion based. Rather than tackling how and where I need to implement IDisposable, I’d rather question myself how the code is written, is it a good design.

I got a base Node class which has a StreamReader and StreamWriter and 2 derived classes Client and Server. The Client only really has to set up his side of the AnonymousPipes based upon the PipeHandles he gets from the server. The Server has to do more since he needs to be able to broadcast his PipeHandles.

In reality, the Main application (Server) starts the Child application (Client) with the PipeHandles as arguments.

I think my setup is pretty good. I’ve got an open base Node class which can simply Read and Write Streams. The derived classes have some more specific info they need to be initialized. Everything looks unit-testable. The “not so nice thing” I did in my opinion is how the Server class gets back his PipeStreams to get the handles. In order to do this the Node has a little bit too much info in order to be a base class (PipeStream properties).

Question: Would how I did it be a good way to do it if this was requested to program as a developer at a company? I’m not sure if the Client and Server constructors are executed well.

public class Node
{
    private readonly StreamReader streamIn;
    private readonly StreamWriter streamOut;

    protected Node(PipeStream pipeStreamIn, PipeStream pipeStreamOut)
    {
        PipeStreamIn = pipeStreamIn ?? throw new ArgumentNullException(nameof(streamIn));
        PipeStreamOut = pipeStreamOut ?? throw new ArgumentNullException(nameof(streamOut));

        streamIn = new StreamReader(pipeStreamIn);
        streamOut = new StreamWriter(pipeStreamOut)
        {
            AutoFlush = true
        };
    }

    protected PipeStream PipeStreamIn { get; }
    protected PipeStream PipeStreamOut { get; }

    public string Read()
    {
        return streamIn.ReadLine();
    }

    public void Write(string line)
    {
        streamOut.WriteLine(line);
    }
}

public class Client : Node
{
    public Client(string pipeInHandleAsString, string pipeOutHandleAsString) : base(new AnonymousPipeClientStream(PipeDirection.In, pipeInHandleAsString), new AnonymousPipeClientStream(PipeDirection.Out, pipeOutHandleAsString)) { }

    public void Sync()
    {
        // Sync code
    }
}

public class Server : Node
{
    public Server() : base(new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable), new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable))
    {
        ClientPipeInHandleAsString = ((AnonymousPipeServerStream)PipeStreamOut).GetClientHandleAsString();
        ClientPipeOutHandleAsString = ((AnonymousPipeServerStream)PipeStreamIn).GetClientHandleAsString();
    }

    public string ClientPipeInHandleAsString { get; private set; }
    public string ClientPipeOutHandleAsString { get; private set; }

    public void Sync()
    {
        ((AnonymousPipeServerStream)PipeStreamIn).DisposeLocalCopyOfClientHandle();
        ((AnonymousPipeServerStream)PipeStreamOut).DisposeLocalCopyOfClientHandle();

        // Sync code
    }
}

I’ve also got my 1st code design below. There a protected Initialize method does the things the Node constructor does in my 2nd design. The Client makes his PipeStreams and passes them to the Node. The Server does something similar but needs them as a field since he needs to do something with them during the Sync.

public class Node
{
    private readonly StreamReader streamIn;
    private readonly StreamWriter streamOut;

    protected Initialize(PipeStream pipeStreamIn, PipeStream pipeStreamOut)
    {
        if (streamIn == null) throw new ArgumentNullException(nameof(streamIn));
        if (streamOut == null) throw new ArgumentNullException(nameof(streamOut));

        streamIn = new StreamReader(pipeStreamIn);
        streamOut = new StreamWriter(pipeStreamOut)
        {
            AutoFlush = true
        };
    }

    public string Read()
    {
        return streamIn.ReadLine();
    }

    public void Write(string line)
    {
        streamOut.WriteLine(line);
    }
}

public class Client : Node
{
    public Client(string pipeInHandleAsString, string pipeOutHandleAsString)
    {
        var streamIn = new AnonymousPipeClientStream(PipeDirection.In, pipeInHandleAsString);
        var StreamOut = new AnonymousPipeClientStream(PipeDirection.Out, pipeOutHandleAsString);

        Initialize(streamIn, StreamOut);
    }

    public void Sync()
    {
        // Sync code
    }
}

public class Server : Node
{
    private readonly AnonymousPipeServerStream streamIn;
    private readonly AnonymousPipeServerStream streamOut;

    public Server()
    {
        streamIn = new AnonymousPipeServerStream(PipeDirection.In, HandleInheritability.Inheritable);
        streamOut = new AnonymousPipeServerStream(PipeDirection.Out, HandleInheritability.Inheritable);

        ClientPipeInHandleAsString = streamOut.GetClientHandleAsString();
        ClientPipeOutHandleAsString = streamIn.GetClientHandleAsString();

        Initialize(streamIn, streamOut);
    }

    public string ClientPipeInHandleAsString { get; private set; }
    public string ClientPipeOutHandleAsString { get; private set; }

    public void Sync()
    {
        streamIn.DisposeLocalCopyOfClientHandle();
        streamOut.DisposeLocalCopyOfClientHandle();

        // Sync code
    }
}

Secondly, I think how and where to implement IDisposable is better fit for a separate question but I think I first need to decide which of the 2 above approaches the industry would rather have.

can i know if a bitcoin private/public key or address derived from other key in hd wallet by it’s structure?

Individual address private keys begin with 5,L or K. What you’re calling root private keys are actually called extended private keys and they begin with ?prv where ? is either x,z,y,Y,Z. You can see examples of those here. So that’s how you tell the difference.

ag.algebraic geometry – Compare bounded (unbounded) derived categories of D-modules

I am reading (HTT, D-modules, Perverse Sheaf and Representation Theory). In (HTT, 1.5.7, page 32), it is claimed that an equivalence of categories between bounded derived category with quasi-coherent cohomologies and bounded derived category of quasi-coherent sheaves of $D_X$ modules
$$D_{qc}^b(mathrm{Mod}(D_X))sim D^b(mathrm{Mod}_{qc}(D_X)).$$
It says that “It will not be used in what then follows and the proof is omitted.” The refference it cited is (Borel, Algebraic D-modules VI.2.10. page 222), whose proof is really short (almost 1 page). However, it seems there are some problems.

Firstly, some notations do not make sense. In (Borel), $mathcal{A}$ is a quasi-coherent sheaf of $mathcal{O}_X$-algebras (Not necessarily be commutative. In our case, $D_X$ is non-commutative). Let us assume $X$ is a “good” scheme. It is denoted by $mu (mathcal{A})$ the category of quasi-coherent $mathcal{A}$-modules, where quasi-coherent means quasi-coherent over $mathcal{O}_X$. Our goal is to prove the fully faithfulness
$$mathrm{Hom}_{D(mu (A))}(F^cdot, G^cdot)=mathrm{Hom}_{D_{qc}(mathrm{Mod}(mathcal{A}))}(F^cdot, G^cdot),~F^cdot,G^cdotin D^b(mu (mathcal{A})),$$
In the second set $mathrm{Hom}_{D_{qc}(mathrm{Mod}(mathcal{A}))}(F^cdot, G^cdot)$ a morphism is represented by a third complex $H^cdot$ which may not in $mu(mathcal{A})$, and a quasi-isomorphism. In (Borel), the following notation of $mathrm{Hom}^cdot$-complex seems uncorrect
$$mathrm{Hom}^cdot_{D(mu (A))}(F^cdot, G^cdot) .$$
I will assume that this is a typo in the following.

Secondly, I do not understand how it was able to reduce to the affine case in (Borel). I do know the adjointness of pushforward and pullback
$$mathrm{Hom}_{mathcal{A}}(F^cdot,i^*(tilde{J}))=mathrm{Hom}_{mathcal{A}|_U}(F^cdot|_U,tilde{J}).$$
But I am not sure if the following is true
$$mathrm{Hom}_{D(mathcal{A})}(F^cdot,i^*(tilde{J}))=mathrm{Hom}_{D(mathcal{A}|_U)}(F^cdot|_U,tilde{J})$$

Thirdly, I have another possible explanation using $mathrm{Hom}^cdot$-complex and $Rmathrm{Hom}$ by using an injective resolution of $G^cdot$ in $K^+(mathrm{Mod}_{qc}(mathcal{A})))$, say $I^cdot in mathrm{Ob}(K^+(mathrm{Mod}_{qc}(mathcal{A})))$. Then
$$H^0Rmathrm{Hom}_{mu(mathcal{A})}(F^cdot,G^cdot)=H^0mathrm{Hom}^{cdot}_{mu(mathcal{A})}(F^cdot,I^cdot)cong mathrm{Hom}_{D^+(mu(mathcal{A}))}(F^cdot,G^cdot)$$
This approach finally suffers from I do not know if an injective object in $mu(mathcal{A})$ is injective in $mathrm{Mod}(mathcal{A})$. In (HTT, 1.4.14, page 29) it was particularly added a comment “We do not claim that $I$ is injective in $mathrm{Mod}(D_X)$“. In (Thomason and Trobaugh, Higher Algebraic K-theory of schemes and of derived categories, Appendix B.4, page 410), it is explained that in a general scheme, the right derived funtor in $mathrm{Mod}(mathcal{O}_X)$ and the right derived funtor in $mathrm{Mod}_{qc}(mathcal{O}_X)$ could have different effects on quasi-coherent objects (SGA 6, II App. I 0.2). While in Noetherian case, they are the same, essentially because the injective objects in $mathrm{Mod}(mathcal{O}_X)$ are also injective in $mathrm{Mod}_{qc}(mathcal{O}_X)$ on a Noetherian scheme (Hartshorne, Residues and Duality, 7.18, 7.19, page 133).

I noticed that in (Bökstedt-Neeman, Homotopy limit and derived category, corollary 5.5), it is true for a quasi-compact and separated scheme that the natrual inclusion
$$D(mathrm{QCoh}(mathcal{O}_X)) to D_{qc}(mathrm{Mod}(mathcal{O}_X))$$
is an equivalence of category
But their proof is pretty long and I am not familiar with them. I do not know what is essential so far and whether it extends to our case for D-modules.
Also see (Stacks project, 36.3) for the affine case, whose proof is not so short. These kind of results are unbounded.

Bernstein himself in his notes (Bernstein, Algebraic theory of D-moduls, page 14, lemma) claimed a similar without proof. He simply said “properties of coherent D-modules imply the natural morphism
$$D_{coh}(mathrm{Mod}(D_X))to D(mathrm{Mod}_{coh}(D_X))$$
is an equivalence of categories”. But it seems (Bökstedt-Neeman)’s long argument implies that this should not be simple.
I am a beginner, so I am not sure if this question is important. However, it seems that we could restrict ourselves in just one of them safely and put this question aside. Bernstein himself in his notes (Bernstein, Algebraic theory of D-moduls, page 22, remark) said that “I do not know whether the natural morphism $D(Hol(D_X))to D_{hol}(D_X)$ is an equivalence of categories. In a sense, I do not care.”

can sign derived wallet transactions with master seed phrase private key?

I would like to sign a transaction from a wallet which is derived from a seed, and sign it with master seed private key, can I sign any tx of any derived wallet address after the master seed wallet?

thanks a lot.

at.algebraic topology – Is the derived category of local systems equivalent to the derived category of sheaves of vector spaces with local system cohomology?

Let $k$ be a field and $X$ a topological space.

Write $mathrm{Sh}(X)$ for the category of sheaves of vector spaces on $X$, and $mathrm{Loc}(X)$ for the subcategory of local systems of finite dimensional $k$-vector spaces.

The category not local systems is an abelian category, so we can form the derived category $D(Loc(X))$. This is the category of complexes of local systems on $X$ with quasi-isomorphisms inverted.

We can also consider the subcategory $D_{mathrm{Loc}}(X)$ of $D(X):=D(mathrm{Sh}(X))$ consisting of complexes whose cohomology sheaves are local systems on $X$.

I have two questions:

  1. Is $D_{mathrm{Loc}}(X)$ a triangulated subcategory of $D(X)$? More precisely is it closed under taking mapping cones?
  2. Under what hypotheses (if any) are $D_{mathrm{Loc}}(X)$ and $D(mathrm{Loc}(X))$ equivalent?

Are derived attributes transitive dependencies?

So I was drawing a dependency diagram for a table and this point striked me if derived attributes are transitive dependency?
Image
Here, is TOTAL_AMT in a transitive dependency? Or is the table in 3NF since there is no transitive dependency?
Please clarify this doubt.

Derived from a pseudo-differential operator

I want to show that $ D ^ { alpha} _x a (x, D) u (x) = (2n) ^ {- n} langle tilde {u}, D ^ { alpha} _x (e ^ {ix xi} a (x, xi)) rangle $, where $ a (x, D) $ It is a pseudo-differential operator, and to calculate the derivative I am hesitating between these two answers:

begin {align *}
D ^ { alpha} _x a (x, D) u = & D ^ { alpha} _x Big ( frac {1} {(2 pi) ^ n} int e ^ {ix xi} a (x, xi) widehat {u} ( xi) d xi Big) \
= & frac {1} {(2 pi) ^ n} int D ^ { alpha} _x (e ^ {ix xi} a (x, xi)) widehat {u} ( xi) d xi \
end {align *}

and
$$ D ^ { alpha} _x a (x, D) u = frac {1} {(2 pi) ^ n} int e ^ {ix xi} D ^ { alpha} _x a (x , xi) widehat {u} ( xi) d xi $$

Thanks in advance!