-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Diffeculty in fulfilling a ed25519 signature #51
Comments
This is definitely the right place to ask questions! Could you share the code sample you're using so I can try to reproduce the error? |
Sure here is a gist of the sender and receiver clients. https://gist.github.com/inacali/b14864b2ed91c3e9b9b4b55f3630d0f7 |
I think this is actually a bug in the If you run the following and leave out the const cc = require('five-bells-condition')
const ed25519 = require('ed25519')
const seed = Buffer.from('833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42', 'hex')
const keypair = ed25519.MakeKeypair(seed)
const edff = new cc.Ed25519()
edff.setPublicKey(keypair.publicKey)
const condition = edff.getConditionUri()
const message = new Buffer('Hello World! Conditions are here!')
edff.sign(message, seed)
const fulfillment = edff.serializeUri()
const valid = cc.validateFulfillment(fulfillment, condition, message)
console.log('valid', valid) |
Thanks for quick reply mate, makes a lot of sense now. |
@emschwartz is incorrect - we're using crypto-conditions as a simple trigger, so the ledger is right in not passing a message. Basically, all the ledger cares about is that you tell it what it should be waiting for (condition) and when it gets that thing (fulfillment). There is no need for a message to verify. If you would like to verify a signature with a message in a condition, you need to somehow bake the message into the condition. Fortunately, there is a way to do just that: Use a In effect the ledger will call I've updated your gist for you. Untested, but this should work: https://gist.github.com/justmoon/2a1b7b4e0138a20be415c2607fd94c0a |
Was working down the different types didn't get to the prefix type yet, now very clear how useful it is. Thanks a bunch to both of you. I will close this issue now. |
Hi guys I am playing around with interledger at the moment, and am trying to better understand crypto conditions by building a simple client using ilp-core and five bells ledger ilp plugin, so far I've got the example to work with the pre-image 256, but having difficulty in getting an ed25519 signature to fulfill, the transaction is failing due to condition not being fulfilled, Am i right in thinking the fulfillment serialized uri is what is required to fulfill the condition of an ed25519 signature or is it something else? Whilst fulfilling the condition on the reciever client I am getting an
UnmetConditionError
.Here are the steps I've taken so far
receiver.on('receive', function(transfer){ console.log("Here is the transfer", transfer ) receiver.fulfillCondition(transfer.id, fulfillment) .then(() => { console.log('Successfully submitted fulfillment' + fulfillment) return 'sent' }) .catch((err) => { console.log('Error submitting fulfillment', err) }) })
ExternalError: Remote error: status=422 body={"id":"UnmetConditionError","message":"Invalid fulfillment: ValidationError: Invalid ed25519 signature"}
const result = cc.validateFulfillment(fulfillment, condition, message)
I get true.Am i missing a step in fulfilling a signature? or is something else incorrect. Sorry in advance if this is wrong forum for these type of questions?
The text was updated successfully, but these errors were encountered: