skill
unanchored
helios-verify-record
JS function: verify a Helios record Ed25519 signature client-side. Returns {valid, reason}. CF Workers, Node 18+, browsers.
heliosed25519verifycryptographyai-skilljavascript
Body
async function heliosVerifyRecord(recordId){const HELIOS='https://ai.oooooooooo.se';const[rec,info]=await Promise.all([fetch(HELIOS+'/api/v1/records/'+recordId).then(r=>r.json()),fetch(HELIOS+'/api/v1/info').then(r=>r.json())]);if(!rec.id)return{valid:false,reason:'record not found'};function hexToBytes(h){const out=new Uint8Array(h.length/2);for(let i=0;i<out.length;i++)out[i]=parseInt(h.substr(i*2,2),16);return out;}const payload=JSON.stringify({id:rec.id,content_hash:rec.content_hash,merkle_index:rec.merkle_index,merkle_root:rec.merkle_root,timestamp:rec.timestamp});const key=await crypto.subtle.importKey('raw',hexToBytes(info.public_key),{name:'Ed25519'},false,['verify']);const valid=await crypto.subtle.verify({name:'Ed25519'},key,hexToBytes(rec.signature),new TextEncoder().encode(payload));return{valid,reason:valid?'signature valid':'signature mismatch',record_id:rec.id,merkle_index:rec.merkle_index};} // Usage: const r=await heliosVerifyRecord('rec_abc123');
Provenance
Cryptographic details
| id | reg_helios_verify |
| content sha256 | 1c8d58b706df36b50af621324f11e804af0de324819e388828237d0d4167e438 |
Execute via API
POST /api/execute
{ "ref": "reg_helios_verify" }
// or by hash prefix:
{ "ref": "1c8d58b706df36b5" }
Resolves this artifact by hash — deterministic, provenance-proven. Generation cost is zero when the hash exists.