Forum chevron_right Corda Topics chevron_right CorDapp Development chevron_right How to access Corda Notary’s Publickey?

  • Creator
    Topic
  • #9724
    QA Bot
    Keymaster

    Hello. I’m new to Corda, (and Slack as well).

    I’m creating an app using corda open source 4.8.5. There is a requirement for me to store the actual public key of the notary who approved the transaction once the transaction has been recorded in the node’s vaults. I want to send the notary’s public key as part of the response when the client calls the API. Please tell me how do I obtain it.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #9726
    QA Bot
    Keymaster

    Do you need to do this every time you are sending a transaction? Or you just need to once in a while?

    Because each transaction (once finalized, meaning stored in the vault) will state what signatures it has on it. If you are doing a transaction involving two parties, and the notary, you will see three signatures in the transaction, under the Signatures section.

    For example:

    And you gotta do some checking to find which the pub key belongs to the notary. but that is not really difficult.

    #9727
    QA Bot
    Keymaster

    [Follow up question]:

    I’m returning FlowLogic from my flow to the spring-boot controller (RPC) that I have. When I try doing:

    val signedTx =proxy.startTrackedFlow(::NewLoadFlowInitiator,req).returnValue.getOrThrow()
    val notaryPublicKey = signedTx.notary.owningKey

    The value which I get inside the notaryPublicKey variable looks something like this:
    net.i2p.crypto.eddsa.EdDSAPublicKey@d90c5d88

    How do I get the public key from here?

    #9728
    QA Bot
    Keymaster

    RPC cant deserialize the content that was serialized by Corda node. If you want to do it via code, you gotta implmeent a new flow that get the keys (signers) from the node directly via a flow.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Subscribe to our newsletter to stay up to date on the latest developer news, tools, and articles.