Skip to content
This repository was archived by the owner on Jun 11, 2022. It is now read-only.

Cannot find inputs within the local UTxOs #42

Closed
purplecity opened this issue Nov 1, 2018 · 17 comments · Fixed by #43
Closed

Cannot find inputs within the local UTxOs #42

purplecity opened this issue Nov 1, 2018 · 17 comments · Fixed by #43
Assignees
Labels
bug Something isn't working
Milestone

Comments

@purplecity
Copy link

on C: import the file, sent it to network

when I use command

"cardano-cli transaction add-input 25Ab2p01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 "

01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 is one address's utxo but not exist in I machine.

Errror:Cannot find inputs within the local UTxOs

so it is mean when create a transaction. input addr must in local machine ????

I just want use one addr utxo then create transaction. then send transaction to another machine which not connect internet to sign it .

@NicolasDP NicolasDP added the bug Something isn't working label Nov 1, 2018
@NicolasDP NicolasDP self-assigned this Nov 1, 2018
@NicolasDP NicolasDP added this to the alpha3 milestone Nov 1, 2018
@NicolasDP
Copy link
Contributor

thanks this is indeed a bug

@NicolasDP
Copy link
Contributor

NicolasDP commented Nov 1, 2018

You need to add the expected value at the transaction when you add the add-input too. If you don't the CLI will look for the value within the wallets.

cardano-cli transaction add-input ${STAGING_ID} ${TRANSACTION_HASH} ${INDEX} ${EXPECTED_VALUE}

@purplecity
Copy link
Author

@NicolasDP brother I just want add-input without wallet(I have record utxo since the address was created so I don't wan't recover wallet in CLI) in machine A. then I export tx and import tx in machine B( B is disconnect network) to sign tx---->export signed tx from B--->import signed tx to machine A ----> send tx. Is this process ok?

@NicolasDP
Copy link
Contributor

  • there is a bug indeed, thanks for reporting this, it will be fixed with fix wrong clap identifier for UTXO's value in add-input command #43 ;
  • you can (once fix wrong clap identifier for UTXO's value in add-input command #43 is fixed) add inputs without needing the wallets. As I said, to not need the wallets all you need is to add what are the value (the number of Lovelace) at that input. If you don't provide this value, we will look in the local wallets this UTxO to find out the input value. And if there is no wallet it will just fail as you have experienced it. so use: cardano-cli transaction add-input ${STAGING_ID} ${TRANSACTION_HASH} ${INDEX} ${EXPECTED_VALUE} where:
    • STAGING_ID is the staging transaction identifier you are building;
    • TRANSACTION_HASH is the first part of the UTxO;
    • INDEX is the second part of the UTxO;
    • EXPECTED_VALUE is the amount present at this UTxO. This one is optional and if you don't set it, it will look in the local wallets (and if there is none it will fail to add the UTxO).

So on machine A:

STAGING_ID=$(cardano-cli transaction new mainnet)
cardano-cli transaction add-input ${STAGING_ID} 25Ab2p01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 1000000
cardano-cli transaction add-output ${STAGING_ID} Aa2...
cardano-cli transaction export ${STAGING_ID} transaction.yaml

On machine B:

cardano-cli transaction import transaction.yaml
... finalize
... sign
... export ${STAGING_ID} signed_transaction.yaml

on machine A:

import signed_transaction.yaml
send ${STAGING_ID} mainnet

@purplecity
Copy link
Author

baby thanks it is very helpful for me

@NicolasDP
Copy link
Contributor

baby ?

@purplecity
Copy link
Author

haha.....Don't worry,just kidding, sincere thanks

@purplecity
Copy link
Author

@NicolasDP I git clone https://github.com/input-output-hk/cardano-cli.git --recursive. when I add-put without local wallet. still "Cannot find inputs within the local UTxOs "!!!

@NicolasDP NicolasDP reopened this Nov 1, 2018
@NicolasDP
Copy link
Contributor

This is frustrating... Can you please, give us exactly the commands you are typing (you can add gibberish instead of the exact value of the utxo to prevent leaking your UTxOs) ?

And the result of git log -n 1 | cat at the root repository where you built it?

@purplecity
Copy link
Author

OH! Merge pull request #40 from mzabaluev/nice-load-error,NOT #42

wechatimg3

@purplecity
Copy link
Author

sorry. still error like this. althought I have the latest commit c754dc8

wechatimg4

@purplecity
Copy link
Author

sorry I need to sleep... see u tomorrow...

@NicolasDP
Copy link
Contributor

I see your error message, but I don't see the command you are using. But from what I can guess you are typing:

cardano-cli transaction add-input 5ufJdi 03cd9197ad8e.... 1

This will indeed lookup for wallets.

You need to add the value present at this UTxO, for example for the UTxO you gave in the first comment (01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2) the value is 29000000.

cardano-cli transaction add-input 5ufJdi 01affa1bc8f35efeb7eea54e2ac1113f80d8628502c0f5a87f3295634f6df53f 2 29000000

@purplecity
Copy link
Author

thanks. sorry I forget value and now add-input is ok. but when I sign in machine B which is disconnect network. error happened.
wechatimg6

then I create new blockchain.and wallet attach it. but because I disconnect network. so I have not to sync anything. can't sign tx and witness still is None. wallet and UTXOs is associated.
wechatimg8

@NicolasDP
Copy link
Contributor

Hmm... i see. I think this is where we find a limit to what we have so far. The wallet is using a BIP44 model. In order to sign the UTxO we need to know how to derive the private key from the root private key. And in order to do that we need to know the history of the generated addresses present in the blockchain (because bip44 is using incremental addressing, link here for more details).

So we don't support yet Offline wallets yet. You can prepare a transaction on one machine and sign it on another. But you need the wallet to be Online.

@purplecity
Copy link
Author

to avoid derive the private key from the root private key.-----. I try it . although I created wallet and address in offline machine B,then I transfer some ada to B's wallet address. created tx in A, still can't sign in B.

So it is mean has no offcial way offline sign tx yet ????

@NicolasDP
Copy link
Contributor

no not yet indeed. Can we create a new issue to track this and close this ticket ? Since the underlying issue has been fixed (the add-input needing to find the wallet in the local machine at every time).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants