cairn-cli 0.1.6

Backpac Agent-Native CLI for autonomous settlement workflows
Documentation
fn main() {
    let wallet_file: Vec<u8> = vec![114,147,178,86,109,101,92,89,64,113,139,40,164,247,79,32,2,170,19,0,34,189,59,224,230,196,225,47,14,188,224,220,160,91,118,254,241,12,235,238,190,24,75,113,77,47,51,79,21,242,145,102,154,93,23,141,237,38,200,128,108,195,168,227];
    
    let wallet_address = bs58::encode(&wallet_file[32..]).into_string();
    let wallet_lower = wallet_address.to_lowercase();
    
    let chain = "solana:devnet";
    let did = "did:key:z6MkhaXgBZDvotDkL5257faiztiCEsJUTtcCjdReE7m1";
    let nonce = "bb82335399edce14da9652840e11ea873f1f982664399c3c9000df07bced96d0";
    
    let expected_challenge = format!(
        "Welcome to Backpac Agent Access.\n\n\
         Please sign this message to verify ownership of this wallet and establish a session.\n\n\
         Wallet: {}\n\
         DID: {}\n\
         Chain: {}\n\
         Nonce: {}",
        wallet_lower, did, chain, nonce
    );
    
    use ed25519_dalek::{SigningKey, Signer};
    
    let mut key_bytes = [0u8; 32];
    key_bytes.copy_from_slice(&wallet_file[..32]);
    let signing_key = SigningKey::from_bytes(&key_bytes);
    
    let signature = signing_key.sign(expected_challenge.as_bytes());
    let sig_b58 = bs58::encode(signature.to_bytes()).into_string();
    
    println!("Rust Signature (Base58): {}", sig_b58);
}