Giter Site home page Giter Site logo

Comments (7)

SebastienGllmt avatar SebastienGllmt commented on July 17, 2024 1

https://github.com/ArkEcosystem/platform-sdk/blob/a1850682b95714e360fd9a8dcd3ce3f6cee05220/packages/platform-sdk-ada/src/services/identity/shelley.ts#L39

for deriveSpendKey, deriveChangeKey and deriveStakeKey these should NOT be hardened (in the same way they are not hardened in BIP44). Only derivation paths up the account key are hardened.

from cardano-serialization-lib.

SebastienGllmt avatar SebastienGllmt commented on July 17, 2024

CardanoWasm.TransactionHash.from_bytes(Buffer.from(utxo.transaction.hash, "hex"))

This is incorrect, You have to use the hash of the tx you're building, not the hash of the tx the utxo belongs to (aka use txHash instead like you have later in the code). Transactions will fail if you add witnesses that aren't required to avoid people dumping unnecessary witnesses onto the chain.

Also, are you sure the UTXO belongs to the account key and not an address generated from the account key?

from cardano-serialization-lib.

faustbrian avatar faustbrian commented on July 17, 2024

CardanoWasm.TransactionHash.from_bytes(Buffer.from(utxo.transaction.hash, "hex"))

This is incorrect, You have to use the hash of the tx you're building, not the hash of the tx the utxo belongs to (aka use txHash instead like you have later in the code). Transactions will fail if you add witnesses that aren't required to avoid people dumping unnecessary witnesses onto the chain.

Changed it back to what we had previously ArkEcosystemArchive/platform-sdk@1f04ce0. Currently we are using 3 values to sign, which of those would be required or allowed to be used before the transaction gets rejected?

Also, are you sure the UTXO belongs to the account key and not an address generated from the account key?

We derive UTXO for a specific address like this https://github.com/ArkEcosystem/platform-sdk/blob/feat/broadcast-tx-graphql/packages/platform-sdk-ada/src/services/transaction.ts#L215-L238. Is there any way to retrieve UTXO directly for an account key or how should we retrieve UTXO to sign a new transaction?

from cardano-serialization-lib.

SebastienGllmt avatar SebastienGllmt commented on July 17, 2024

You're going to have to build a mapping of which derivation path corresponds to which address in the wallet that way you know which path to use to derive the key for the witness

Is there any way to retrieve UTXO directly for an account key or how should we retrieve UTXO to sign a new transaction?

You can't get the UTXO by querying addresses. You have to get UTXOs by querying the payment credentials inside the transactions. I don't use cardano-graphql so I'm not sure the best way to do that kind of query

from cardano-serialization-lib.

faustbrian avatar faustbrian commented on July 17, 2024

Thanks, will give the derivation path mapping a shot and see if we can get the transaction accepted.

from cardano-serialization-lib.

marianogoldman avatar marianogoldman commented on July 17, 2024

@SebastienGllmt. Before going for the calculation of the full mapping, we're trying to have at least one transaction accepted with all data controlled. So we're trying a specific address which has only one utxo, but we can't get it through, so not even sure how to build the mapping if we can't get this one right. Perhaps you can easily spot what's wrong...

In this test we're trying to do the transfer.

This is the code that creates and signs the transaction.

from cardano-serialization-lib.

faustbrian avatar faustbrian commented on July 17, 2024

Thanks! Overlooked that bit, working fine now.

from cardano-serialization-lib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.