user12983: I want to create ECDSA signature {r,s} where r is very low (for example 1) and can be encoded in DER-format in one byte.
How to calculate k value? Seems to me that it does not depend of anything. What is the value of k which produces r=1 ?
Note: I do not worry for the safety of my private key while publishing this signature.

user21130: the shortest ecdsa secp256k1 outputs I've ever seen have 
x value = 3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63

0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0 --> 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0x3f3979bf72ae8202983dc989aec7f2ff2ed91bdd69ce02fc0700ca100e59ddf3
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1 --> 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0xc0c686408d517dfd67c2367651380d00d126e4229631fd03f8ff35eef1a61e3c

in your ecdsa function, if you use  
p = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141

then you can derive the above results using
((p-1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0

or
((p+1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1

if there is anything smaller, i'd be curious to see it.
Edit
due to comments, I have been directed to a testnet tx that suggests maybe you can get R=1. thanks to amaclin.
testnet tx c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433 

this tx appears to validate, 
there are also others,
c42bea01f1387072772759f32ad860a680e0eea5664732bf2057a66780e7a25d

23202c2534be0567d4b339142f8a9a53545123eb61f61717fdedbef8effc53e0

maybe even more, please add to comments if so.
if I validate the public key signature
026d2204a9535443657a88a0724fbd49a0e78d305f50a82f2cc9dd9bea10a6c5cd

taken from the testnet tx 
c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433

it gives this point where the x = 1
(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

while I can't verify that this point is actually on the sep256k1 curve, it seems to behave like it is, so this is a very interesting one.
if I multiply this point several times by 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72 (lambda value from here)
it produces this cycle of points (3 points with same Y)
(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

if I do the same with the inverse of the point, I get these (inverses of above)
(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x1, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

The X value 
0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee 

in some of those results, also happens to be the beta value from here

user24925: 
What is the value of k which produces r=1 ?

It's impossible to know that. If you could derive r for arbitrary values then ECDSA would be fundamentally broken. The best you can do is grind k until you get an r that happens to have a short encoding.
For the sake of the exercise:
k: 55573144136627188774517374788342221967869962622835886499477787746883063622036
r: 771676860789419846973923839003663416737624455477806040640071960112246091

This nonce will be slightly smaller than most when encoded, but of course if you attempt to use it in a signature you have exposed your private key. If you generate this secretly you can only use the k value once and the result might be at best a couple of bytes difference in the encoded transaction.
It hardly seems worth it to be honest.

12983: <p>I want to create ECDSA signature <code>{r,s}</code> where <code>r</code> is very low (for example <code>1</code>) and can be encoded in DER-format in one byte.</p>

<p>How to calculate <code>k</code> value? Seems to me that it does not depend of anything. What is the value of <code>k</code> which produces <code>r=1</code> ?</p>

<p>Note: I do not worry for the safety of my private key while publishing this signature.</p>
 21130: <p>the shortest ecdsa secp256k1 outputs I've ever seen have </p>

<pre><code>x value = 3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63

0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0 --&gt; 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0x3f3979bf72ae8202983dc989aec7f2ff2ed91bdd69ce02fc0700ca100e59ddf3
0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1 --&gt; 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63, 0xc0c686408d517dfd67c2367651380d00d126e4229631fd03f8ff35eef1a61e3c
</code></pre>

<p>in your ecdsa function, if you use  </p>

<pre><code>p = 0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141
</code></pre>

<p>then you can derive the above results using</p>

<pre><code>((p-1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0
</code></pre>

<p>or</p>

<pre><code>((p+1)/2) = 0x7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a1
</code></pre>

<p>if there is anything smaller, i'd be curious to see it.</p>

<p><strong>Edit</strong></p>

<p>due to comments, I have been directed to a testnet tx that suggests maybe you can get R=1. thanks to amaclin.</p>

<p>testnet tx <a href="https://testnet.smartbit.com.au/tx/c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433" rel="nofollow noreferrer">c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433 
</a></p>

<p>this tx appears to validate, 
there are also others,
<a href="https://testnet.smartbit.com.au/tx/c42bea01f1387072772759f32ad860a680e0eea5664732bf2057a66780e7a25d" rel="nofollow noreferrer">c42bea01f1387072772759f32ad860a680e0eea5664732bf2057a66780e7a25d
</a>
<a href="https://testnet.smartbit.com.au/tx/23202c2534be0567d4b339142f8a9a53545123eb61f61717fdedbef8effc53e0" rel="nofollow noreferrer">23202c2534be0567d4b339142f8a9a53545123eb61f61717fdedbef8effc53e0
</a></p>

<p>maybe even more, please add to comments if so.</p>

<p>if I validate the public key signature</p>

<pre><code>026d2204a9535443657a88a0724fbd49a0e78d305f50a82f2cc9dd9bea10a6c5cd
</code></pre>

<p>taken from the testnet tx </p>

<pre><code>c6c232a36395fa338da458b86ff1327395a9afc28c5d2daa4273e410089fd433
</code></pre>

<p>it gives this point where the x = 1</p>

<pre><code>(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)
</code></pre>

<p>while I can't verify that this point is actually on the sep256k1 curve, it seems to behave like it is, so this is a very interesting one.</p>

<p>if I multiply this point several times by 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72 (<a href="https://bitcoin.stackexchange.com/questions/35814/how-do-you-derive-the-lambda-and-beta-values-for-endomorphism-on-the-secp256k1-c">lambda value from here</a>)</p>

<p>it produces this cycle of points (3 points with same Y)</p>

<pre><code>(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)

(0x01, 0xbde70df51939b94c9c24979fa7dd04ebd9b3572da7802290438af2a681895441)
</code></pre>

<p>if I do the same with the inverse of the point, I get these (inverses of above)</p>

<pre><code>(0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x851695d49a83f8ef919bb86153cbcb16630fb68aed0a766a3ec693d68e6afa40, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)

(0x1, 0x4218f20ae6c646b363db68605822fb14264ca8d2587fdd6fbc750d587e76a7ee)
</code></pre>

<p>The X value </p>

<pre><code>0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee 
</code></pre>

<p>in some of those results, also happens to be the <a href="https://bitcoin.stackexchange.com/questions/35814/how-do-you-derive-the-lambda-and-beta-values-for-endomorphism-on-the-secp256k1-c">beta value from here</a></p>
 24925: <blockquote>
<p>What is the value of <code>k</code> which produces <code>r=1</code> ?</p>
</blockquote>
<p>It's impossible to know that. If you could derive <code>r</code> for arbitrary values then ECDSA would be fundamentally broken. The best you can do is grind <code>k</code> until you get an <code>r</code> that happens to have a short encoding.</p>
<p>For the sake of the exercise:</p>
<pre><code>k: 55573144136627188774517374788342221967869962622835886499477787746883063622036
r: 771676860789419846973923839003663416737624455477806040640071960112246091
</code></pre>
<p>This nonce will be slightly smaller than most when encoded, but of course <strong>if you attempt to use it in a signature you have exposed your private key</strong>. If you generate this secretly you can only use the <code>k</code> value once and the result might be at best a couple of bytes difference in the encoded transaction.</p>
<p>It hardly seems worth it to be honest.</p>
